1
描述你的环境
  1. 操作系统 (MAC)
  2. Python版本:2.7.10
  3. Pipenv 版本:8.2.6

问题

1) setup.py inside invocations repo -> 安装 CaaS 包:

```

install_requires=[
    'CaaS>=1.0'
  ],

  dependency_links=[
    'https://<private_repo>#egg=CaaS-1.0'
  ],

``` 2) 在 vi​​rtualenv 中安装调用

python setup.py install

3) 验证 CaaS 安装是否正确。```

(test_1) c4b301cf5d25:invocations quj291$ pip freeze
CaaS==1.0

```

到目前为止一切正常。

4)创建一个Pipfile

```

[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 install --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,而不是调用 setup.py 的内部依赖链接中的私有 github 存储库

这是预期的吗?如何安装 CaaS 包?

谢谢!

4

2 回答 2

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 存储库PipenvAppPipenvDependency。请记住,这是使用 Python 3 测试的。

旁注:该--process-dependency-links标志已弃用/已弃用,请参阅pip issue #3939pip issue #4187

于 2018-01-21T17:35:53.820 回答
0

PyPI 没有这样的包:https ://pypi.python.org/pypi/CaaS

未找到错误404。

于 2017-10-16T18:18:47.157 回答