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 created from Windows are made with folder "Scripts", and the counterpart in Linux is the folder "bin".
The problem here is that the files in those folders are not compatible for both OSes. For example, the "activate" contained in bin (created in Linux) don't run in Windows, and by the other hand, the "activate" in Scripts (created in Windows) cannot be executed on Linux.
Is there a way to use the same virtualenv on both OSes?
Don't share virtual environments between projects One, it's all too likely that one of the projects in question will suddenly have requirements that break the other project. The whole point of virtual environments is to isolate each project from other projects and their quirks.
If you need the additional features that virtualenv provides over venv, then you obviously should use virtualenv. If you're satisfied with your current setup with venv, then there's no reason to choose virtualenv.
Short answer, NO. But you can share the venv build scripts.
pip freeze
all libraries to a requirements.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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With