0

I have been using linux mint for a while and have started coding in python recently. I once changed the symlink for python which by default was pointing to python2.7 in /usr/bin to python3.8. The system crashed on the next login. I ended up reinstalling the OS.

I then tried update-alternatives to link python to python3.8. It again crashed. I eventually just created an alias for it in ~/.bashrc. However, I just realized that sudo (root) does not source ~/.bashrc.

Is there a way to link the python command to python3.8 without the system crashing (linux mint)?

Shahin
  • 1,196
  • 1
  • 8
  • 15
  • You don't want to mess with `/usr/bin`. If you want `python` to mean `python3` in your own interactive shell, a simple alias or function does that. – tripleee Jan 29 '20 at 04:42
  • how about sudo? I created the alias within ~/.bashrc but that doesn't work when I do `sudo python setup.py install` Can I create a `pipenv` virtual environment and have point to it using sudo? – Shahin Jan 29 '20 at 05:03
  • Maybe a better solution is to have a symlink in `$HOME/bin` and add that to the start of your `PATH`. I'm not familiar enough with `pipenv` to say off hand whether that could work too. – tripleee Jan 29 '20 at 05:09
  • That should work! Thanks – Shahin Jan 29 '20 at 05:14

0 Answers0