Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can I copy paste Python 2.7 packages from lib/site-packages from Windows to Ubuntu?

I am moving to Ubuntu 22.04 from Windows 10 and I was wondering if I could skip installing again all the packages I did on my Windows 10 machine on Python 2.7. Is it possible to save the package folders and paste them into the Python installation folder in Ubuntu?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

It depends on what those packages contain. I wouldn’t expect that 100% of packages would work, so if you want to save time (and frustration), then reinstall all packages for Linux, or run Python in a Windows VM or in Wine.

Details:

  • .dll files don’t work on Linux. Linux has .so files (of different format) instead.

  • .pyc and .pyo files work only if the Python version and some compilation flags match exactly. This is unlikely: a random Python version (e.g. 2.7.x) on Windows won’t match a random Python vrsion (e.g. 2.7.y) on Linux.

  • .py files are usually system-independent, most of them will thus work unchanged.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading