为什么我的蟒蛇蛋不起作用? - 根本没有找到发行版

发布于 2024-11-14 12:45:47 字数 1070 浏览 3 评论 0原文

我已经使用以下 setup.py 分发了我的 python 包,

#!/usr/bin/env python

from setuptools import setup

setup(name='mypackagename',
      version='0.1',
      description='Tool ....',
      author='Peter Smit',
      author_email='[email protected]',
      packages=['mypackagename'],
      package_dir={'': 'src'},
      install_requires=['boto'],
      entry_points = dict(console_scripts=[
        'mypackagenamescript = mypackagename.launcher:run',
        ])
      )

我使用 python setup.py bdist_egg 创建了一个 Egg。

现在尝试使用 pip 安装它会出现以下错误:

bin/pip install mypackagename-0.1-py2.6.egg 
Downloading/unpacking mypackagename-0.1-py2.6.egg
  Could not find any downloads that satisfy the requirement mypackagename-0.1-    py2.6.egg
No distributions at all found for mypackagename-0.1-py2.6.egg

将完整日志存储在 /home/peter/.pip/pip.log

提到的日志文件显示它尝试从 pypi 下载包,而该包显然不存在。

我做错了什么?我如何安装我的这个egg及其依赖项?

I have made a distribution of my python package with the following setup.py

#!/usr/bin/env python

from setuptools import setup

setup(name='mypackagename',
      version='0.1',
      description='Tool ....',
      author='Peter Smit',
      author_email='[email protected]',
      packages=['mypackagename'],
      package_dir={'': 'src'},
      install_requires=['boto'],
      entry_points = dict(console_scripts=[
        'mypackagenamescript = mypackagename.launcher:run',
        ])
      )

I created an egg of this with python setup.py bdist_egg.

Trying to install it now with pip gives the following error:

bin/pip install mypackagename-0.1-py2.6.egg 
Downloading/unpacking mypackagename-0.1-py2.6.egg
  Could not find any downloads that satisfy the requirement mypackagename-0.1-    py2.6.egg
No distributions at all found for mypackagename-0.1-py2.6.egg

Storing complete log in /home/peter/.pip/pip.log

The mentioned log files showed that it tries to download the package from pypi, where it obviously does not exist.

What did I do wrong? How can I install this egg of mine plus it's dependencies?

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

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

发布评论

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

评论(3

神经大条 2024-11-21 12:45:47

为什么不使用 setuptools easy_install

easy_install mypackagename-0.1-py2.6.egg 

如果你想使用鸡蛋,那就是这样。

why not using setuptools easy_install?

easy_install mypackagename-0.1-py2.6.egg 

If you want to work with eggs that's the way.

氛圍 2024-11-21 12:45:47

pip 无法从 Egg​​ 安装

如果您希望您的软件包在 PyPI 上可用,您需要在那里注册并创建帐户并上传。然后您可以简单地说pip install myproject。它将搜索 PyPI,找到它,下载并安装它。

如果您已准备好 setup.py 并希望在本地安装应用程序,则只需输入 python setup.py install 即可。您不需要使用 pip 或 easy_install。

打包搭便车指南包含所有这些内容的详细信息。它应该让事情变得清楚。

pip cannot install from eggs.

If you want your package to be available on PyPI, you need to register and account there and upload it. You can then simply say pip install myproject. It will search PyPI, find it, download and install it.

If you have your setup.py ready and want to install your application locally, all you need to do is to say python setup.py install. You don't need to use pip or easy_install.

The hitchhikers guide to packaging contains details on all these things. It should make things clear.

九厘米的零° 2024-11-21 12:45:47

Pip 无法安装 Egg。恕我直言,这是一个严重的缺乏。我建议你尝试 Pyg。只需下载 get-pyg.py 脚本并执行它:

$ curl -O https://raw.github.com/rubik/pyg/master/get-pyg.py
$ python get-pyg.py
Retrieving archive from ... etc.

注意:作为替代方案,您可以通过 easy_install 或 pip 安装它。

然后你就可以使用它了:

$ pyg install mypackagename-0.1-py2.6.egg

Pyg也支持virtualenv。

鲁比克

Pip cannot install eggs. IMHO that is a serious lack. I would suggest you to try out Pyg. Just download the get-pyg.py script and execute it:

$ curl -O https://raw.github.com/rubik/pyg/master/get-pyg.py
$ python get-pyg.py
Retrieving archive from ... etc.

Note: As an alternative, you can install it via easy_install or pip.

Then you can use it:

$ pyg install mypackagename-0.1-py2.6.egg

Pyg supports virtualenv too.

rubik

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