No module named ‘simplekml’

Solution for No module named ‘simplekml’
is Given Below:

I have tried to run a code that was working normally a few days ago and today it shows that error as can been below.

Now I tried to install simplekml from the terminal, it showed that’s already installed and when I run the code again it gives the same error. Do you have any idea what might be wrong and how to fix this?

Traceback (most recent call last):
  File "C:/Users/alkon/PycharmProjects/KML routes generated by python/kmlroutescript.py", line 2, in <module>
    import simplekml
ModuleNotFoundError: No module named 'simplekml'

You installed simplekml from your terminal, but most probably that interpreter is not used by your PyCharm.

Navigate to Preferences > Project > Python Interpreter. You will see your installed libraries there. There is an add button to add a new library.

You can also write:

import simplekml

In a python file and use PyCharm’s line pop-up suggestions to download the library.


Suggestions: Use one interpreter to avoid such confusions.

Try to install in a new virtual environment use this reference for vitual environment
and then run the file in the new virtual environment.

install virtualenv

python -m virtualenv -h

venvscriptsactivate

pip install simplekml

python kmlroutescript.py