eb54 [Solved] is it possible to install 2 versions of python? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Ports & Packages > Installation and Maintenance of FreeBSD Ports or Packages

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

Reply
 
Thread Tools Display Modes
  #1  
Old December 4th, 2009, 12:55
wonslung wonslung is offline
Member
 
Join Date: May 2009
Posts: 826
Thanks: 32
Thanked 15 Times in 14 Posts
Default is it possible to install 2 versions of python?

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
Reply With Quote
  #2  
Old December 4th, 2009, 13:59
Voltar Voltar is offline
Member
 
Join Date: Dec 2008
Location: Bakersfield, California, US
Posts: 191
Thanks: 9
Thanked 23 Times in 17 Posts
Default

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:
# 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
__________________
...
Reply With Quote
  #3  
Old December 5th, 2009, 15:14
wonslung wonslung is offline
Member
 
Join Date: May 2009
Posts: 826
Thanks: 32
Thanked 15 Times in 14 Posts
Default

Quote:
Originally Posted by Voltar View Post
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:
# 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
Reply With Quote
  #4  
Old December 5th, 2009, 16:46
Dru's Avatar
Dru Dru is offline
Member
 
Join Date: Sep 2009
Posts: 186
Thanks: 17
Thanked 13 Times in 8 Posts
Default

Just edit your make.conf to which version you want to use, before you build the port.
Reply With Quote
  #5  
Old December 5th, 2009, 23:41
wonslung wonslung is offline
Member
 
Join Date: May 2009
Posts: 826
Thanks: 32
Thanked 15 Times in 14 Posts
Default

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?
Reply With Quote
  #6  
Old December 5th, 2009, 23:45
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,849
Thanks: 30
Thanked 1,892 Times in 1,335 Posts
Default

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

Code:
.if ${.CURDIR:M*/ports/devel/ccache}
  NO_CCACHE=yes
.endif
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #7  
Old December 6th, 2009, 00:08
Voltar Voltar is offline
Member
 
Join Date: Dec 2008
Location: Bakersfield, California, US
Posts: 191
Thanks: 9
Thanked 23 Times in 17 Posts
Default

Quote:
Originally Posted by wonslung View Post
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?
__________________
...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Jails and different versions of Freebsd wonslung General 2 October 4th, 2009 18:37
[Solved] different versions of samba, not sure which to use. wonslung Installation and Maintenance of FreeBSD Ports or Packages 2 June 19th, 2009 06:35
python threads on freebsd frostbite Installation and Maintenance of FreeBSD Ports or Packages 1 March 17th, 2009 08:50
Python/GLib misbehaving Togra GNOME 1 March 1st, 2009 08:27
Python Ports dchappelle Installation and Maintenance of FreeBSD Ports or Packages 7 January 10th, 2009 08:45


All times are GMT +1. The time now is 05:05.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0