Jump to content


Cannot pip install p4python on Windows

pip python reproducbility

  • Please log in to reply
2 replies to this topic

#1 jholland

jholland

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 18 April 2017 - 08:25 PM

Hello,

I recently attempted to install p4python on a Windows machine, something I have done several times successfully in the past. Starting today (I'm not sure the last time I successfully installed), I can't install on Windows 7 (SP 1). The issue is exactly what is posted here, except it affects all versions of python: https://forums.perfo...-36-on-windows/

In setup, the current version of p4python makes requests to ftp.perforce.com looking for a tar file with the api. Looking there, though, there are no more tar files. Instead, it seems everything is a zip now for windows. In addition, it seems paths are case sensitive now, so the construction of a windows folder name needs to use the lower case version, or the ftp library just throws errors.

Any idea on when we could expect fixes for this problem?

Also, a second question. Since setup.py reaches out to your server, this can affect reproducibility of our builds. We have a server that caches the versions of libraries we use (yes it is using the latest, I checked and also installed straight from pypi), but since setup.py makes a live web request, we have no guarantee everything will be the same if reinstall that same version. What would be the best method for preserving the state of the module?

Thanks

#2 P4Reg

P4Reg

    Advanced Member

  • Staff Moderators
  • 98 posts

Posted 19 April 2017 - 12:11 PM

I had the same error "Loaded API into None" on my windows 10 machine trying to install p4python with "pip install p4python".

Upgrading pip from 1.5.6 to 9.0.1 fixed it:

python -m pip install -U pip

(from https://pip.pypa.io/.../#upgrading-pip)


Now p4python installs:

pip install p4python
Collecting p4python
  Downloading p4python-2016.2.1498648-cp34-cp34m-win_amd64.whl (1.7MB)
    100% |################################| 1.7MB 501kB/s
Installing collected packages: p4python
Successfully installed p4python-2016.2.1498648

#3 jholland

jholland

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 19 April 2017 - 04:32 PM

Thanks for getting back to me. :)

Quote

I had the same error "Loaded API into None" on my windows 10 machine trying to install p4python with "pip install p4python".

Upgrading pip from 1.5.6 to 9.0.1 fixed it:

I'm pretty sure the newer pip is grabbing the pre-compiled wheel for the particular OS, where as it used to grab source. (That solution did work for me partially, but we have other reasons we use an older pip in some locations.)
If you were to use the source, you still run into the problem on Windows. I assume the OS specific wheels were created before the Windows tars disappeared off the server.

pip install https://pypi.python.org/packages/ad/f8/5d31e3b042eee7c8f6e09d482a3816d8b5c2d01a66073d4e48960afdd101/p4python-2016.2.1498648.tar.gz#md5=d958a7501ade5331a6d889689a5dc862

It does seem that those wheel's help partially with the reproducibility problem I called out, but *nix targets won't have that same reproducibility. That pretty much means functionality could differ for anyone running p4python on windows and *nix, since the windows packages would used their cached api at the time of creation while an install on *nix would go look for the latest API. (Of course, that's not an issue if changes to both are synchronized.)

To prevent confusion: p4python does still work on *nix; it looks for a different API archive on the server.





Also tagged with one or more of these keywords: pip, python, reproducbility

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users