Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Python eggs under PyPy

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

like image 714
Dr McKay Avatar asked May 04 '11 15:05

Dr McKay


People also ask

Can you pip install an egg?

pip install can install sdist or wheel packages, but not eggs. In the world of pip and wheels egg is now an outdated format and should be replaced with wheels.

Is Python egg deprecated?

There is also a third, now deprecated format: the Python 'egg'. You're very unlikely to encounter this format directly, however much of setuptools and pip's internal behaviour was influenced by this format.

How do you execute a Python egg?

A python egg is a "a single-file importable distribution format". Which is typically a python package. You can import the package in the egg as long as you know it's name and it's in your path. You can execute a package using the "-m" option and the package name.

How do I make a Python egg file?

EGG files can be created using the distutils package available by Python. Another tool that can create and open EGG files is SetupTools. EGG files can be installed as a package using easy_install.


1 Answers

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.

like image 156
Antonio Cuni Avatar answered Sep 27 '22 18:09

Antonio Cuni