0

I have written a Python project in Windows 11 that runs in the virtual environment I built in Win, and everything is running normally in Win.

Now I have copied the entire Python project and the virtual environment I built in Win 11 to Ubuntu 20.04. Also, I have made changes to the necessary path names.

However, I found that although I can launch this virtual environment in Ubuntu, when running the project, I was prompted that I did not install the matplotlib module, but in fact this module was installed in the virtual environment.

I don't know, is it because the PHP version I installed in Win 11 is 3.10, while the default PHP version installed in Ubuntu 20.04 is 3.8? Still, even if I upgrade the PHP version in Ubuntu to 3.10, it won't work? It is not possible to copy the virtual environment built in Win directly to Ubuntu, and it is necessary to rebuild the virtual environment in Ubuntu?

1 Answers1

0

Yes you can but sometimes some error arises(due to diff os), so a better way is to first create a requirements.txt file which contains you pip freeze (lists all the installed packages) then carry that file with you in the ubuntu then there create a new venv, activate it and install your requirements.txt file. It will run fine.