如何解决如何将 pip install -i https://test.pypi.org/simple/ PACKAGE-NAME 更改为 pip install PACKAGE-NAME
我已使用 https://test.pypi.org/ 将我的包上传到 this tutorial。但是,最后,安装适用于 pip install -i https://test.pypi.org/simple/ PACKAGE-NAME
。但是,我的目标是使用 pip install PACKAGE-NAME
安装软件包。
有人知道如何更改它以与 pip install PACKAGE-NAME
一起使用吗?
有关详细信息,我有一个 setup.py
文件,如下所示:
from setuptools import setup
from os import path
current_dir = path.abspath(path.dirname(__file__))
with open("README.md","r") as fh:
long_description = fh.read()
with open(path.join(current_dir,'requirements.txt'),'r') as f:
install_requires = f.read().split('\n')
setup(
name='package name',version='0.0.1',author='author name',author_email='author's email',description='description',long_description=long_description,long_description_content_type="text/markdown",license='License',packages=['package name'],keywords='keywords',classifiers=[
"Programming Language :: Python :: 3","License :: OSI Approved :: MIT License","Operating System :: OS Independent"
],python_requires='>=3.6'
)
而且我还有一个 setup.cfg
文件,它是:
[build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1
[upload_sphinx]
upload-dir = docs/_build/html
[easy_install]
解决方法
如果你在 Linux/Mac 上试试这个:
在用户的主目录中
$ mkdir -p ~/.pip
$ touch ~/.pip/pip.conf
在 ~/.pip/pip.conf 中添加这个配置
[global]
index-url=https://test.pypi.org/simple/
trusted-host=test.pypi.org
然后运行pip install package-name
它现在应该直接从测试索引下载。
,我今天发现了我的问题。当您在 https://test.pypi.org/ 上上传您的软件包时,使用 pip
的安装适用于:
pip install -i https://test.pypi.org/simple/ PACKAGE-NAME
为了能够使用 pip install PACKAGE-NAME
安装软件包,您应该将它上传到 https://pypi.org/。
因此,我需要为 pypi
完成 the tutorial 中的步骤,而不是为 test.pypi
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。