LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   python install question (https://www.linuxquestions.org/questions/slackware-14/python-install-question-4175611992/)

coldbeer 08-15-2017 08:18 AM

python install question
 
The existing python 2 in installed in /usr (/usr/bin, /usr/lib).

Python 3 tarball defaults are set to install in /usr/local (/usr/local/bin, /usr/local/lib)

If I install python 3 and keep the original python 2, will there be problems between them?

coldbeer 08-15-2017 08:31 AM

Nevermind. I found this.


http://www.linuxquestions.org/questi...ll-4175443290/

Sefyir 08-15-2017 08:36 AM

I wouldn't suggest installing python3 from source directly to /usr/local/bin, since it can be difficult to get rid of it afterwards (Is there a easy way to update / install?) I'd suggest prefixing it with a specific install location (like /opt). Alternatively, Anaconda is good for getting python.

Anyways, if you examine several scripts in /usr/bin and /usr/local/bin you will notice hashbangs of mostly this sort (This is on Linux Mint Cinnamon)

Code:

#!/usr/bin/python
#!/usr/bin/python3

Because these appear to reference directly to a preinstalled python, you should be fine as long as you don't overwrite /usr/bin/python or /usr/bin/python3. However, some may contain something like this

Code:

#!/usr/bin/env python
So whatever the PATH variable says python is at, it will use. If $PATH references python3 as python, that could be a issue!


All times are GMT -5. The time now is 11:05 AM.