Installing pypi package twice

Hans Mulder hansmu at xs4all.nl
Wed Feb 1 11:49:57 EST 2012


On 1/02/12 07:04:31, Jason Friedman wrote:
> 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



More information about the Python-list mailing list