使用我的项目创建 Python pip 包

发布于 2025-01-01 22:31:36 字数 143 浏览 3 评论 0原文

我正在开发一些依赖于其中之一的应用程序。 我看到 pip 可以创建捆绑包。 我的所有项目源都在一个目录中。

如何为这些项目创建捆绑包,然后安装在其他 Ubuntu 系统中? 也许我应该使用 virtualenv 。是否有可能为所有这些人提供一个虚拟环境?

I am developing some apps which depends on one of them.
I see pip can create bundles.
I have all my projects source in one dir.

How to create bundle for these projects and then install in other Ubuntu system?
probably I should use virtualenv. Is it possible to have one virtualenv for all of them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心凉怎暖 2025-01-08 22:31:36

要创建捆绑包,请使用以下内容:

pip bundle <name of bundle>.pybundle -r requirements.txt

其中requirements.txt包含要安装的应用程序列表。或者您可以使用单个应用程序创建一个捆绑包(为什么?):

pip bundle <name of bundle>.pybundle <my app>

然后,在另一个系统上,要安装您的捆绑包,您可以使用:

pip install <name of bundle>.pybundle

记下您的捆绑包的 .pybundle 扩展名 - 您需要这个扩展名以便 pip 识别它 - 安装没有扩展的捆绑包对我不起作用。

然而,pip bundle 已在 1.4 版本中弃用,并将在 1.5 版本中删除,查看更改日志

干杯,
胜利者

To create a bundle, use something like:

pip bundle <name of bundle>.pybundle -r requirements.txt

where requirements.txt contains your list of apps to install. Or you can create a bundle with a single app (why?):

pip bundle <name of bundle>.pybundle <my app>

Then, on the other system, to install your bundle, you use:

pip install <name of bundle>.pybundle

Note the .pybundle extension for your bundle - you need this for pip to recognise it - install the bundle without an extension didn't work for me.

However pip bundle has been deprecated in 1.4 release and it will be removed in 1.5 release, see change log

Cheers,
Victor

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文