You are not logged in.

#1 2024-04-27 19:58:56

chang-zhao
Member
Registered: 2024-01-21
Posts: 11

Flask etc - Module not found - after Python 3.12 update

With Python 3.12 I get ModuleNotFoundError with various AUR packages.

Trying to run Flask server:

cd /mnt/apps/flask
. ./env/bin/activate
gunicorn 'server:app'

gives

Traceback (most recent call last):
  File "/mnt/apps/flask/env/bin/gunicorn", line 5, in <module>
    from gunicorn.app.wsgiapp import run
ModuleNotFoundError: No module named 'gunicorn'

Trying to update it with pip gives

(env) [flask]$ pip
Traceback (most recent call last):
  File "/mnt/apps/flask/env/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'

Any advice?

Offline

#2 2024-04-27 20:17:18

Fuxino
Member
From: Slovakia
Registered: 2014-09-26
Posts: 187

Re: Flask etc - Module not found - after Python 3.12 update

You need to rebuild all python packages from AUR.


Arch + XMonad

Dotfiles: https://github.com/Fuxino/dotfiles

Online

#3 2024-04-27 22:35:22

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 659

Re: Flask etc - Module not found - after Python 3.12 update

@chang-zhao, your opening sentence says "with various AUR packages" but then your following example has nothing to do with the AUR?

It seems to me that you have built an virtual environment against the Arch system python (in /mnt/apps/flask/env) and since Arch system python updated to 3.12 today then you simply now must rebuild that virtual environment.

So rebuilding AUR packages won't make any difference to this problem, just rebuild that virtual env.

Offline

Board footer

Powered by FluxBB