Import error: no module named P4API

I tried to download the python API version of Perforce (no platform) from here and tried a simple connect () script:

from P4 import P4, P4Exception
p4 = P4()
p4.port = "111"
p4.user = "xxx"
p4.client = "yyy"


I have this script and and the rest of the dist files (C ++ files) in the same folder. But I am getting this error:

Importerror: No module named P4API.


Can anyone help me?


source to share

1 answer

So I found out what this mess is. My Python 2.7 is 32 bits, and the Perforce build I downloaded (and which is hosted on their site) is 64 bits. Here is the link you should follow if you have 32 bit Python.

This link has a 32 bit Python distribution for P4P

To check if you have 32-bit or 64-bit Python, just go to your command line and start the python shell (type python). The first line contains this information.



All Articles