简体   繁体   中英

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 Inte.net again?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM