在 PyPy 下安装 Python Egg
如何在 PyPy 下安装 Python Egg?
在安装过程中,PyPy 创建了 /usr/lib64/pypy-1.5/site-packages/
目录。因此,我尝试使用 easy_install 并将前缀设置为此目录,但它抱怨这不是 Eggs 的有效目录。我是否只是从 /usr/lib/python2.7/site-packages
复制 Egg,还是像使用 easy_install 一样简单(也许需要对配置进行一些更改)?
我的工作环境是 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 版本为:distribute 0.6.14 (usr/bin/easy_install
)。
How do I install Python egg under PyPy?
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)?
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
).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您需要确保已经专门为 PyPy 安装了分发版。我不知道 fedora 是如何打包的,但一般来说,为 cpython 安装一个包并不能让它也适用于 PyPy。特别是,/usr/bin/easy_install 可能仅适用于 CPython。
如果您使用 PyPy 的“正常”安装,您将具有以下目录结构:
然后你可以下载 http://python-distribute.org/ distribution_setup.py 并执行它:
现在,您应该有 /opt/pypy-1.5/bin/easy_install,它将在 /opt/pypy-1.5/site-packages 中安装软件包。
但是,我不知道 pypy 是如何打包在 fedora 中的。如果它“只是”安装在/usr/bin 中,那么安装distribute 有可能会覆盖原始cpython 的/usr/bin/easy_install。
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.
If you use a "normal" install of PyPy, you have this directory structure:
Then you can download http://python-distribute.org/distribute_setup.py and execute it:
Now, you should have /opt/pypy-1.5/bin/easy_install, which will install packages inside /opt/pypy-1.5/site-packages.
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.