2016-11-17 43 views
1

使用pip安裝軟件包時出現以下錯誤 「找不到.egg-info目錄中的安裝記錄test == 1.0 from file:///home/ubuntu/sample/test-1.0.tar.gz」找不到.egg-info目錄中的安裝記錄test == 1.0 from file:///home/ubuntu/sample/test-1.0.tar.gz

我的setup.py如下:

from setuptools.command.install import install 
from setuptools import setup 

class Install(install): 
    def run(self): 
     install.do_egg_install(self) 
     print "test....." 
setup(
    name="test", 
    version="1.0", 
    cmdclass={ 
     'install': Install 
    }, 
    install_requires=[ 
     "somepackage == 5.0" 
    ] 
) 

有沒有人知道是什麼原因引起的警告?

+1

當使用'virtualenv == 15.1.0 pip == 9.0.1 wheel == 0.29.0 setuptools == 28.8.0'。奇怪的是,這個錯誤可以用'python setup.py bdist_egg'解決。但是,在出現另一個錯誤之後,我通過執行'python setup.py bdist_wheel'發現了另一個問題。其中'/Users/jmunsch/Desktop/dev/scraps/venv_test/lib/python2.7/site-packages/setuptools/command/easy_install.py(451)check_site_dir()'失敗,並且'TEST FAILED:build/bdist.macosx -10.11-x86_64/wheel /不支持.pth文件' – jmunsch

+0

也嘗試過'python setup.py sdist && pip install dist/test-1.0.tar.gz'我想這可能只是我的機器的問題,而我沒有用Ubuntu的測試。 – jmunsch

+0

剛剛使用ubuntu進行測試,經過一些窺探後,我發現在我的mac和ubuntu實例'test'上安裝了,但與此檢查相關的錯誤仍然失敗:https://github.com/pypa/setuptools/blob/master/ setuptools/command/easy_install.py#L442-L468和卸載egg位於錯誤的目錄中,或者不存在它希望找到它的地方。 – jmunsch

回答

0

我用install.run(self)替換了install.do_egg_install(self)並且警告消失了。