我有Python版本: Python 2.7.3(v2.7.3:70274d53c1dd,2012年4月9日,20:52:43) [达尔文上的[GCC 4.2.1(Apple Inc. build 5666)(第3点)]
从http://www.perforce.com/product/components/apis#p4python下载了p4python
tar -zxvf ./p4python.tgz
从ftp://ftp.perforce.com/perforce/r12.1/bin.darwin90x86_64
下载了p4apitar -zxvf ./p4api.tgz
将提取的文件放入p4python目录
然后我跑:
sudo python ./setup.py build --apidir ./p4api
我收到以下错误:
API Release 2012.1
Traceback (most recent call last):
File "./setup.py", line 434, in <module>
do_setup(p4_api_dir, ssl)
File "./setup.py", line 349, in do_setup
info = PlatformInfo(apiVersion, releaseVersion, ssl != None)
File "./setup.py", line 279, in __init__
self.ID_OS = self.inStr(unix + release + platform)
UnboundLocalError: local variable 'release' referenced before assignment
有什么想法吗?
答案 0 :(得分:3)
编辑setup.py,更改如下:
elif unameOut[2][0:2] in ("10", "11") :
到
elif unameOut[2][0:2] in ("10", "11", "12") :
原因uname -a
我们在山狮上获得了12.10
Darwin csjteki-MacBook-Pro.local 12.1.0 Darwin Kernel Version 12.1.0: Tue Aug 14 13:29:55 PDT 2012; root:xnu-2050.9.2~1/RELEASE_X86_64 x86_64