相关疑难解决方法(0)

使用带有pip的--process-dependency-links的替代方法是什么

我使用的是Python 2.7.我正在尝试pip install一个repo(在内部github上),它依赖于另一个repo(也在内部github上).我尝试了几个选项但是有效的选项是这样的:

(env)abc$ cat requirements.txt
 -e git://github.abc.com/abc/abc.git#egg=my_abc --process-dependency-links

(env)abc$ pip install -r requirements.txt
Run Code Online (Sandbox Code Playgroud)

但是在运行命令行时我收到了警告:

"DEPRECATION:Dependency Links处理已被弃用,将在未来的版本中删除."

我在点v7.1.2.这样做的正确方法是什么?

git version-control pip setuptools easy-install

13
推荐指数
1
解决办法
2030
查看次数

取决于setup.py中的git存储库

我正在尝试使项目依赖于git依赖项.但是,我似乎无法让它发挥作用.我基本上想要实现的是以下内容,但它不起作用:

#!/usr/bin/env python3
from setuptools import setup


setup(
    name='spam',
    version='0.0.0',
    install_requires=[
        'git+https://github.com/remcohaszing/pywakeonlan.git'
    ])
Run Code Online (Sandbox Code Playgroud)

我在上面尝试了几种变体,例如添加@master#egg=wakeonlan-0.2.2,但这没有什么区别.

以下工作,但仅在使用deprecated pip标志时,--process-dependency-links:

#!/usr/bin/env python3
from setuptools import setup


setup(
    name='spam',
    version='0.0.0',
    install_requires=[
        'wakeonlan'
    ],
    dependency_links=[
        'git+https://github.com/remcohaszing/pywakeonlan.git#egg=wakeonlan-0.2.2'
    ])
Run Code Online (Sandbox Code Playgroud)

这输出:

$ pip install --no-index -e . --process-dependency-links
Obtaining file:///home/remco/Downloads/spam
  DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release.
Collecting wakeonlan (from spam==0.0.0)
  Cloning https://github.com/remcohaszing/pywakeonlan.git to /tmp/pip-build-mkhpjcjf/wakeonlan
  DEPRECATION: Dependency Links processing has been deprecated and will …
Run Code Online (Sandbox Code Playgroud)

python git pip setuptools

12
推荐指数
1
解决办法
1273
查看次数

Python Setup.py - 依赖项作为 TAR 或 GIT 的 url

根据我的研究,以下应该有效:

from setuptools import setup
from setuptools import find_packages
...
REQUIRES_INSTALL = [
    'spacy==2.3.2',
    'tensorflow==1.14.0',
    'Keras==2.2.4',
    'keras-contrib@git+https://github.com/keras-team/keras-contrib.git#egg=keras-contrib',
    'en-core-web-sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.0/en_core_web_sm-2.3.0.tar.gz#egg=en-core-web-sm'
]
...
setup(
    name=NAME,
    version=VERSION,
    description=DESCRIPTION,
    install_requires=REQUIRES_INSTALL,
    ...
)
Run Code Online (Sandbox Code Playgroud)

当建造轮子或鸡蛋时,一切都很好:python setup.py bdist_wheel

但是当尝试使用pip install -U dist/mypack-....whl.

我得到:

ERROR: Could not find a version that satisfies the requirement keras-contrib (from mypack==0.3.5) (from versions: none)
ERROR: No matching distribution found for keras-contrib (from mypack==0.3.5)
...
ERROR: Could not find a version that satisfies the requirement en-core-web-sm (from mypack==0.3.5) (from versions: …
Run Code Online (Sandbox Code Playgroud)

python dependencies setuptools setup.py

2
推荐指数
1
解决办法
2247
查看次数