[英]How to change pip install -i https://test.pypi.org/simple/ PACKAGE-NAME to pip install PACKAGE-NAME
I have uploaded my package to the https://test.pypi.org/ using this tutorial .我已使用本教程将我的 package 上传到https://test.pypi.org/ 。 But, at the end, the installation works with
pip install -i https://test.pypi.org/simple/ PACKAGE-NAME
.但是,最后,安装与
pip install -i https://test.pypi.org/simple/ PACKAGE-NAME
工作。 However, I aimed at installing the package using pip install PACKAGE-NAME
.但是,我的目标是使用
pip install PACKAGE-NAME
package 。
Anybody knows how can I change it to work with pip install PACKAGE-NAME
?任何人都知道如何将其更改为与
pip install PACKAGE-NAME
一起使用?
For more information, I have a setup.py
file, which looks like this:有关更多信息,我有一个
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'
)
and I have also a setup.cfg
file, which is:我还有一个
setup.cfg
文件,它是:
[build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1
[upload_sphinx]
upload-dir = docs/_build/html
[easy_install]
If you are on Linux/Mac try this:如果你在 Linux/Mac 上试试这个:
In the user's home directory在用户的主目录中
$ mkdir -p ~/.pip
$ touch ~/.pip/pip.conf
Add this config in ~/.pip/pip.conf在 ~/.pip/pip.conf 中添加此配置
[global]
index-url=https://test.pypi.org/simple/
trusted-host=test.pypi.org
Then run pip install package-name
然后运行
pip install package-name
It should now directly download from the test index.它现在应该直接从测试索引下载。
I found the issue with my problem today.我今天发现了我的问题。 When you upload your package on https://test.pypi.org/ , the installation using
pip
works with:当您在https://test.pypi.org/上上传 package 时,使用
pip
的安装适用于:
pip install -i https://test.pypi.org/simple/ PACKAGE-NAME
to be able to install the package with pip install PACKAGE-NAME
, you should upload it on https://pypi.org/ .为了能够安装 package 和
pip install PACKAGE-NAME
,您应该将其上传到https://pypi.org/ 。
Therefore, I needed to walk through the steps in the tutorial for pypi
, not for test.pypi
.因此,我需要完成
pypi
教程中的步骤,而不是test.pypi
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.