Jump to content


P4Python installer will not run

Python P4Python installer

  • Please log in to reply
10 replies to this topic

#1 Orthoducks

Orthoducks

    Member

  • Members
  • PipPip
  • 14 posts

Posted 06 October 2015 - 10:01 PM

I'm trying to install P4Python (64-bit version) under Windows 7 Enterprise. I'm getting the error box that says "There was a problem tying [sic] to get the P4Python install path." I'm trying to figure out why.

Here are the "Possible reasons" listed in the error box, with comments:

1) Python is not installed.

It's not only installed, it's installed twice. Our shop standard is Python 2.7, but when I couldn't P4Python with that, I installed Python 3.5 as well. Both versions of Python are in the system path, but the EXEs are differently named so I can run either version from the command line. The 3.5 directory is first so that if the installer tries to load some other Python file it will find it in the 3.5 directory.


2) An unsupported version or architecture of Python is installed.

It's the 64 bit version of Python. It's version 3.5, the current stable version, instead of 3.3. I trust that P4Python isn't that fussy enough to complain about that. (It isn't, is it? Really?)

3) The folder containing the Python executable is not in the system path.

See #1.

4) Another version or architecture of Python is in the system path before the supported version or architecture.

See #1.

5) The P4Python install paths are not writable.

The installer doesn't explain what the P4Python install paths are (or even what "install paths," in the plural, means), so I can't answer this one way or the other. If it's referring to the Python program directory, it's as writable as it can get, because I ran the installer as Administrator.

So I appear to have ruled out every documented reason for the installer to fail. Why is it failing?

#2 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 07 October 2015 - 11:10 PM

Sorry to hear you are having trouble installing. Please confirm the following:

a] Please send the following version details:
  • Perforce version: p4 info
  • Python version: python -V
  • Python compiler: python -c 'from platform import python_compiler; print python_compiler()'
  • P4Python version: python -c 'import P4; print(P4.P4.identify())'
b] You are having issues with Python 3.5 on Windows 7 64-bit, correct? I do not see Python 3.5 listed in the release notes so it may not be tested and verified yet. Please try using Python 3.4 to install instead.  The Compatibility section mentions Python 3.4 releases are compatible with P4Python 2014.1 versions or later.

  http://www.perforce....pythonnotes.txt

c] Are you using a 32-bit installer to install P4Python on a 64-bit Windows machine?

#3 Orthoducks

Orthoducks

    Member

  • Members
  • PipPip
  • 14 posts

Posted 12 October 2015 - 04:47 PM

Here are my responses.

Perforce version: Here is what "p4 -V" displays:

Perforce - The Fast Software Configuration Management System.
Copyright 1995-2014 Perforce Software.  All rights reserved.
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/)
See 'p4 help legal' for full OpenSSL license information
Version of OpenSSL Libraries: OpenSSL 1.0.1g 7 Apr 2014
Rev. P4/NTX64/2014.1/821990 (2014/04/08).

Python version: I'm currently trying to use Python 3.5. I'll try 3.4 if you think that will help.

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AM
D64)] on win32

Python compiler: 'MSC v.1900 64 bit (AMD64)'
P4Python version:

The file name is p4python-3.3-x64.exe.

The Properties dialog says that the product name is "Perforce P4Python API for Python 3.3.6[truncated]. Product version is 151.106.2785.

I don't see anything in the Properties box that is comparable to "2014.1."


I installed Python 3.4.1, but I couldn't try it because I don't know where the installer put it. I don't see it in the system path or a start menu search for "python." Perhaps I'll have to try a different installer.

#4 Orthoducks

Orthoducks

    Member

  • Members
  • PipPip
  • 14 posts

Posted 12 October 2015 - 09:35 PM

Later: I couldn't find an executable installer for Python 3.4.1, but I found an MSI installer for 3.4.2, which worked.

After I installed it I tried to install P4Python, and I got the same error as with Python 3.5.

The installer put the Python34 directory at the front of the path, so I know it was finding the right Python (assuming it uses the path).

#5 Jason

Jason

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 13 October 2015 - 04:56 PM

This may not be the answer -- but this is common thing I've seen and my response to users are:
1. Open your 'advanced system settings' (windows key + pause/break, check left hand side of the screen for settings option)
2. Select 'Environment Variables'
3. Under system variables check to ensure the 'path' includes your Python path ie: c:\python34\

The reason why this may have worked for you with a different installer is that you may have found a custom installer that actually adds that path variable.  I just installed version 3.5 of python from the Python website -- and the 3.5 was not added to the path variable.

Hope this helps,

J.


View PostOrthoducks, on 12 October 2015 - 09:35 PM, said:

Later: I couldn't find an executable installer for Python 3.4.1, but I found an MSI installer for 3.4.2, which worked.

After I installed it I tried to install P4Python, and I got the same error as with Python 3.5.

The installer put the Python34 directory at the front of the path, so I know it was finding the right Python (assuming it uses the path).


#6 Orthoducks

Orthoducks

    Member

  • Members
  • PipPip
  • 14 posts

