I have a few questions. (beginner so maybe I am asking the wrong questions)
What's the point of setuptools and the other packages on the Ubuntu installation? Are these packages automatically included in the windows installation? I don't see them in my windows python install. Also, why python3-setuptools and not a version specific python3.11-setup tools?
When I look at the docs for something like setuptools they seem to recommend using pip to install it. Is it a bad idea to use pip to install these? Would it be advantageous to have it specific to a virtual environment?
I appreciate your guides. Especially the ones about setting up python virtual environments.
The answer to this requires a whole python packaging history lesson, so I'll simplfify.
Setuptools is a lib made to create package. It used to be also popular as a mean to install packages before we got wheels, and it's why with some old packages, you may need it.
You should install it in your venv using pip if you need it.
Ubuntu provides it mostly for its own system, consider that separate to your python projects.
I appreciate how clearly you've outlined your recommendations here. Could you say a bit more, or have you said more elsewhere, about this point you make: "Macs come with Python preinstalled, but I strongly advise that you install one version from python.org and don't use the one that is provided with your OS. Indeed, like the Python on Homebrew, it's not designed to be used by you, but as a system dependency."
What do you mean it's not designed to be used by the user? If it's not designed to be used by the user, then what processes are supposed to use it and what should the user expect from it?
In particular, I notice that if I do `pip3 list --user` I see a lot of packages. I don't remember if I installed those myself manually. Perhaps I did, and should not have done so according to your advice. But now I'm wondering if it's the case that other, normally functioning applications would be expected to install packages there.
By the OS. Python is shipped on Mac because the Mac itself uses it. It's a system dependency, it doesn't have devs in mind, and you really don't want to mess with it.
I've followed your install instructions as closely as possible (looks like the installer layout may have changed very slightly) and everything is going well. I also followed all the instructions on setting up virtual environments from your other article.
When I activate an environment then install a package with pip, I get a notice saying "A new release of pip is available: 23.2.1 -> 23.3.1" then on the next line "To update, run: python.exe -m pip install --upgrade pip". This works just fine, but it only upgrades pip for that virtual environment. Is there a way to upgrade pip so that newly created environments "inherit" the newest version of pip when they are created? "Inherit" probably isn't the right term but hopefully it makes the point.
> If you see "No files for this release" instead of download links, move to the next bugfix release. E.G.: if "3.10.10" doesn't have any download link, go to "3.10.9". Repeat until you find one with download links.
I don't like the advice to skip the latest patch version if it doesn't have binaries. The patch versions often (almost always) have security fixes. Right now, only 3.10.11 has a binary installer even though 3.10.12 has fixes for a number of security issues. Once releases start coming out without binaries, I would just move on to the next version.
For more on the Python release cycle, see https://peps.python.org/pep-0602/. TL;DR binaries and "full support" are only for the first 1.5 years after a minor release.
Struggling here, I nuked as many python installs as I could, including anaconda since everything was broken. But homebrew is still there & seems to be the default, even after following the above. For example 'which python3.10' returns the below in my terminal:
/opt/homebrew/bin/python3.10
What do I need to do here to use the python.org version?
Thanks so much for this post - If I have a wild mix of python installations (from homebrew, miniconda and who knows else), does it make sense to clean them up?
Depends, one has to be pragmatic about it: if you have many projects already depending on them, recreating each dev env could take a while. You have to wonder if it's worth it.
If you have the time and will, yes. But be careful with it, homebrew and conda do things their way, and you may accidently rely on that.
Hello, thank you for your blog post. What is the way of adding more python versions to "py launcher", just download the installer of a different version and it will apper in list-paths?
Yes, provider it's compatible, but most popular mode of installations are: the store, anaconda, the official installer, etc. Those will all be found automatically.
I have a few questions. (beginner so maybe I am asking the wrong questions)
What's the point of setuptools and the other packages on the Ubuntu installation? Are these packages automatically included in the windows installation? I don't see them in my windows python install. Also, why python3-setuptools and not a version specific python3.11-setup tools?
When I look at the docs for something like setuptools they seem to recommend using pip to install it. Is it a bad idea to use pip to install these? Would it be advantageous to have it specific to a virtual environment?
I appreciate your guides. Especially the ones about setting up python virtual environments.
The answer to this requires a whole python packaging history lesson, so I'll simplfify.
Setuptools is a lib made to create package. It used to be also popular as a mean to install packages before we got wheels, and it's why with some old packages, you may need it.
You should install it in your venv using pip if you need it.
Ubuntu provides it mostly for its own system, consider that separate to your python projects.
Ohhhh. Thanks for clearing that up!
That's actually a good article to write
I appreciate how clearly you've outlined your recommendations here. Could you say a bit more, or have you said more elsewhere, about this point you make: "Macs come with Python preinstalled, but I strongly advise that you install one version from python.org and don't use the one that is provided with your OS. Indeed, like the Python on Homebrew, it's not designed to be used by you, but as a system dependency."
What do you mean it's not designed to be used by the user? If it's not designed to be used by the user, then what processes are supposed to use it and what should the user expect from it?
In particular, I notice that if I do `pip3 list --user` I see a lot of packages. I don't remember if I installed those myself manually. Perhaps I did, and should not have done so according to your advice. But now I'm wondering if it's the case that other, normally functioning applications would be expected to install packages there.
By the OS. Python is shipped on Mac because the Mac itself uses it. It's a system dependency, it doesn't have devs in mind, and you really don't want to mess with it.
I've followed your install instructions as closely as possible (looks like the installer layout may have changed very slightly) and everything is going well. I also followed all the instructions on setting up virtual environments from your other article.
When I activate an environment then install a package with pip, I get a notice saying "A new release of pip is available: 23.2.1 -> 23.3.1" then on the next line "To update, run: python.exe -m pip install --upgrade pip". This works just fine, but it only upgrades pip for that virtual environment. Is there a way to upgrade pip so that newly created environments "inherit" the newest version of pip when they are created? "Inherit" probably isn't the right term but hopefully it makes the point.
Unfortunatly no. That would be a great feature.
> If you see "No files for this release" instead of download links, move to the next bugfix release. E.G.: if "3.10.10" doesn't have any download link, go to "3.10.9". Repeat until you find one with download links.
I don't like the advice to skip the latest patch version if it doesn't have binaries. The patch versions often (almost always) have security fixes. Right now, only 3.10.11 has a binary installer even though 3.10.12 has fixes for a number of security issues. Once releases start coming out without binaries, I would just move on to the next version.
For more on the Python release cycle, see https://peps.python.org/pep-0602/. TL;DR binaries and "full support" are only for the first 1.5 years after a minor release.
Struggling here, I nuked as many python installs as I could, including anaconda since everything was broken. But homebrew is still there & seems to be the default, even after following the above. For example 'which python3.10' returns the below in my terminal:
/opt/homebrew/bin/python3.10
What do I need to do here to use the python.org version?
Without having access to your machine, it's very hard for me to know.
The first thing to look at is the PATH env var: https://www.bitecode.dev/p/environment-variables-for-beginners
But with homebrew, it can be many things.
oof - that's messier than I expected:
echo $PATH >>
/opt/homebrew/bin
/Library/Frameworks/Python.framework/Versions/3.11/bin
/opt/homebrew/bin
/opt/homebrew/sbin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/MacGPG2/bin
/Library/Frameworks/Mono.framework/Versions/Current/Commands
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/usr/local/bin/python3
Thanks so much for this post - If I have a wild mix of python installations (from homebrew, miniconda and who knows else), does it make sense to clean them up?
Depends, one has to be pragmatic about it: if you have many projects already depending on them, recreating each dev env could take a while. You have to wonder if it's worth it.
If you have the time and will, yes. But be careful with it, homebrew and conda do things their way, and you may accidently rely on that.
Hello, thank you for your blog post. What is the way of adding more python versions to "py launcher", just download the installer of a different version and it will apper in list-paths?
Yes, provider it's compatible, but most popular mode of installations are: the store, anaconda, the official installer, etc. Those will all be found automatically.