简体   繁体   中英

Importing modules from an earlier version of Python

When I ask for the version of Python it uses with the command !python -V it says that it uses Python 3.6.3 which is installed on my D drive with anaconda. But when I try to run the cells of the program it stops and it says that there are modules missing. All the modules of that program are installed under python 3.6.3.

I have another installed version of python 3.10 on my C drive and when I check sys.executable it says 'C:\\Users\\Gino\\AppData\\Local\\Programs\\Python\\Python310\\python.exe' It seems that it tries to import modules from python 3.10 which are not installed on this version.

How is it possible to import the modules from python 3.6.3? How can I fix this?

containing multiple python version often causes an issue, however to make sure it selects the versions from python 3.6.3 version, make sure you make a virtual env using python 3.6.3, for this, you might have to change the environment variable of python to the python 3.6.3 folder, it should be able to run python 3.6.3 after changing the environment variable.

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