Posted 14 October 2015 - 10:58 PM

I rebuilt the project with the Python 3.4 directory at the front of the path. I got the same thing. That's in the nature of a double-check, because I did set it the last time.

I'm still interested in making the installer work, but I'm starting to wonder if there is a way to install the API without it. Can you give me any advice on that?

#7 Orthoducks

Orthoducks

    Member

  • Members
  • PipPip
  • 14 posts

Posted 21 October 2015 - 10:30 PM

I believe I've learned something that will help us solve this.

I found a third-party installer for P4Python for 2.7. It didn't work, but it gave me a more informative error: "Python 2.7 required, which was not found in the registry."

This is my first hint that Python is supposed to be in the registry. It doesn't say what is supposed to be in the registry, but I searched the whole registry and found nothing that looks like a legitimate entry for Python (as opposed to applications that support a Python interface).

Now, this is after I've installed at least three versions of Python (2.7. 3.5, and 3.4) with installers from python.org. If the installers are really supposed to create registry entries, something is systematically wrong.

I suspect that Perforce's P4Python installer was also looking in the registry when it said that "There was a problem tying to get the P4Python install path." It just didn't explain where it was looking (or explain very clearly what it was looking for), so I had no clue what to investigate.

My questions now are:

1. Is a Windows Python installer indeed supposed to create registry entries?
2. If so, does the P4Python installer look for them, and does it give the "...tying to get the P4Python install path" error if it doesn't find them?
3. If so, exactly what does the P4Python installer look for? If I can create the necessary entries by hand, it should solve the problem.

#8 Orthoducks

Orthoducks

    Member

  • Members
  • PipPip
  • 14 posts

Posted 26 October 2015 - 08:28 PM

Later -- I got the P4Python 2.7 installer to run. It was failing because it is a 32-bit build, and I accidentally installed a 64-bit Python.

P4Python 3.3 still won't install, though, and that is not the reason; the P4Python 3.3 installer says it's 64-bit, and the Python 3.4 I installed is also 64-bit.

After I installed 32-bit Python 2.7 and P4Python 2.7, I found a Registry entry for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe whose value was the pathname of Python 2.7's python.exe.

After I installed 64-bit Python 3.4 and failed to install P4Python 3.3, I found that the same registry entry's value was the pathname of Python 3.4's python.exe.

Having a working install of P4Python 2.7 solves my immediate problem, but until I can install P4Python 3.3 I can never migrate to Python 3. I'd appreciate any assistance in solving the remaining part of this problem.

#9 CBRS

CBRS

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 30 October 2015 - 03:26 PM

I've had similar trouble with the Windows installer for P4 Python... and adding a specific Python exe to your Windows PATH is not recommended practice.

Allow me to draw your attention to this official blog post:
https://www.perforce...thon-goes-pip-0

P4Python is now distributed via PIP, this has made things a lot easier - though no Python 3.5 support as yet.

With an up to date install of either Python 2.7 or Python 3.4, you should be able to open a command prompt and type:

py -m pip install p4python

More details on this here, including targeting a specific version of Python when you have more than one installed, at the bottom of the page:
https://docs.python....3.4/installing/


Lastly - Perforce guys - it would be great if you could upload P4Python binaries for Python 3.5 to PyPI. At present, you can't even compile these yourself, as there's no Visual Studio 2015 Perforce API package available on the Perforce FTP (please add that too!). ^_^

Thanks.

#10 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 11 November 2015 - 09:52 PM

View PostCB RS, on 30 October 2015 - 03:26 PM, said:

Lastly - Perforce guys - it would be great if you could upload P4Python binaries for Python 3.5 to PyPI. At present, you can't even compile these yourself, as there's no Visual Studio 2015 Perforce API package available on the Perforce FTP (please add that too!). ^_^

Hi,

Thanks for your feedback.  Have you ever tried the Workshop here such as this link which has additional (unsupported) versions?

    https://swarm.worksh...P4Pythonlib/bin

#11 CBRS

CBRS

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 16 November 2015 - 12:45 PM

View PostP4Shimada, on 11 November 2015 - 09:52 PM, said:

Have you ever tried the Workshop here such as this link which has additional (unsupported) versions?

https://swarm.worksh...P4Pythonlib/bin

Thanks for the suggestion.

While I wasn't aware of this link, I'd hazard a guess that these releases are effectively superceded by the PIP support Sven discusses in the blog post I reference.

The PIP approach is more robust, as it enables cross-platform support, and defers installation location detection to Py (the Python launcher) on Windows (plus, under normal circumstances, PIP can compile a suitable version of P4Python for you, from sources located on the Perforce FTP, if one is not available on PyPI).

Lastly, the listed versions do not include Python 3.5. This is unsurprising - Python is now compiled on VS2015, and (as I indicate) there are no P4 API binaries available for this compiler version as yet.

I think I'll get in touch with P4 tech support to ask if such binaries can be made available soon, VS2015 is gaining rapid adoption at the moment (in case it's unclear, I'm referring to the C++ APIs available for NT 64 on ftp.perforce.com - these are a dependency for P4Python).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users