这是我的setup.py
setup(
name='shipane_sdk',
version='1.0.0.a5',
# ...
data_files=[(os.path.join(os.path.expanduser('~'), '.shipane_sdk', 'config'), ['config/scheduler-example.ini'])],
# ...
)
Run Code Online (Sandbox Code Playgroud)
打包和上传命令:
python setup.py sdist
python setup.py bdist_wheel --universal
twine upload dist/*
Run Code Online (Sandbox Code Playgroud)
安装命令:
pip install shipane_sdk
Run Code Online (Sandbox Code Playgroud)
但是,它不会在〜/ .shipane_sdk下安装config / scheduler-example.ini
点子文件说:
setuptools允许绝对的“ data_files”路径,从sdist安装时,pip会将其视为绝对路径。从车轮分配上安装时,情况并非如此。车轮不支持绝对路径,并且最终会相对于“站点包”进行安装。有关讨论,请参见第92期。
您知道如何从sdist安装吗?
我是 Nexus3 的新手,我按照此处的说明上传 PyPI 包(python v2.7):https://books.sonatype.com/nexus-book/3.0/reference/pypi.html
但是,我得到了以下消息阻止我上传包。
HTTPError:401 客户端错误:URL 未经授权
我执行了以下步骤,不确定是否错过了任何内容:
1. 在 Nexus3 中设置 blob 和存储库名称
2. 将 url 复制到 .pypirc
3.python setup.py sdist; twine upload -r nexus3 dist/[secure]-0.1.0.tar.gz
请推荐,谢谢!
大家!我在PyPI中有一个python包,我去更新了它。但是上载命令执行不正确!
命令:
twine upload dist/*
Run Code Online (Sandbox Code Playgroud)
错误:
ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
Run Code Online (Sandbox Code Playgroud)
操作系统:Linux mint,Python:3.6.2
我正在尝试向 PyPi 添加一个包,以便可以使用 Pip 安装它。我正在尝试使用添加它twine upload dist/*
。
这导致我收到多个 SSL 错误,例如raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='upload.pypi.org', port=443): Max retries exceeded with url: /legacy/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
.
我正在使用学校笔记本电脑,我认为这是我的管理员所做的事情,但是我可以使用 pip 安装东西pip3 install --trusted-host pypi.org --trusted-h\ost files.pythonhosted.org
。我想知道是否还有另一个可以将我的包添加到 pip 中?
我有一个要在 PyPI 上注册的Python 包。我正在尝试使用最新版本的麻线 (1.9.1) 并按照麻线网页上的说明进行操作。
我在本地正确配置了我的包。(setup.py
是完整的。)该名称尚未在 PyPI 上声明。我在 PyPI 上有一个帐户。~/.pypirc
我的机器上没有 文件。我已经构建了一个源代码分发和一个轮子。
> ll dist
total 64
-rw-r--r-- 1 billmcn staff 14184 Aug 1 13:35 mycroft-1.1.0.tar.gz
-rw-r--r-- 1 billmcn staff 15996 Aug 1 13:36 mycroft-1.1.0-py3-none-any.whl
Run Code Online (Sandbox Code Playgroud)
当我尝试注册这些软件包中的任何一个时,我收到以下错误消息。
> twine register dist/mycroft-1.1.0.tar.gz
Registering package to https://upload.pypi.org/legacy/
Enter your username: billmcn
Enter your password:
Registering mycroft-1.1.0.tar.gz
HTTPError: 410 Client Error: Project pre-registration is no longer required or supported, so continue directly to uploading files. for …
Run Code Online (Sandbox Code Playgroud) 我想按照“ 迁移到PyPI.org”文档中的说明将包上传到pypi.org ,但是Twine则上传到https://upload.pypi.org/legacy/
。
在pypi.python.org/pypi/mypolr上可用,但在pypi.org上找不到。
我尝试阅读其他一些问题,教程和指南。
我的pip.ini文件(我在Windows 10上)如下所示:
[distutils]
index-servers =
pypi
[pypi]
Run Code Online (Sandbox Code Playgroud)
我没有存储用户名或密码,因此[pypi]部分为空(如迁移文档中所述)。
我已将.ini文件放入用户文件夹,并确认(根据此答案)它实际上正在使用我设置的文件(使用环境变量PIP_CONFIG_FILE
)。
害怕我出了点问题,因此我也尝试了没有pip.ini文件的情况,以使Twine使用其默认值。
我正在使用Python 3.6.3(来自Anaconda),并且我的工具版本为:
不管它是否相关,这里有一些更多信息:
setup
是setuptools
从而不是从distutils.core
long description
,但在PyPi页中仅显示标题的前8个星号。(比较这与此)setuptools_scm
用于从git标签获取版本python setup.py sdist bdist_wheel
请让我知道是否还有其他信息可以帮助您解决这一问题。
我已经对我在2015年提交了很长时间的软件包进行了更改,今天我在pypi上添加了支持markdown并更新了setup.py以支持pip版本10,
但是现在我面临一个奇怪的问题:如果我运行这个命令
python setup.py sdist upload -r http://pypi.org
Password: # I enter the password
Submitting dist/maildiff-1.2.1.tar.gz to http://pypi.org
Server response (200): OK
Run Code Online (Sandbox Code Playgroud)
但在pypi上它没有更新.奇怪的是,即使我输入错误的密码,我也会收到消息
Submitting dist/maildiff-1.2.1.tar.gz to http://pypi.org
Server response (200): OK
Run Code Online (Sandbox Code Playgroud) 我有一个使用 https 设置的个人 Python 存储库,我可以使用以下命令上传到它:
twine upload <dist> -r <my_server> --cert <path/to/certfile>
Run Code Online (Sandbox Code Playgroud)
但是,我希望能够上传而无需显式指定 CA 证书位置。我相信我已将 CA 证书安装在系统的正确位置(使用 如何在 centos7 中添加证书颁发机构?作为指导,并使用 wget 进行验证),但我仍然需要调用原始路径。
如何让 twine 默认使用我的备用 CA 证书?
我正在尝试使用 twine 包构建我自己的 Python 包(可通过 pip 安装)。这一切都很顺利,直到我尝试 pip 安装我的实际包(所以在上传到 PyPi 之后)。
所以我首先运行:
python3 setup.py sdist bdist_wheel
其中我的 setup.pyinstall_requires
列表如下所示:
install_requires=[
'jupyter_kernel_gateway==2.4.0',
'pandas==1.0.2',
'numpy==1.18.1',
'azure-storage-blob==2.0.1',
'azure-datalake-store==0.0.48',
'psycopg2-binary==2.8.4',
'xlsxwriter==1.2.6',
'SQLAlchemy==1.3.12',
'geoalchemy2==0.6.3',
'tabulate==0.8.2',
'pyproj==1.9.6',
'geopandas==0.4.0',
'contextily==0.99.0',
'matplotlib==3.0.2',
'humanize==0.5.1',
'ujson==1.35',
'singleton-decorator==1.0.0',
'dataclasses==0.6',
'xlrd==1.2.0'],
Run Code Online (Sandbox Code Playgroud)
在我的理解中,这些 install_requires 将在安装我自己的包时由 pip 安装。
在这之后我跑
python3 -m twine upload --repository testpypi dist/*
将我的包实际上传到 PyPi。但是,当 pip 安装我的包时,我收到错误消息,指出没有满足许多列出要求的版本。例如:ERROR: Could not find a version that satisfies the requirement psycopg2-binary==2.8.4
当我手动安装这些软件包时(例如 pip install psycopg2-binary==2.8.4
)时,它们确实被安装了。
有什么办法可以让我的包的 pip installinstall_requires
成功安装需求列表?
我正在尝试更新infixpy
using的版本twine
。这是我的~/.pypirc
:
index-servers =
pypi
pypitest
[pypi]
repository: https://upload.pypi.org/legacy/
username: myuser
password: mypassword
[pypitest]
repository: https://upload.testpypi.org/legacy
username: myuser
password: mypassword
Run Code Online (Sandbox Code Playgroud)
这是命令行:
python setup.py build
twine upload -r pypi dist/
Run Code Online (Sandbox Code Playgroud)
上传错误与 InvalidDistribution: Unknown distribution format: ''
这是完整的输出:
Processing dependencies for infixpy==0.0.6
Finished processing dependencies for infixpy==0.0.6
Processing /Users/steve/git/infixpy
Building wheels for collected packages: infixpy
Building wheel for infixpy (setup.py) ... done
Created wheel for infixpy: filename=infixpy-0.0.6-py3-none-any.whl size=43459 sha256=01fed46f42fa86475079636a55685c93521989aa0ba6558726a9d35c01004b7a
Stored in directory: /private/var/folders/d6/m67jyndd7h754m3810cl3bpm0000gp/T/pip-ephem-wheel-cache-1bizg6_y/wheels/47/66/74/d79a56979feba04c8ef05e12fe861cacf813cecd397e57071f
Successfully built infixpy
Installing …
Run Code Online (Sandbox Code Playgroud) 上传到PyPI时出现错误:
$ twine upload -r test dist/examplepkg-1.0.tar.gz
Uploading distributions to https://test.pypi.org/legacy/
Uploading examplepkg-1.0.tar.gz
Error during upload. Retry with the --verbose option for more details.
HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
The name 'examplepkg' is too similar to an existing project. See https://test.pypi.org/help/#project-name for more information.
Run Code Online (Sandbox Code Playgroud)
现有哪个项目?您如何找出它正在谈论的现有项目?
我提前道歉,因为这似乎是一个基本问题......
我正在尝试学习使用mujoco(链接在这里),并在其python绑定Makefile里面它有:
upload:
rm -rf dist
python setup.py sdist
twine upload dist/*
Run Code Online (Sandbox Code Playgroud)
是什么twin upload dist/*
命令呢?另外,这要求我输入如下用户名和密码:
Uploading distributions to https://pypi.python.org/pypi
Enter your username: guest
Enter your password:
Uploading mujoco-py-0.5.7.tar.gz
HTTPError: 401 Client Error: You must be identified to edit package information for url: https://pypi.python.org/pypi
Makefile:2: recipe for target 'upload' failed
Run Code Online (Sandbox Code Playgroud)
这是要求我的电脑用户名和密码吗?
twine ×12
python ×11
pypi ×9
pip ×3
centos7 ×1
nexus ×1
nexus3 ×1
package ×1
packaging ×1
pypiserver ×1
python-3.x ×1
setup.py ×1
setuptools ×1
ssl ×1