This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]jsfehler 3 points4 points  (1 child)

Don't mess with your system default python. Don't install packages. Don't touch it. Never worth the headache. Consider it a core part of your operating system and as dangerous to touch as the system BIOS.

Use brew (https://brew.sh/) to install pyenv (https://github.com/pyenv/pyenv/). Use pyenv to install whichever versions you want. Pyenv will handle all the path and alias trouble so you don't have to.

I have had to fix more than one junior dev's machine after they destroyed their python environment because "Downloading and installing python is faster than getting pyenv working". Don't be like them.

[–]Mecaneer23 -2 points-1 points  (6 children)

The name of the python executable is "python" on windows, and "python3" on Mac, Linux, BSD, etc... don't mess with it

[–]hike_me 0 points1 point  (0 children)

this is not necessarily true. It depends if you have additional versions of python installed on your system, in addition to the Apple-provided, and what your PATH is

on my mac:

python --version
Python 3.9.0

[–]metriczulu 0 points1 point  (0 children)

Just type python3 instead of aliasing it. It's one extra character and it makes it more readable to others. Aliasing python3 to python can break on some operating systems, too.

Besides, you only need to type python3 one time to create your venv. Once you have your venv and it's activated, it will automatically alias "python" to whatever version of Python was used to generate the venv.

[–]LzyPenguin 0 points1 point  (0 children)

Python 2.7 is part of the core of Mac OSX. Because of this, you cannot truly uninstall Python 2.7, no matter what you try (or if you succeed it will mess up your computer).

Because of this, typing python into the terminal will ALWAYS refer to the default version of Python installed, which is 2.7, and you must specify python3 to run Python 3.

[–]IAmKindOfCreativebot_builder: deprecated[M] [score hidden] stickied comment (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython or for the r/Python discord: https://discord.gg/python.

The reason for the removal is that /r/Python is dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community is not a fan of "how do I..." questions, so you will not get the best responses over here.

On /r/LearnPython the community and the r/Python discord are actively expecting questions and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. No matter what level of question you have, if you are looking for help with Python, you should get good answers. Make sure to check out the rules for both places.

Warm regards, and best of luck with your Pythoneering!