简体   繁体   中英

Not able to install p4python

I'm trying to install p4python on a freebsd which runs python 2.7.5. Im getting the following error.

Using cached p4python-2016.1.1447008.tar.gz
    Complete output from command python setup.py egg_info:
    Attempting to load API from ftp.perforce.com
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-WK9yDa/p4python/setup.py", line 611, in <module>
        p4_api_dir = get_api_dir()
      File "/tmp/pip-build-WK9yDa/p4python/setup.py", line 532, in get_api_dir
        p4ftp = P4APIFtp()
      File "/tmp/pip-build-WK9yDa/p4python/setup.py", line 65, in __init__
        self.platform = self.findPlatform
      File "/tmp/pip-build-WK9yDa/p4python/setup.py", line 105, in findPlatform
        release = uname.release
    AttributeError: 'tuple' object has no attribute 'release'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-WK9yDa/p4python/

I have tried updating setutools...Still its failing to install. any help?

This is a Python 3.x vs. Python 2.x issue. On Python 2.x, platform.uname() returns a regular tuple. On Python 3.x, platform.uname() returns a namedtuple.

To fix this, in tools/P4APIFtp.py , change uname.release to uname[2] .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM