gpt4 book ai didi

python setup.py install 忽略 install_requires

转载 作者:行者123 更新时间:2023-12-01 06:20:48 25 4
gpt4 key购买 nike

我无法使用 setup.py 安装本地软件包

这是项目结构:

my-project/
lib/
local1/
local1.1.0.whl
index.html
local2/
local2.1.0.whl
index.html
setup.py

setup.py

import os

from setuptools import setup

setup(name='my project',
version='1.0',
description='my project',
install_requires=[
'lxml >= 4.3.0',
'local1 @ file://localhost/{}/lib/local1/local1.1.0.whl'.format(os.getcwd()),
'local2 @ file://localhost/{}/lib/local2/local2.2.0.whl'.format(os.getcwd()),
]
)

如果我将依赖项放入 requirements.txt 文件中并使用 pip install -rrequirements.txt --extra-index-url lib/,我就可以安装,但我想知道为什么无法执行 python setup.py install 或者我是否遗漏了某些内容。

这是我收到的错误 -

No local packages or working download links found for local2@ file://localhost//Users/anusha/Documents/my-project/lib/local2/local2.1.0.whl
error: Could not find suitable distribution for Requirement.parse('local2@ file://localhost//Users/anusha/Documents/my-project/lib/local2/local2.1.0.whl')

在搜索时,我在 github 上发现了这个问题,但没有给我任何关于它如何工作的指示或解决方案。

欢迎任何帮助,提前致谢!

最佳答案

请注意此comment from pganssle in the discussion "Setuptools install fails with PEP508 URLs" in setuptools's issue tracker :

Our policy to date has been that if using pip install fixes your problem, you should use pip install and we won't fix the issue.

我相信这符合Python社区当前打包工具和技术的发展。因此,如果您的具有此需求符号的基于 setuptools 的项目可以通过 pip install . 和 pip install --editable . 来安装,那么看起来没有进一步。

<小时/>

关于该主题的更完整(详尽)的文章:

关于python setup.py install 忽略 install_requires,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60370913/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com