0
votes

I have a issue where if a python 3 script's shebang line is /usr/bin/env python3 then script will be interpreted with /usr/bin/local/python3

type -P python3
/usr/local/bin/python3

So PATH python3 is /usr/local/bin/python3 but this creates problems where some packages are not available for /usr/local/bin/python3 and I would instead like to use /usr/bin/python3 as default env python3.

Using a alias to set python3 to /usr/bin/python3 can be done but this does not solve the issue. Using Virtualenv if fine but one can not create a virtualenv for every single litte script out there.

type -a shows that there are two python3 defined on my system so there must be a way to change the prefered one:

type -a python3
python3 is aliased to `/usr/bin/python3'
python3 is /usr/local/bin/python3
python3 is /usr/bin/python3

How can I change so that env python 3 is /usr/bin/python3?

Best regards

1
Start using virtual environment to avoid dependency issues How to use virtualenv - Shakeel
Accepted answer in question: stackoverflow.com/questions/19256127/… is to use a alias but I have already explained that this is not a solution for me issue. I need to somehow change that /usr/bin/python3 is default env python - S4M11R

1 Answers

0
votes

I solved the issue by editing /etc/environment. The change that I did was to specify to read /usr/bin before /usr/local/bin as was configured on my computer. After that I restarted my PC and now /usr/bin/python3 is the default env python.