is it possible to install 2 versions of python?

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

is it possible to install 2 versions of python?

Postby wonslung » 04 Dec 2009, 11:55

i was just currious if there is an easy way to set up 2 versions of python on the same system.

I have a program that calls for python 2.5 and doesn't quite work as well with 2.6

edit:

never mind, i just realized how silly this question was..i'll just use a jail
wonslung
Member
 
Posts: 850
Joined: 07 May 2009, 00:15

Postby Voltar » 04 Dec 2009, 12:59

Yes, you can install both. I have Python 2.5 and 2.6 installed from ports. The default 'python' in /usr/local/bin is 2.6, and I have a 'python2.5' and 'python2.6' binary.

Code: Select all
# ls -a | grep python
python
python-config
python-shared
python-shared-config
python-shared2.5
python-shared2.5-config
python-shared2.6
python-shared2.6-config
python2.5
python2.5-config
python2.6
python2.6-config
...
Voltar
Member
 
Posts: 191
Joined: 23 Dec 2008, 18:26
Location: Bakersfield, California, US

Postby wonslung » 05 Dec 2009, 14:14

Voltar wrote:Yes, you can install both. I have Python 2.5 and 2.6 installed from ports. The default 'python' in /usr/local/bin is 2.6, and I have a 'python2.5' and 'python2.6' binary.

Code: Select all
# ls -a | grep python
python
python-config
python-shared
python-shared-config
python-shared2.5
python-shared2.5-config
python-shared2.6
python-shared2.6-config
python2.5
python2.5-config
python2.6
python2.6-config


yah, i just found this in the handbook after mentioning it...when you do it this way does the python programs know which one to use?

for instance if i have 2.6 set as default and i have a program which needs 2.5 how do i make sure it uses 2.5
wonslung
Member
 
Posts: 850
Joined: 07 May 2009, 00:15

Postby Dru » 05 Dec 2009, 15:46

Just edit your make.conf to which version you want to use, before you build the port.
User avatar
Dru
Member
 
Posts: 186
Joined: 27 Sep 2009, 23:57

Postby wonslung » 05 Dec 2009, 22:41

ok, so if it's not a port, i could just do this:

set make.conf to use python 2.5, install the program which needs 2.5, then set make.conf to use 2.6 and install everything else that needs python?
wonslung
Member
 
Posts: 850
Joined: 07 May 2009, 00:15

Postby DutchDaemon » 05 Dec 2009, 22:45

You can set port-specific settings in [file]/etc/make.conf[/file]. Random example:

Code: Select all
.if ${.CURDIR:M*/ports/devel/ccache}
  NO_CCACHE=yes
.endif
User avatar
DutchDaemon
Old Fart
 
Posts: 10466
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby Voltar » 05 Dec 2009, 23:08

wonslung wrote:for instance if i have 2.6 set as default and i have a program which needs 2.5 how do i make sure it uses 2.5


Edit the shebang?
...
Voltar
Member
 
Posts: 191
Joined: 23 Dec 2008, 18:26
Location: Bakersfield, California, US


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: Bing [Bot], Windmill and 1 guest