I want to clone my existing venv to another PC but simply copy paste is not working. When I copy the venv and paste to the second machine and run
pip list
It only list pip and setup_tools as the installed dependencies. I tried another way to clone the packages. I created a new venv in the second machine and copied all the file of first venv to that new venv with skipping the existing files with the same name in new venv. Now, when I run
pip list
It shows all the dependencies but, when I try to launch the jupyter notebook as
jupyter notebook
It gives the following error.
Fatal error in launcher: Unable to create process using '"f:\path\to\first_venv\on_first_machine\scripts\python.exe" "C:\path\to\new_venv\on_the_second_machine\Scripts\jupyter.exe" notebook': The system cannot find the file specified.
I don't know to make things working. Please help!
Edit
The problem is I don't have internet connection on the second machine. Actually it's a remote machine with some security protocols applied and having no internet connection is part of security ! My bad :'(
You can't copy-paste venvs from one machine to another since scripts in them may refer to system locations. (The same stands for attempting to move venvs within a machine.)
Instead, recreate the environment on the new machine:
pip freeze -l > packages.txt
in the virtualenv.packages.txt
over to the new machine.pip install -r packages.txt
.EDIT: If you don't have internet access on the second machine, you can continue from step 2 with:
pip wheel -w wheels -r packages.txt
in the venv on the first machine. This will download and build *.whl
packages for all the packages you require. Note that this assumes both machines are similar in OS and architecture!pip install *.whl
.