我的Python软件包可以安装在我的本地Conda Env上,但不能安装在其他Envs或Systems上
我已经创建了自己的python软件包,然后将其上传到 https://test.pypi.org/ 并且在我的conda虚拟环境中工作正常,但是当我想在其他系统或环境上安装它时,似乎无法安装依赖项。 我遇到此错误:
ERROR: You must give at least one requirement to install (see "pip help install")
我的setup.py文件是:
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name = "mypackage",
version = "0.0.31",
author = "my name",
author_email= "[email protected]",
description = "a description",
long_description = long_description,
long_description_content_type = "text/markdown",
packages = ["mypackage"],
python_requires = ">=3.9",
install_requires = [
"pandas>=1.4.2",
"pyro-api>=0.1.2",
"pyro-ppl>=1.8.0",
"numpy>=1.21.5",
],
)
我在 ubuntu 22.04 上,并使用以下命令安装软件包:
- python setup.py sdist
- twine上传 - reposority testpipi dist/mypackage-0.0.0.0 。
- /a>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在命令中,
您仅提供索引,但不提供要求。正确的语法
也与
您一起允许PIP仅在test.pypi.org中安装,并且在 pandas> = 1.3.3 /project/pandas“ rel =“ nofollow noreferrer”> https://test.pypi.org/project/prandas/pandas 。您需要允许PIP使用pypi.org。这边走:
In the command
you provide only the index but not the requirement(s). The correct syntax is
Also with
you allowed pip to install only from test.pypi.org and there is no
pandas>=1.3.3
at https://test.pypi.org/project/pandas. You need to allow pip to use pypi.org. This way: