<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.manjaro.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=J77h</id>
	<title>Manjaro - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.manjaro.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=J77h"/>
	<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Special:Contributions/J77h"/>
	<updated>2026-07-09T08:45:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Python_upgrade&amp;diff=35483</id>
		<title>Python upgrade</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Python_upgrade&amp;diff=35483"/>
		<updated>2022-05-22T01:10:21Z</updated>

		<summary type="html">&lt;p&gt;J77h: Replaced content with &amp;quot;Moderator, please delete this page. The article was written here instead: https://forum.manjaro.org/t/when-python-has-its-annual-update-how-to-re-install-your-own-packages...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Moderator, please delete this page.&lt;br /&gt;
The article was written here instead:&lt;br /&gt;
https://forum.manjaro.org/t/when-python-has-its-annual-update-how-to-re-install-your-own-packages/97372&lt;/div&gt;</summary>
		<author><name>J77h</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Python_upgrade&amp;diff=29768</id>
		<title>Python upgrade</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Python_upgrade&amp;diff=29768"/>
		<updated>2021-12-25T12:23:50Z</updated>

		<summary type="html">&lt;p&gt;J77h: Re-installing packages after a Python version upgrade&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Python upgrade==&lt;br /&gt;
&lt;br /&gt;
===Re-installing your packages after a Python version upgrade===&lt;br /&gt;
&lt;br /&gt;
====Background====&lt;br /&gt;
&lt;br /&gt;
Python puts out a (minor) version upgrade every year, timed so that it can be included in that year&amp;#039;s release of Fedora. After that, Arch Linux, and then Manjaro, upgrade Python in their repositories as soon as they practically can.&lt;br /&gt;
&lt;br /&gt;
If you have installed extra Python packages from the Manjaro repositories, they will be automatically upgraded along with your Manjaro system&amp;#039;s Python (generally referred to as &amp;quot;system python&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
But if you have installed Python packages from elsewhere, they will not be upgraded automatically. This page is about upgrading packages that you installed from the AUR and/or from PyPI.&lt;br /&gt;
&lt;br /&gt;
Packages that you installed are in directories named &amp;#039;site-packages&amp;#039;.&lt;br /&gt;
* For system python at  /usr/lib/python3.9/site-packages/&lt;br /&gt;
* In your user-space at  ~/.local/lib/python3.9/site-packages/&lt;br /&gt;
* If you use virtual environments, each of those has a &amp;#039;site-packages&amp;#039; directory.&lt;br /&gt;
&lt;br /&gt;
==== Actions ====&lt;br /&gt;
&lt;br /&gt;
===== pip =====&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Before&amp;#039;&amp;#039;&amp;#039; you upgrade system Python, get some info from pip, as you won&amp;#039;t be able to get it after the upgrade.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;pip freeze&amp;#039; produces a list of packages that were installed with pip, which you can use later to install them again for the new version of python.&lt;br /&gt;
&lt;br /&gt;
This gets packages installed by pip in system python:&lt;br /&gt;
 sudo pip freeze &amp;gt; pip_list_sudo.txt&lt;br /&gt;
&lt;br /&gt;
This gets packages installed by pip in your user space:&lt;br /&gt;
 pip freeze --user &amp;gt; pip_list_user.txt&lt;br /&gt;
&lt;br /&gt;
And this is a template for getting them from a virtual environment:&lt;br /&gt;
 /path/to/&amp;lt;venv_name&amp;gt;/python -m pip freeze -l &amp;gt; pip_list_&amp;lt;venv_name&amp;gt;.txt&lt;br /&gt;
&lt;br /&gt;
After the Python upgrade, the usual advice is to do something like&lt;br /&gt;
 sudo pip install -r pip_list_sudo.txt&lt;br /&gt;
but don&amp;#039;t do that, because:&lt;br /&gt;
* it&amp;#039;s best not to install pip packages in system python;&lt;br /&gt;
* you might prefer not to re-install all of them;&lt;br /&gt;
* the list from &amp;#039;pip freeze&amp;#039; includes version numbers, and you might want to manually install afresh to get current versions.&lt;br /&gt;
&lt;br /&gt;
So a good course of action would be something like:&lt;br /&gt;
* edit the lists and remove whatever you don&amp;#039;t want to re-install;&lt;br /&gt;
* for each package you want, check if it&amp;#039;s available from the AUR, or the Manjaro repositories, and if it is, move it to another list, for installation from the other source;&lt;br /&gt;
* install each pip package manually, without a version number, without sudo, with &amp;#039;--user&amp;#039;:&lt;br /&gt;
 pip install &amp;lt;package_name&amp;gt; --user&lt;br /&gt;
&lt;br /&gt;
===== AUR =====&lt;br /&gt;
&lt;br /&gt;
You cannot prepare for this before the upgrade.&lt;br /&gt;
&lt;br /&gt;
To get a list of packages to re-install, you will use&lt;br /&gt;
 pacman -Qoq /usr/lib/python3.9&lt;br /&gt;
If you run this before the upgrade, it will list many packages that pacman will soon re-install for python 3.10&lt;br /&gt;
&lt;br /&gt;
When you run it after the upgrade, it will get only the packages that did not get updated to 3.10, which will be those that you installed from the AUR.&lt;br /&gt;
&lt;br /&gt;
Rebuilding of AUR packages can be done automatically,&lt;br /&gt;
with pikaur&lt;br /&gt;
 pikaur -S $(pacman -Qoq /usr/lib/python3.9) --rebuild&lt;br /&gt;
or with yay&lt;br /&gt;
 yay -S $(pacman -Qoq /usr/lib/python3.9) --answerclean All&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s possible that an AUR package has not been updated to Python 3.10 yet.&lt;br /&gt;
If so, the above commands might fail partway through,&lt;br /&gt;
and you&amp;#039;ll have to rebuild the rest of the packages one or a few at a time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
&lt;br /&gt;
[https://pip.pypa.io/en/stable/cli/ pip commands]&lt;/div&gt;</summary>
		<author><name>J77h</name></author>
	</entry>
</feed>