Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19690 > unrolled thread

Installing pypi package twice

Started byJason Friedman <jason@powerpull.net>
First post2012-02-01 06:04 +0000
Last post2012-02-01 16:54 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Installing pypi package twice Jason Friedman <jason@powerpull.net> - 2012-02-01 06:04 +0000
    Re: Installing pypi package twice Hans Mulder <hansmu@xs4all.nl> - 2012-02-01 17:49 +0100
      Re: Installing pypi package twice Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-02-01 16:54 +0000

#19690 — Installing pypi package twice

FromJason Friedman <jason@powerpull.net>
Date2012-02-01 06:04 +0000
SubjectInstalling pypi package twice
Message-ID<mailman.5286.1328076275.27778.python-list@python.org>
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.)

[toc] | [next] | [standalone]


#19718

FromHans Mulder <hansmu@xs4all.nl>
Date2012-02-01 17:49 +0100
Message-ID<4f296d35$0$6891$e4fe514c@news2.news.xs4all.nl>
In reply to#19690
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

[toc] | [prev] | [next] | [standalone]


#19719

FromAndrea Crotti <andrea.crotti.0@gmail.com>
Date2012-02-01 16:54 +0000
Message-ID<mailman.5305.1328115297.27778.python-list@python.org>
In reply to#19718
On 02/01/2012 04:49 PM, Hans Mulder wrote:
>
> 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web