https://github.com/ci-ke/venv-fix
A python script to fix the python virtual environments (venv) after moved or renamed without reinstalling
https://github.com/ci-ke/venv-fix
python venv-python
Last synced: about 1 month ago
JSON representation
A python script to fix the python virtual environments (venv) after moved or renamed without reinstalling
- Host: GitHub
- URL: https://github.com/ci-ke/venv-fix
- Owner: ci-ke
- Created: 2019-05-08T08:49:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-19T08:32:59.000Z (10 months ago)
- Last Synced: 2025-11-28T12:39:12.801Z (4 months ago)
- Topics: python, venv-python
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# venv-fix
**Only for Windows and virtual environments created by standard library venv (python -m venv)**
After you move or rename a virtual environment (v-env) leading to its path be changed, the activate scripts and executable files in v-env\scripts (or v-env\bin) could no longer work. Howerver, *venvfix* can fix the "path crash" and let v-env return to normal without reinstalling.
## Installation
```pip install venvfix```
## Usage
```venvfix VENV_PYTHON_PATH [-n OLD_VENV_NAME]```
## Example
After you move and rename a v-env from "D:\oldpath\venv1" to "E:\newpath\venv2", you can execute "```venvfix E:\newpath\venv2\scripts\python.exe```", and then venv2 will act normally again, you can activate it, use pip.exe and other executable files as usual.
## Notice
VENV_PYTHON_PATH can be absolute or relative path of the python interpreter executable in v-env.
OLD_VENV_NAME is not required because venvfix can dectect it automatically, but you can specify it if auto detection could not work properly.
---
Tested on python 3.10, 3.12