pythonwindowsperforcep4vp4python

No module named P4API when trying to import P4


I am trying to use Perforce with python. When I did the line:

import P4

The error message I got was:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\P4.py", line 410, in <module>
    import P4API
ImportError: No module named P4API

Tried looking at different answers none of them solved my problem... Seems like P4 has a very messy code management and names of modules kept changing... Someone pls enlighten me with what happens with the python api for p4 and how to install them?

BTW I use Windows 10 64-bit, Thanks!


Solution

  • I think it should be only P4, not P4API

    from P4 import P4
    

    I don't see any P4API module in P4 package