1)invocations repo中的setup.py - >安装CaaS包:
```
install_requires=[
'CaaS>=1.0'
],
dependency_links=[
'https://<private_repo>#egg=CaaS-1.0'
],
``` 2)在virtualenv中安装调用
python setup.py install
3)正确安装了Valdiating CaaS。 ```
(test_1) c4b301cf5d25:invocations quj291$ pip freeze
CaaS==1.0
```
到目前为止一切正常。
4)创建了一个Pip文件
```
[requires]
python_version = '2.7'
[packages]
invocations = { git = 'git://<private-repo>/invocations', ref = 'master' }
```
5)无法安装调用,因为找不到CaaS包:pipenv install
```
Collecting CaaS>=1.0 (from invocations)
Could not find a version that satisfies the requirement CaaS>=1.0 (from invocations) (from versions: )
No matching distribution found for CaaS>=1.0 (from invocations)
```
6)尝试了pipenv安装--verbose
```
Collecting CaaS>=1.0 (from invocations)
1 location(s) to search for versions of CaaS:
* https://pypi.python.org/simple/caas/
Getting page https://pypi.python.org/simple/caas/
Looking up "https://pypi.python.org/simple/caas/" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
"GET /simple/caas/ HTTP/1.1" 404 33
Status code 404 not in [200, 203, 300, 301]
Could not fetch URL https://pypi.python.org/simple/caas/: 404 Client Error: Not Found (caas does not exist) for url: https://pypi.python.org/simple/caas/ - skipping
Cleaning up...
```
尝试从pypi获取CaaS而不是私有github repo在invocation的setup.py
中的dependency_links内部这是预期的吗?我该如何安装CaaS包?
谢谢!
答案 0 :(得分:1)
在setup.py
git+
中添加dependency_links
(以及分支名称@master
)
setup(
...
dependency_links=[
"git+https://<repo>.git@master#egg=CaaS-1.0",
],
...
)
使用pipenv
:
$ cd <dir_with_above_setup_py>
# enable pip flag --process-dependency-links
$ export PIP_PROCESS_DEPENDENCY_LINKS=1
$ pipenv install [-e] .
过去几天我自己搞清楚这一点。结帐我的GitHub回购PipenvApp和PipenvDependency。请记住,这是使用Python 3进行测试的。
旁注:--process-dependency-links
标志已弃用,请参阅pip issue #3939和pip issue #4187
答案 1 :(得分:0)
PyPI上没有这样的包:https://pypi.python.org/pypi/CaaS
错误404未找到。