Installing pypi package twice

J

Jason Friedman

My system's default python is 2.6.5. I have also installed python3.2
at /opt/python.
I installed a pypi package for 2.6.5 with:
$ tar xzf package.tar.gz
$ cd package
$ python setup.py build
$ sudo python setup.py install

How can I also install this same package for 3.2? (I am assuming this
package works with 3.2 or that I can make it work.)
 
H

Hans Mulder

My system's default python is 2.6.5. I have also installed python3.2
at /opt/python.
I installed a pypi package for 2.6.5 with:
$ tar xzf package.tar.gz
$ cd package
$ python setup.py build
$ sudo python setup.py install

How can I also install this same package for 3.2? (I am assuming this
package works with 3.2 or that I can make it work.)

How about (in another directory):

$ tar xzf package.tar.gz
$ cd package
$ /opt/python/bin/python setup.py build
$ sudo /opt/python/bin/python setup.py install

This assumes that /opt/python/bin/python is your python3.2 executable.

You may want to insert some testing between the 'build' and 'install'
steps. Or you could try:

$ /opt/python/bin/python -m compileall build/lib

That would try to compile all Python files in the subdirectory to byte
code. That's likely to fail if the Python code is not valid Python 3.
If it compiles, you may still want to do some testing.

Hope this helps,

-- HansM
 
A

Andrea Crotti

How about (in another directory):

$ tar xzf package.tar.gz
$ cd package
$ /opt/python/bin/python setup.py build
$ sudo /opt/python/bin/python setup.py install

This assumes that /opt/python/bin/python is your python3.2 executable.

You may want to insert some testing between the 'build' and 'install'
steps. Or you could try:

$ /opt/python/bin/python -m compileall build/lib

That would try to compile all Python files in the subdirectory to byte
code. That's likely to fail if the Python code is not valid Python 3.
If it compiles, you may still want to do some testing.

Hope this helps,

-- HansM


That works, but it's probably easier to (depending on your needs):
- install easy_install / pip for that python version
- use virtualenv
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,837
Latest member
SalCustanc

Latest Threads

Top