Python Forum
RE: Making Python3 Default on Debian Stretch
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RE: Making Python3 Default on Debian Stretch
#1
Hello,

I was trying to find info. on making my Debian Distro Python3 ready. I have Python3 installed on the machine but it is not my default Python.

Is there a way to make Python3 set as default for when I am installing packages w/ PIP?

Seth
Reply
#2
I do not recommend you to do that. Half of the system depends on Python and Perl scripts. If you change the default Python version you can ruin the system.

What you can do is to create an alias called python put it in the bottom of .bashrc or wherever are the aliases located and you are done. I think... Dodgy

alias python="puthon3"

Save the file, open a new terminal window and type python to see what version will print at the top.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
Use pyenv it's the best Python Version Management system.
# Install
mint@mint ~ $ pyenv install 3.6.4
Downloading Python-3.6.4.tar.xz...
-> https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
Installing Python-3.6.4...
Installed Python-3.6.4 to /home/mint/.pyenv/versions/3.6.4
 
# Set python and pip to point to 3.6.4
mint@mint ~ $ pyenv global 3.6.4
mint@mint ~ $ python -V
Python 3.6.4
mint@mint ~ $ pip -V
pip 9.0.1 from /home/mint/.pyenv/versions/3.6.4/lib/python3.6/site-packages (python 3.6)
# Finish
No more python3 or pip3 or --user/sudo when pip install something.
python and pip always point what you set in global,easy to switch Anaconda/PyPy...ect to.
It's safe as it do not mess with default installed pyenv local system and back to default distro setup.
Reply
#4
I know this feature, but never tried it. I use Arch Linux and it has Python 3.6.x currently as standard.
You can try this with pyenv and look if your Debian is still working.

Some system tools are not converted yet to Python 3, but I think this will be lesser and lesser.
2020 is over with Python 2.7 support and at this time, every distribution have to solve the issue,
or they have to manage security fixes by their own for Python 2.7. I know that they want to prevent this useless work.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#5
Hello,

This may sound silly but here goes it: I use this command, sudo apt install python3-pip, to get pip3 and then I just used another command, sudo apt install digi-xbee, to get what it was I was looking to attain.

Seth

P.S. People, thank you for your support. This is my first go around w/ this board. I will be more reluctant to post next time. Thank you again.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VScode vs VScodium on Debian - which one to use :: goal: work with Python apollo 1 2,046 Oct-19-2019, 12:57 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020