[p4python] Version 2007.3

todd.benham at kodak.com todd.benham at kodak.com
Thu Sep 4 14:29:04 PDT 2008

Here is my variation on your procedure:
1) Before installing Perforce's P4Python (or if need be uninstall it and
the depot variation of P4Python)
2) Install latest version 1.2 of depot version (if needed)
3) Rename site-packages folder to p4python1.2
4) Set PYTHONPATH to C:\Programs\Python25\Lib\p4python1.2    (assumes
install location)
5) Install Perforce's P4Python
6) Test script below and various "old" p4 scripts.
So far this seems to work as you suggested.
-----Original Message-----
From: Shawn Hladky [mailto:p4shawn at gmail.com] 
Sent: Thursday, September 04, 2008 2:24 PM
To: Todd D. Benham
Cc: p4python at perforce.com
Subject: Re: [p4python] Version 2007.3

Running P4Python versions side-by-side on Windows 

In the Perforce supported version of P4Python, the main module was
renamed from "p4" to "P4". Since Python is case-sensitive, it's possible
to have both modules loaded; however, on Windows it's not possible to
have the files "p4.py" and "P4.py" in the same folder. If you run the
installers, one version will overwrite the other. However, you can
manually install the public depot version of P4Python, and run it
side-by-side with the Perforce version. Here are the steps to get this
to work: 

1.	Install the Perforce version of P4Python 

2.	Create a new folder for the public depot version of P4Python. I
created my folder here:

3.	Copy the following files into the new folder.
You can get these files off a machine that has the public depot version
of P4Python installed (will be in the site-packages folder), or you can
compile P4Client.pyd from source. 

4.	Set the environment variable PYTHONPATH to the new folder (or
append it to the list if PYTHONPATH is already defined). 

You can test with the following short script: 

import p4 as pubdepotAPI

import P4 as perforceAPI

p4 = pubdepotAPI.P4()
info1 = p4.run_info()

p4 = perforceAPI.P4()
info2 = p4.run_info()


if info1[0]['serverAddress'] == info2[0]['serverAddress']:

   print "Both versions loaded and return same results!"

2008/9/4 <todd.benham at kodak.com>

After looking at
ial/RELNOTES.txt and trying the install, I don't quite understand the
upgrade path for p4 changed to P4 (lowercase vs. uppercase). I was using
P4Python 1.0 (or 1.2), but when I install P4Python 2007.3, it breaks all
previous scripts. It seems it is installed overtop instead of "next to"
it. I don't see a way to have both.
    If you are migrating from Public Depot version of P4Python, edit
    scripts to ensure that the scripts comply with the new 
    interface. The differences are detailed below.

There must be a way to support both, right? 
I don't mind moving on to the new version of P4 (but not all at once).
So, bottom line: is there *suppose* to be a way to support both upper
and lower case P4Python on the same machine (Windows based)? If not, I
can't see any practical way to change to the new supported version.
Thanks for any ideas around this.

p4python mailing list
p4python at perforce.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.perforce.com/pipermail/p4python/attachments/20080904/99a38ccc/attachment-0001.html>

More information about the p4python mailing list