0

My virtual-environment worked perfectly until I upgraded to Ubuntu 22.04 LTS. But when I upgraded the virtual environment is not working any longer. It gives this message:

 ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

I did activate it as I used to do before, with

workon myenvironment

and I tried also with

 source myenvironment/bin/activate

but none of them seems to work. I get always the same message.

I deleted the environment and created a new one but I still get the same message.

And Django is also installed, so the only missing thing I haven't check is the PHYTHONPATH environment variable, but I do not know if I could change it somehow and even if I would know it, I wouldn't know what should it look like.

What should I do to fix this? Do I have to do anything special after upgrading to Ubuntu 22.04 LTS to keep my virtualenvironments working?

1 Answer 1

1

Even when on ubuntu 18 before running the server with:

     python3 manage.py runserver 

I had to activate virtualenvironment with:

    workon myenvironment

With Ubuntu 22.04 it seems it is not necessary and runserver will work without activating virtualenvironment. I don't understand why, but it works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.