我正在使用dependency_links安裝一個軟件包。它似乎安裝了軟件包,但打破了pip凍結功能(這可能意味着存在更深的安裝問題)。我希望能夠從自定義服務器下載軟件包,而不需要運行setup.py
以外的任何設置。`pip freeze`打包安裝
這是我setup.py
文件:
from setuptools import setup
setup(
name='package'
,version='0.1.0'
,packages=['foo',
'bar'
]
,long_description=''
,url='https://github.com/myrepo'
,install_requires=['numpy>=1.9.2'
,'some_package'
]
,dependency_links=[
"http://custom_server/packages/some_package-0.1.0.tar.gz"
]
)
安裝似乎工作正常,但如果我嘗試和運行pip_freeze
我得到下面的錯誤。
pip freeze
Error [Errno 20] Not a directory: '/Users/abc/anaconda/lib/python2.7/site-packages/some_package.egg' while executing command git rev-parse
Exception:
Traceback (most recent call last):
File "/Users/myname/anaconda/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Users/myname/anaconda/lib/python2.7/site-packages/pip/commands/freeze.py", line 70, in run
for line in freeze(**freeze_kwargs):
File "/Users/myname/anaconda/lib/python2.7/site-packages/pip/operations/freeze.py", line 49, in freeze
dependency_links
File "/Users/myname/anaconda/lib/python2.7/site-packages/pip/__init__.py", line 235, in from_dist
if dist_is_editable(dist) and vcs.get_backend_name(location):
File "/Users/myname/anaconda/lib/python2.7/site-packages/pip/vcs/__init__.py", line 75, in get_backend_name
if vc_type.controls_location(location):
File "/Users/myname/anaconda/lib/python2.7/site-packages/pip/vcs/git.py", line 266, in controls_location
on_returncode='ignore')
File "/Users/myname/anaconda/lib/python2.7/site-packages/pip/vcs/__init__.py", line 322, in run_command
spinner)
File "/Users/myname/anaconda/lib/python2.7/site-packages/pip/utils/__init__.py", line 677, in call_subprocess
cwd=cwd, env=env)
File "/Users/myname/anaconda/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/Users/myname/anaconda/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 20] Not a directory: '/Users/myname/anaconda/lib/python2.7/site-packages/some_package.egg'
我知道它與雞蛋文件而不是雞蛋目錄有關,但我不知道如何解決它。 – Chris
嘗試添加#egg = some_package-0.1.0到您的依賴鏈接 – irqed
'http:// custom_server/packages/some_package-0.1.0.tar.gz#egg = some_package-0.1.0'給了我同樣的錯誤,當我運行pip凍結。安裝仍然有效,它只是打破點凍結:/ – Chris