4daJKong
4daJKong

Reputation: 2045

How to move site-package from folder Python37 to folder Python310?

Recently, in I download and install Python 3.10, then uninstall Python 3.7 in win10.However, when I want to import some modules in script, it shows there is no modules. After checking, I found all modules are still saved in C:\Users\...\AppData\Roaming\Python\Python37 So if I want to use them, just copy/paste them into Python310? Need I change other things, like classpath...

If not, what should I do? download from Internet again?

Upvotes: 0

Views: 919

Answers (1)

James McPherson
James McPherson

Reputation: 2556

Don't copy site site-packages dir from one version of Python to another - at best you'll get undefined behaviour. The appropriate way of getting the modules you want from v3.7 to v3.10 is to run pip list from the v3.7 installation to see what you have installed, then pip freeze to write that to a file, and finally use the v3.10 pip to install from the file that you wrote the list to.

This way you will get the modules built with and for v3.10.

Upvotes: 4

Related Questions