Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i use pip with pypy installed from launchpad?

I have ubuntu 11.10. I apt-get installed pypy from this launchpad repository: https://launchpad.net/~pypy the computer already has python on it, and python has its own pip. How can I install pip for pypy and how can I use it differently from that of python?

like image 435
user1098562 Avatar asked Dec 14 '11 19:12

user1098562


People also ask

Can I use pip with PyPy?

Pip/pip3 is the official package manager for Python, but it can also be used by PyPy for installing Python modules.

What packages work with PyPy?

Compatibility: PyPy is highly compatible with existing python code. It supports cffi, cppyy, and can run popular python libraries like twisted, and django. It can also run NumPy, Scikit-learn and more via a c-extension compatibility layer.


2 Answers

Quoting (with minor changes) from here the pypy website:

If you want to install 3rd party libraries, the most convenient way is to install pip:

$ curl -O https://bootstrap.pypa.io/get-pip.py $ ./pypy-2.1/bin/pypy get-pip.py $ ./pypy-2.1/bin/pip install pygments  # for example 

In order to use it nicely, you might want to add an alias into e.g. ~/.bashrc:

alias pypy_pip='./pypy-2.1/bin/pip' 

Where the actual pip executable is located has to be taken from the output of pypy get-pip.py

like image 158
xubuntix Avatar answered Sep 29 '22 16:09

xubuntix


To keep a separate installation, you might want to create a virtualenv for PyPy. Within the virtualenv, you can then just run pip install whatever and it will install it for PyPy. When you create a virtualenv, it automatically installs pip for you.

Otherwise, you will need to work out where PyPy will import from and install distribute and pip in one of those locations. pip's installer should do this automatically when run with PyPy. Be careful with this option - if it decides to install in your system Python directories, it could break other things.

like image 29
Thomas K Avatar answered Sep 29 '22 18:09

Thomas K