Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Python version by default in FreeBSD?

I'm trying to install the application node, but by default in my environment is python 3, and requires python 2.6. How can I change the default python version in FreeBSD?

# cd /usr/local/bin
# ls -l | grep python
-r-xr-xr-x   2 root  wheel  1246256 Jul 12  2011 python
-r-xr-xr-x   2 root  wheel     1401 Jul 12  2011 python-config
-r-xr-xr-x   2 root  wheel     6060 Jul 12  2011 python-shared
-r-xr-xr-x   2 root  wheel     1408 Jul 12  2011 python-shared-config
-r-xr-xr-x   1 root  wheel     3720 Jul 12  2011 python-shared2.6
-r-xr-xr-x   1 root  wheel     1431 Jul 12  2011 python-shared2.6-config
-r-xr-xr-x   2 root  wheel     6060 Jul 12  2011 python-shared3.1
-r-xr-xr-x   2 root  wheel     1408 Jul 12  2011 python-shared3.1-config
-r-xr-xr-x   1 root  wheel  1182056 Jul 12  2011 python2.6
-r-xr-xr-x   1 root  wheel     1424 Jul 12  2011 python2.6-config
-r-xr-xr-x   2 root  wheel  1246256 Jul 12  2011 python3.1
-r-xr-xr-x   2 root  wheel     1401 Jul 12  2011 python3.1-config
like image 948
Opsa Avatar asked Feb 19 '12 14:02

Opsa


People also ask

Does Python work on FreeBSD?

FreeBSD currently supports Python (CPython) branches until they are end-of-life (EoL) as defined upstream.

How do I change the default version of Python in idle?

In the Windows environment, if you want to use particular install of IDLE, I find the easiest way is to right click on the . py file and choose "open with". Then navigate to the IDLE. bat file in the Python version install location you want to use.


1 Answers

You could remove /usr/local/bin/python and create a symlink to Python 2.6:

rm /usr/local/bin/python
ln -s /usr/local/bin/python2.6 /usr/local/bin/python
like image 72
zeekay Avatar answered Sep 23 '22 11:09

zeekay