我使用sudo easy_install python-jenkins
在mac上安裝了jenkins軟件包。安裝進行得很好,沒有錯誤,但是當我打開python並鍵入import jenkins
時,出現以下錯誤。在python中導入jenkins失敗mac上
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.7-intel/egg/jenkins.py", line 9, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Library/Python/2.7/site-packages/lookup3.so, 6): image not found
使用谷歌搜索這沒有產生任何有用的結果。
回溯編輯
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "jenkins.py", line 9, in <module>
lookup3 = cdll.LoadLibrary(os.path.join(get_python_lib(), "lookup3.dynlib"))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Library/Python/2.7/site-packages/lookup3.dynlib, 6): image not found
在上述目錄中我似乎無法找到'jenkins.py',這裏有兩個文件'jenkins-1.0.2-py2.7-macosx-10.7-intel.egg python_jenkins-0.2-py2.7 .egg' – cyberbemon
@cyberbemon:對,雞蛋已經被安裝爲zip文件;或者用'easy_install -ZU jenkins'重新安裝它們,或者手動解壓縮'.egg'文件,用重命名爲相同名稱的替換文件替換該文件(所以jenkins-1.0.2-py2.7的內容-macosx-10.7-intel.egg'成爲一個具有完全相同名稱的新目錄)。 –
'easy_install -ZU jenkins'這沒有結果,所以我嘗試'gzip python_jenkins-0.2-py2.7.egg',現在我有一個名爲'python_jenkins-0.2-py2.7.egg.gz'的文件,我想我搞砸了! – cyberbemon