1

我正在尝试在运行 python 2.7.5 的 freebsd 上安装 p4python。我收到以下错误。

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/

我已经尝试更新 setutools ......仍然无法安装。有什么帮助吗?

4

1 回答 1

0

这是 Python 3.x 与 Python 2.x 的问题。在 Python 2.x 上,platform.uname() 返回一个常规元组。在 Python 3.x 上,platform.uname() 返回一个命名元组。

要解决此问题,请在tools/P4APIFtp.py中更改uname.releaseuname[2]

于 2018-07-11T18:11:06.517 回答