Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import error: No module named P4API

I tried downloading the Perforce for python API (Platform independent)version from here and tried executing a simple connect() script:

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

I have this script and p4.py and the remaining dist stuff(c++ files) in the same folder. But I get this error:

Importerror: No module named P4API.

Can someone please help me?

like image 298
Tania Avatar asked Feb 15 '26 18:02

Tania


1 Answers

So I found out what was messing things up. My Python 2.7 is 32 bit and the Perforce build which I downloaded (and which is put up on their site) is 64 bit. Here's the link you have to follow if you have a 32 bit Python.

This link has the 32 bit python distribution of P4P

To check whether you have a 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.

like image 125
Tania Avatar answered Feb 17 '26 08:02

Tania



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!