How to downgrade single python package?

Hello, my system updated the python library SQLAlchemy to python-sqlalchemy 1.4.39-1, which is broken for anyone using sqlmodel library. The solution pointed by everyone is downgrading to SQLAlchemy <= 1.4.35, but I am very insecure to it by myself and break my system, I would appreciate any help on this.

I found this python-sqlalchemy archive, if this helps, I would like to install 1.4.30, which was the one I had been using for a long time, but how do I install it? And how can I forbid my system to upgrade python-sqlalchemy again on the next system update?

Thanks for any help

First, create a new project folder, then use venv or virtualenv so that the new project folder will be isolated from all of your other projects.

Activate the new project venv. From within the new project folder:
source bin/activate

Then install any/all modules needed:
pip install python-sqlalchemy==1.4.35

Or whichever version you require. Then test your scripts.

Don't forget to activate the venv, otherwise you will be using the global python install and modules.

Once you are done with the venv, type:

Hope this helps.


pacman -U $URL would do it.

Edit pacman.conf and add it to your IgnorePkg list.

But, using a venv is the much better approach.


pacman -U $URL would do it.

I downloaded python-sqlalchemy-1.4.30-1-x86_64.pkg.tar.zst from this list and then executed

pamac remove python-sqlalchemy
sudo pacman -U /home/user/Downloads/python-sqlalchemy-1.4.30-1-x86_64.pkg.tar.zst

But when I do pamac list I still see only python-sqlalchemy 1.4.39-1 on the list, not sure what's happening

Edit pacman.conf and add it to your IgnorePkg list.

Do I add it as IgnorePkg = python-sqlalchemy or IgnorePkg = "python-sqalchemy", I mean, with or without quotes? I didn't find it here


Although it is saying python-sqlalchemy 1.4.39-1 on pamac list, I tried it here on python sqlalchemy.__version__ and it is saying:

>>> sqlalchemy.__version__

Thanks!!!! It is working

1 Like

I will need to install poetry and install dozens of packages before I can use the virtualenv... anyway, I will do it eventually! Thanks for your help

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.