Install python module for non-default version on linux

I have different versions of python installed on my ubuntu machine. The default version is 2.7.

So when I install a new python module, for example using:

#apt-get install python-nfqueue

it will only be used for the default version (2.7)

How do I install new modules for other versions? Is there a way to do this using apt-get install?

Thank!

+3


source to share


2 answers


You need to install the Python library Python package installer pip

.



Create a virtualenv with the version of Python you want to use, activate it and be done pip install NetfilterQueue

. You still need to install system dependencies (like libnetfilter-queue-dev

in this case) with apt-get

.

+3


source


You can install pip to work with different python versions. Here is a link to a pip reading the docs page ( http://pip.readthedocs.org/en/latest/installing.html ).

to install pip to the default python version on your machine:

python get-pip.py 

      

to install for non-standard versions, python is called with the version you want to install for:



python33 get-pip.py 

      

you can run pip for python version 3.3 by calling

pip33 install pythonmodule

      

+2


source







All Articles