7👍
As far as I can tell, the only purpose of a venv is to manage dependencies.
You should be safe to just deactivate
the venv, delete it, and create a new one using virtualenv venv; source venv/bin/activate
.
This will give you a fresh start.
3👍
This question is old, but it got bumped to the front page, so it’s hard to discern which versions of pip and virtualenv you are using.
There are a few things we can do to straighten this, nonetheless.
- Exit all virtualenvs, and check your
$PYTHONPATH
. Make sure it’s empty; else rununset PYTHONPATH
. - Create a fresh virtualenv at
myenv
usingvirtualenv --no-site-packages myenv
. - Activate
myenv
and check your$PYTHONPATH
again. It should only havemyenv
. - Run
pip
with an absolute path, like somyenv/bin/pip freeze
. - If
pip
is not available inside your virtualenv, you may have to install it manually.
Related: virtualenv –no-site-packages and pip still finding global packages?
Finally, start a python shell using myenv/bin/python
, then run:
>>> import sys
>>> sys.path
If pip
can find wsgiref
, then wsgiref
must be in one of the paths in sys.path
. Use that clue!
- What's equivalent to Django's auto_now, auto_now_add in SQLAlchemy?
- Celery workers unable to connect to redis on docker instances
- What are the default URLs for Django's User Authentication system?
- How do I tell Django to save my test database?
2👍
You can just delete your .venv file to remove all dependencies and then run python3 -m venv .venv
for a fresh virtual environment.
- Django m2m form save " through " table
- Django & the "TemplateDoesNotExist" error
- Redirect request to admin interface