[p4python] AttributeError: 'module' object has no attribute 'P4'

Guillaume Boddaert gboddaer.ext at winsoft.fr
Mon Jun 26 04:26:50 PDT 2006


  Hi Robert, thanks for you answers.

I removed and reinstalled python, and p4extension. I also checked the 
Site-packages dir :

c:\> dir c:\Python24\Lib\site-packages
 Volume in drive C has no label.
 Volume Serial Number is XXXX-XXXX

 Directory of c:\Python24\Lib\site-packages

26/06/2006  13:10    <DIR>          .
26/06/2006  13:10    <DIR>          ..
22/07/2005  05:24            11 100 p4.py
26/06/2006  13:10            12 010 p4.pyc
26/06/2006  13:10            12 010 p4.pyo
31/08/2005  14:28           352 256 P4Client.pyd
28/10/2005  20:15               121 README.txt
               5 File(s)        387 497 bytes
               2 Dir(s)  235 439 333 376 bytes free

I also reduce my test script to a simple : "import p4"

Traceback (most recent call last):
  File "C:\workspace\HelloPython\p4test.py", line 35, in ?
    import p4       # Main class to test
  File "C:\Python24\Lib\site-packages\p4.py", line 3, in ?
    """A Python version of the Perforce "p4" client.
AttributeError: 'module' object has no attribute 'P4'

I didn't import any other P4 feature for python.

Guillaume

Robert Cowham a écrit :
> Hi Guillaume
>
> Looks like the compile extension hasn't been installed properly.
>
> Is there a P4Client.pyd installed as well?
>
>  C:\Python24\Lib\site-packages
>
> 6:49    <DIR>          .
> 6:49    <DIR>          ..
> 4:56            11,447 p4.py
> 6:49            12,010 p4.pyc
> 6:49           368,640 P4Client.pyd 
>
> Another thing to check is that you don't have any other p4 related stuff in
> your python path.
>
> Note that unfortunately the test script has some environment dependencies
> for a test perforce repository that is not available to the general public,
> thus I would use it as example code rather than as something you can expect
> to run without problems.
>
> Hope that helps.
>
> Regards
> Robert
>
>
>
>   
>> -----Original Message-----
>> From: p4python-bounces at perforce.com 
>> [mailto:p4python-bounces at perforce.com] On Behalf Of Guillaume Boddaert
>> Sent: 26 June 2006 11:35
>> To: p4python at perforce.com
>> Subject: [p4python] AttributeError: 'module' object has no 
>> attribute 'P4'
>>
>> Hi,
>>
>> I am new to Python. I installed both Python 2.4 and p4python 
>> on windows. p4.py is present in libs\Site-packages.
>>
>> Then I try to run the test script without a success. 
>> (http://public.perforce.com/guest/robert_cowham/perforce/API/p
>> ython/main/test/test_p4python.py)
>>
>> C:\Documents and Settings\gboddaer>python 
>> c:\workspace\HelloPython\test_p4python.py
>> Traceback (most recent call last):
>>   File "c:\workspace\HelloPython\test_p4python.py", line 35, in ?
>>     import p4       # Main class to test
>>   File "c:\Python24\lib\site-packages\p4.py", line 3, in ?
>>     """A Python version of the Perforce "p4" client.
>> AttributeError: 'module' object has no attribute 'P4'
>>
>> I understood that it is a parse error that happens in p4.py 
>> file. I guess the p4python wrapper is not working properly. 
>> Where the error would come from ?
>>
>> Thanks a lot,
>>
>> Guillaume
>>     


>>     
>
>
>   

Robert Cowham a écrit :
> Hi Guillaume
>
> Looks like the compile extension hasn't been installed properly.
>
> Is there a P4Client.pyd installed as well?
>
>  C:\Python24\Lib\site-packages
>
> 6:49    <DIR>          .
> 6:49    <DIR>          ..
> 4:56            11,447 p4.py
> 6:49            12,010 p4.pyc
> 6:49           368,640 P4Client.pyd 
>
> Another thing to check is that you don't have any other p4 related stuff in
> your python path.
>
> Note that unfortunately the test script has some environment dependencies
> for a test perforce repository that is not available to the general public,
> thus I would use it as example code rather than as something you can expect
> to run without problems.
>
> Hope that helps.
>
> Regards
> Robert
>
>
>
>   
>> -----Original Message-----
>> From: p4python-bounces at perforce.com 
>> [mailto:p4python-bounces at perforce.com] On Behalf Of Guillaume Boddaert
>> Sent: 26 June 2006 11:35
>> To: p4python at perforce.com
>> Subject: [p4python] AttributeError: 'module' object has no 
>> attribute 'P4'
>>
>> Hi,
>>
>> I am new to Python. I installed both Python 2.4 and p4python 
>> on windows. p4.py is present in libs\Site-packages.
>>
>> Then I try to run the test script without a success. 
>> (http://public.perforce.com/guest/robert_cowham/perforce/API/p
>> ython/main/test/test_p4python.py)
>>
>> C:\Documents and Settings\gboddaer>python 
>> c:\workspace\HelloPython\test_p4python.py
>> Traceback (most recent call last):
>>   File "c:\workspace\HelloPython\test_p4python.py", line 35, in ?
>>     import p4       # Main class to test
>>   File "c:\Python24\lib\site-packages\p4.py", line 3, in ?
>>     """A Python version of the Perforce "p4" client.
>> AttributeError: 'module' object has no attribute 'P4'
>>
>> I understood that it is a parse error that happens in p4.py 
>> file. I guess the p4python wrapper is not working properly. 
>> Where the error would come from ?
>>
>> Thanks a lot,
>>
>> Guillaume
>>     
>
>
>   

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


More information about the p4python mailing list