On 2025年08月22日 19:00, Doug Henderson via Cygwin wrote:
On Fri, Aug 22, 2025 at 10:39 AM Soren via Cygwin <[email protected]> wrote:
... I didn't seem to have
"pip" installed (notice the "seem" por favor). So I started
setup-x86_64 and worked through the process of installing "pip". I am
working with python3 so I tried to select a "pip" that corresponded
with it.
Python uses the "alternatives" system to allow multiple versions of
python to be installed at the same time.
Use "man alternatives" or "info alternatives" to learn about it, as
there are several different "alternative" implementations used by
different *NIX systems.
Briefly, "alternatives" is located at "/usr/sbin/alternatives",
because several of its functions required "root" or an elevated shell,
e.g. started with "run as administrator".
The "alternatives --list" command will show you which programs are
configured to use "alternatives". On my machine, the output looks
like:
$ /usr/sbin/alternatives --list
pip3 auto /usr/bin/pip3.12
pydoc3 auto /usr/bin/pydoc3.12
python manual /usr/bin/python3.12.exe
python3 manual /usr/bin/python3.12.exe
sphinx-apidoc auto /usr/bin/sphinx-apidoc-3.9
sphinx-autogen auto /usr/bin/sphinx-autogen-3.9
sphinx-build auto /usr/bin/sphinx-build-3.9
sphinx-quickstart auto /usr/bin/sphinx-quickstart-3.9
(This also shows that I have only installed the 3.9 version of the
sphinx documentation creation suite, and not the 3.12 version.)
The "alternatives pip3" and "alternatives python3" commands show me more info:
$ /usr/sbin/alternatives --display pip3
pip3 - status is auto.
link currently points to /usr/bin/pip3.12
/usr/bin/pip3.9 - priority 39
/usr/bin/pip3.12 - priority 312
Current `best' version is /usr/bin/pip3.12.
$ /usr/sbin/alternatives --display python3
python3 - status is manual.
link currently points to /usr/bin/python3.12.exe
/usr/bin/python3.9 - priority 39
/usr/bin/python3.12 - priority 312
Current `best' version is /usr/bin/python3.12.
These show that I have two versions installed, with the 3.12 versions
configured as the defaults. I can still run the non-default versions
by using the full file names, e.g. "python3.9". You are strongly
advised to use the corresponding versions together, to avoid your
confusion and Python errors.
The root user (I, in an elevated shell) can change the default
versions between 3.9 and 3.12 by using the interactive "alternatives
--config python3" and "alternatives --config pip3" commands.
As a regular user, I use the "python3" or just "python" and the
"pip3" commands to run Python and Pip. You will have to create a
virtual environment using e.g. "python -m venv venv" to use "pip
install" as a regular user. Otherwise you will need to run "pip
install" in an elevated shell.
You will also find you have a bunch of postinstall (.done) and preremove scripts
that Cygwin Setup will use to clean up your system when you (manually) select
python2.7/3.6/3.7 for deinstall (also removing a bunch of vulnerabilities!)
$ grep alternatives /etc/postinstall/python3*.sh* /etc/preremove/python3*.sh
/etc/postinstall/python39.sh.done:/usr/sbin/alternatives --install
/usr/bin/python python /usr/bin/python3.9 39
/etc/postinstall/python39.sh.done:/usr/sbin/alternatives --install
/usr/bin/python3 python3 /usr/bin/python3.9 39
/etc/postinstall/python39.sh.done:/usr/sbin/alternatives --install
/usr/bin/pydoc3 pydoc3 /usr/bin/pydoc3.9 39
/etc/postinstall/python39-devel.sh.done:/usr/sbin/alternatives --install
/usr/bin/2to3 2to3 /usr/bin/2to3-3.9 39
/etc/postinstall/python39-devel.sh.done:/usr/sbin/alternatives --install
/usr/bin/python3-config python3-config /usr/bin/python3.9-config 39
/etc/postinstall/python39-pip.sh.done:/usr/sbin/alternatives --install
/usr/bin/pip3 pip3 /usr/bin/pip3.9 39
/etc/postinstall/python39-sphinx.sh.done:/usr/sbin/alternatives --install
/usr/bin/sphinx-apidoc sphinx-apidoc /usr/bin/sphinx-apidoc-3.9 39
/etc/postinstall/python39-sphinx.sh.done:/usr/sbin/alternatives --install
/usr/bin/sphinx-autogen sphinx-autogen /usr/bin/sphinx-autogen-3.9 39
/etc/postinstall/python39-sphinx.sh.done:/usr/sbin/alternatives --install
/usr/bin/sphinx-build sphinx-build /usr/bin/sphinx-build-3.9 39
/etc/postinstall/python39-sphinx.sh.done:/usr/sbin/alternatives --install
/usr/bin/sphinx-quickstart sphinx-quickstart /usr/bin/sphinx-quickstart-3.9 39
/etc/preremove/python39.sh:/usr/sbin/alternatives --remove python
/usr/bin/python3.9
/etc/preremove/python39.sh:/usr/sbin/alternatives --remove python3
/usr/bin/python3.9
/etc/preremove/python39.sh:/usr/sbin/alternatives --remove pydoc3
/usr/bin/pydoc3.9
/etc/preremove/python39-devel.sh:/usr/sbin/alternatives --remove 2to3
/usr/bin/2to3-3.9
/etc/preremove/python39-devel.sh:/usr/sbin/alternatives --remove python3-config
/usr/bin/python3.9-config
/etc/preremove/python39-pip.sh:/usr/sbin/alternatives --remove pip3
/usr/bin/pip3.9
/etc/preremove/python39-sphinx.sh:/usr/sbin/alternatives --remove sphinx-apidoc
/usr/bin/sphinx-apidoc-3.9
/etc/preremove/python39-sphinx.sh:/usr/sbin/alternatives --remove sphinx-autogen
/usr/bin/sphinx-autogen-3.9
/etc/preremove/python39-sphinx.sh:/usr/sbin/alternatives --remove sphinx-build
/usr/bin/sphinx-build-3.9
/etc/preremove/python39-sphinx.sh:/usr/sbin/alternatives --remove
sphinx-quickstart /usr/bin/sphinx-quickstart-3.9
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple