How To Use The Same Python Virtualenv On Both Windows And Linux
I started using Windows and Linux recently on the same PC - they are installed to two different partitions, and a third partition contains common data and archives. virtualenvs cre
Solution 1:
Short answer, NO. But you can share the venv build scripts.
pip freeze
all libraries to arequirements.txt
file.pip freeze > requirements.txt
Create the venv on each OS:
python -m venv env source env/bin/activate pip install -r requirements.txt # Install all the libs.
There are several reasons why venvs cannot be shared across OSes:
- Some packages contains C extensions, and the OS' .dlls are not compatible with each other.
- venvs contain scripts with hardcoded paths. Windows and Linux paths are different.
Post a Comment for "How To Use The Same Python Virtualenv On Both Windows And Linux"