简体   繁体   中英

ModuleNotFoundError: No module named 'citipy' error

I was trying to do a weather api related python program and initially while running the dependencies there was a error that occurred which reads as 'No module named 'citipy' error' .

But i used from citipy import city command initially and even installed citipy using pip install citipy and upgraded it too.

The error still persists. Please help.

It sounds like you're importing the module and then running it with different names.

If you run

from citypy import city

Then all you're actually importing is city, not citypy, and similarly, you call its functions with city, not citypy.

If you want to run something from citypy that isn't in city, you can import it as:

import citypy

If you need more help, paste the code you're using.

I was able to solve it by just changing the kernel. I don't know how kernel affects when your trying to import a module, but it worked for me.

I had initially installed citipy through git bash, but when I ran my code in jupyter notebook it did not run. To solve the problem I had to install citipy through anaconda prompt (which is how I open my jupyter notebook) and I think this is how both the citipy and your code are in the same kernel.

它发生在我身上,我注意到我跳过从 anaconda 提示激活 pythondata

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