force install package in virtualenv
Veröffentlicht:
Aleksandar Stajić
Aktualisiert am: 17. Mai 2023 um 12:53
Activating virtual environment:
- source venv/bin/activate on Unix/Linux-based systems
- venv\Scripts\activate on Windows
Forcing reinstall of the packages:
- Upgrade can be done by adding: --upgrade or -U
- Forcing reinstall of the packages can be done by adding: --force-reinstall
In your case (once the environment is activated):
python -m pip install -U --force-reinstall pack setuptools Django
- Deactivate and delete the old virtual environment
- Create new environment using python -m virtualenv venv for python 2 or python -m venv venv for python 3.x. That's the only point where you might want to use for example python3 or some absolute path instead. Later use the code as is.
- Activating the virtual environment source venv/bin/activate
- python -m pip install -U pip If you have issue with ImportError: No module named _internal than probably you are using an old version of pip. Do this: python -m pip install --upgrade pip
- python -m pip install -U --force-reinstall -r requirements.txt-U --force-reinstall is a bit of an overkill in case of fresh environment, but it will do no harm
- Go to the place where your manage.py is located and start the server using python manage.py runserver
Related Articles

Drag-and-Drop mit JavaScript: Eine tiefgehende Analyse der nativen API für interaktive Menüstrukturen
Die Implementierung von Drag-and-Drop-Funktionalität ist entscheidend für moderne, interaktive Benutzeroberflächen. Dieser Artikel beleuchtet die technische Umsetzung mithilfe der nativen HTML5 Drag-and-Drop API in Vanilla JavaScript und TypeScript, fokussiert auf die Erstellung dynamischer Menüstrukturen.

Boosting Productivity with ERP Systems: A Case Study on Relational Databases
