gpt4 book ai didi

python - 如何在 Windows 7 计算机上将模块上传到 Python 测试站点(https ://testpypi. python.org/pypi)?

转载 作者:太空宇宙 更新时间:2023-11-03 17:20:19 25 4
gpt4 key购买 nike

我的工具:Windows 7的 ,Python 3.4.2

我正在阅读 Paul Barry 2010 年 11 月出版的《Head First Python》的第​​ 2 章。

部分要求是将我的发行版上传到 PyPI 测试站点。

不幸的是我没有成功。

到目前为止我所做的所有阅读都表明我需要在 Windows 中使用这个 HOME 环境变量,或者将 .pypirc 放在 Windows 7 的主目录中。

嗯,Windows 7中没有这样的环境变量,也没有这样的目录。

............有人可以给我在 Windows 7 中使用命令行工具的分步指南吗?

到目前为止,我已在此目录 C:\Python34\nesterhead 中创建了一个 .pypirc.txt 文件,我的模块位于 Windows 7 中。

然后,我使用命令行工具将 .txt 文件从 .pypirc.txt 重命名为 .pypirc。 ,即

cd C:\Python34\nesterhead

REN .pypirc.txt .pypirc。

c:\python34\python.exe setup.py 注册 -r pypitest

......我得到了这个作为输出。

ValueError:在 .pypirc 中找不到 pypitest

......我已经完成了所有我应该做的事情,包括确认我的注册并勾选“我同意” https://testpypi.python.org/pypi

......我也按照http://peterdowns.com/posts/first-time-with-pypi.html的指示进行操作并在我的 .pypirc.txt 中包含以下代码以及正确的用户名和密码

        [distutils] 
index-servers =
pypi
pypitest

[pypi]
repository: https://pypi.python.org/pypi
username: {{your_username}}
password: {{your_password}}

[pypitest]
repository: https://testpypi.python.org/pypi
username: {{your_username}}
password: {{your_password}}

非常感谢。

最佳答案

echo %userprofile%

这将显示您在 Windows 7 中的主目录

关于python - 如何在 Windows 7 计算机上将模块上传到 Python 测试站点(https ://testpypi. python.org/pypi)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33227002/

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