0

I did a release upgrade, followed by apt upgrade no problem, everything went smooth. Except, now virtual environments don't work at all. I have various one set up for various django projects I'm working on. When I try to run django manage.py runserver I get:

ModuleNotFoundError: No module named 'django'

OK, weird, so I'll try to install django again

ModuleNotFoundError: No module named 'pip'

And I cannot run pip outside the virtual environment, as explained here.

So what is the practice now? Do I need to recreate my virtual environments?

Update:
If I create a new environment (mkvirtualenv new_env) pip works fine.

Edit: Sorry, I forgot to add. I've updated from mainstream Ubuntu 22.10 to mainstream Ubuntu 23.04

Artur Meinild
  • 21,605
  • 21
  • 56
  • 89
Yotam
  • 1,428
  • 3
  • 19
  • 24
  • Upgrade from what to what? – David Apr 27 '23 at 08:09
  • Sorry, I took that for granted, and I shouldn't have. I've updated from mainstream Ubuntu 23.10 to mainstream Ubuntu 23.04 I added that to my question. – Yotam Apr 28 '23 at 12:47
  • You might need to run `pip3 install -U django` ... etc. ... Please see for example: [python3.8 and pip after upgrading to 22.04.2](https://askubuntu.com/q/1456669) – Raffa Apr 28 '23 at 12:59
  • 23.10 does not even exist yet. Will not be out till Oct. that makes this off topic. – David Apr 28 '23 at 13:27
  • Sorry... it is Ubuntu 22.10, of course. – Yotam May 05 '23 at 18:57

1 Answers1

0

I've tried @Raffa's solution but then I see that pip is not installed. Following that hint I found in another thread how to fix that:

python -m ensurepip --default-pip

After that I needed to install the packages again though.

Yotam
  • 1,428
  • 3
  • 19
  • 24