Modulenotfounderror: No Module Named 'Osmnx'

I have a github repo containing two files in the same repository. guimain.py and mapdraw.py. We're basically using tkinter and some other packages to make a GUI and for this we need maps of different places.

mapdraw.py imports osmnx just as import osmnx as ox and guimain utilizes an object created there. It imports it with from mapdraw import drone_map.

I'm running in git bash on Windows 10, I'm using python 3.7.3 and here is my package list that I mostly downloaded from or I used pip install when there wasn't a problem with the pip installation:

Package         Version
--------------- ----------
attrs           19.3.0
certifi         2020.4.5.1
chardet         3.0.4
click           7.1.1
click-plugins   1.1.1
cligj           0.5.0
cycler          0.10.0
decorator       4.4.2
descartes       1.1.0
Fiona           1.8.13
GDAL            3.0.4
geopandas       0.7.0
idna            2.9
kiwisolver      1.2.0
matplotlib      3.2.1
munch           2.5.0
networkx        2.4
numpy           1.18.2
osmnx           0.11.4
panda           0.3.1
pandas          1.0.3
pip             20.0.2
pyparsing       2.4.7
pyproj          2.6.0
python-dateutil 2.8.1
pytz            2019.3
requests        2.23.0
Rtree           0.9.4
Shapely         1.7.0
six             1.14.0
urllib3         1.25.8
wheel           0.34.2 

The error I'm getting is

Traceback (most recent call last):
  File "guimain.py", line 11, in <module>
    from mapdraw import drone_map
  File "C:\Users\Alexa\OneDrive\Documents\Universitet\DD1393\Kod\GUI\MVK-Saab\GraphicalInterface\mapdraw.py", line 10, in <module>
    import osmnx as ox
ModuleNotFoundError: No module named 'osmnx'

Does anyone know what the problem might be?

4

1 Answer

For the modules installed via pip, you need to check that they were installed using the version of pip associated with the version of python (or py) used to run your code. You can find the installed modules using:

python -m pip freeze

If this doesn't match your output above, then you will need to install the modules again for the version of python that you are using. You can do this using:

python -m pip install MODULE_NAME

For the modules installed using wheel packages, you need to make sure to install the binary packages for your specific subversion of python, which you can check using python --version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest