16

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).

Dr McKay
  • 2,548
  • 2
  • 21
  • 26

1 Answers1

14

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:

  • /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

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.

Antonio Cuni
  • 172
  • 1
  • 2
  • It worked! Thank you! `/usr/bin/easy_install` was in fact part of CPython. However, I just downloaded `distribute_setup.py` and ran it with pypy. It installed easy_install into `/usr/lib64/pypy-1.5/bin` (so it didn't override any CPython-related files - probably because of different PYTHONPATH of CPython and PyPy). – Dr McKay May 05 '11 at 20:31
  • the distribute_setup.py link does not work any more, this one does : http://python-distribute.org/distribute_setup.py – Erik Sep 23 '14 at 19:09
  • Distribute is no longer maintained, it has been merged with [Setup Tools](https://bitbucket.org/pypa/setuptools) – shad0w_wa1k3r Dec 27 '14 at 08:10