问题描述
如何在PyPy下安装Python egg?
在安装过程中,PyPy创建了 / usr / lib64 / pypy-1.5 / site-packages /
目录。因此,我尝试使用easy_install并将前缀设置为此目录,但是它抱怨这不是鸡蛋的有效目录。我只是从 /usr/lib/python2.7/site-packages
复制鸡蛋,还是像使用easy_install一样容易(可能在配置上有所更改)?
During installation, PyPy created /usr/lib64/pypy-1.5/site-packages/
directory. So, I tried using easy_install with prefix set to this directory, however it complains that this is not a valid directory for eggs. Do I just copy eggs from /usr/lib/python2.7/site-packages
, or is it as easy as using easy_install (with some changes in configuration, perhaps)?
我的工作环境是Fedora 15 Beta,Python 2.7.1( / usr / bin / python
),PyPy 1.5.0-alpha0和GCC 4.6.0(在 / usr / bin / pypy
中,使用yum从RPM安装),easy_install版本是:分发0.6.14( usr / bin / easy_install
)。
My working environment is Fedora 15 Beta, Python 2.7.1 (/usr/bin/python
), PyPy 1.5.0-alpha0 with GCC 4.6.0 (in /usr/bin/pypy
, installed from RPM using yum), easy_install version is: distribute 0.6.14 (usr/bin/easy_install
).
推荐答案
首先,您需要确保专门为PyPy安装的发行版。我不知道fedora如何打包东西,但是通常来说,为cpython安装一个软件包不会使其也可用于PyPy。特别是,/ usr / bin / easy_install可能仅适用于CPython。
First, you need to make sure that you have distribute installed specifically for PyPy. I don't know how fedora packages things, but in general installing a package for cpython does not make it available also for PyPy. In particular, /usr/bin/easy_install is probably CPython-only.
如果您使用常规安装的PyPy,则具有以下目录结构:
If you use a "normal" install of PyPy, you have this directory structure:
- /opt/pypy-1.5/
- bin /
- site-packages /
- lib-python /
- lib_pypy /
- /opt/pypy-1.5/
- bin/
- site-packages/
- lib-python/
- lib_pypy/
然后您可以下载并执行它:
Then you can download http://python-distribute.org/distribute_setup.py and execute it:
$ /opt/pypy-1.5/bin/pypy distribute_setup.py
现在,您应该拥有/opt/pypy-1.5/bin/easy_install,它将在/opt/pypy-1.5/site-packages内安装软件包。
Now, you should have /opt/pypy-1.5/bin/easy_install, which will install packages inside /opt/pypy-1.5/site-packages.
但是,我不知道如何在fedora中打包pypy。它只是安装在/ usr / bin中,那么有可能安装分发版将覆盖原始cpython的/ usr / bin / easy_install。
However, I have no clue how pypy is packaged in fedora. It it's "just" installed in /usr/bin, then there are chances that installing distribute will overwrite the original cpython's /usr/bin/easy_install.
这篇关于在PyPy下安装Python鸡蛋的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!