如何在本地构建和安装Python包而不上传到PyPI?

2024-03-29 09:53:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用project template创建了一个小的Python project。现在,我想将项目配置为可在本地安装

当我运行命令时:

$ python3.8 -m pip install fdroid_build_checker

我得到以下错误:

ERROR: Could not find a version that satisfies the requirement fdroid_build_checker (from versions: none)
ERROR: No matching distribution found for fdroid_build_checker

未来的一步是将项目配置为发布为小型命令行工具


Tags: installpip项目命令buildprojectversion错误
1条回答
网友
1楼 · 发布于 2024-03-29 09:53:05

您的命令正在PyPi中搜索包,这将无法工作,因为您尚未在那里发布包

要安装本地软件包,您应该能够运行pip install path_containing_fdroid_build_checker/froid_buildchecker

您必须确保您的包包含一个setup.py文件(1),以便pip构建控制盘并成功安装

https://stackoverflow.com/a/41537134/2741222

1-https://packaging.python.org/tutorials/packaging-projects/#creating-setup-py

相关问题 更多 >