简体   繁体   中英

Cannot import any python modules

enter image description here

I cant seem to import any modules using python and I have no clue why, I have tried deleting the pythons on my computer I can find and I have tried to "conda deactivate" in my terminal but really have no clue what to do now.

I have also tried "pip list" to see If I have the modules installed but the modules have already been installed

enter image description here

I do not know the specifics of your situation, but you referenced 'conda deactivate'. This implies that you might be in a virtual environment.

If you have separate environments set up, you can select which one you installed the packages on by clicking the 'Python 3.10 64-bit' in the left-hand corner of your IDE and then adding the path to your python.exe in the popup. Then your pip packages will be available.

In anaconda, you can see which environment you are in like this: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment .

For CPython you can refer to: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment .

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