0

I'm trying to install a really important python package osmnx for python 3.7. Below is what I got. I searched on this for the afternoon and tried updating the setuptools but it didn't work.

Microsoft Windows [Version 10.0.17134.590] (c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\jelly>pip install osmnx Collecting osmnx Using cached https://files.pythonhosted.org/packages/94/1f/88209842ca41ef8b6a547838bb5872ca03b505a1493927fd17a98cd8e38d/osmnx-0.9-py2.py3-none-any.whl Requirement already satisfied: matplotlib>=2.2 in

c:\users\jelly\appdata\roaming\python\python37\site-packages (from osmnx) (3.0.3) Collecting Rtree>=0.8.3 (from osmnx) Using cached https://files.pythonhosted.org/packages/33/0d/0bcb0fdd759570e85697189f675fa462131e5636482f2832288bbe4bb6f7/Rtree-0.8.3-py3-none-any.whl Requirement already satisfied: pandas>=0.23 in d:\program files (x86)\python37-32\lib\site-packages (from osmnx) (0.24.1) Requirement already satisfied: networkx>=2.2 in d:\program files (x86)\python37-32\lib\site-packages (from osmnx) (2.2) Collecting geopandas>=0.4 (from osmnx) Using cached https://files.pythonhosted.org/packages/f0/5d/916b7268ef551fa9647ce12220e9a68006374f1ce5b0ddaf1cd0df2880b7/geopandas-0.4.1-py2.py3-none-any.whl Requirement already satisfied: requests>=2.21 in d:\program files (x86)\python37-32\lib\site-packages (from osmnx) (2.21.0) Collecting Shapely>=1.6 (from osmnx) Using cached https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "C:\Users\jelly\AppData\Local\Temp\pip-install-2g0vnj5r\Shapely\setup.py", line 80, in from shapely._buildcfg import geos_version_string, geos_version, \ File "C:\Users\jelly\AppData\Local\Temp\pip-install-2g0vnj5r\Shapely\shapely_buildcfg.py", line 200, in lgeos = CDLL("geos_c.dll") File "d:\program files (x86)\python37-32\lib\ctypes__init__.py", line 356, in init self._handle = _dlopen(self._name, mode) OSError: [WinError 126] The specified module could not be found

---------------------------------------- 

Command "python setup.py egg_info" failed with error code 1 in C:\Users\jelly\AppData\Local\Temp\pip-install-2g0vnj5r\Shapely\

2 Answers 2

0

Please see the final solution here for any other osmnx users. A million thanks to Professor Boeing. https://github.com/conda-forge/osmnx-feedstock/issues/42

Sign up to request clarification or add additional context in comments.

Comments

0

The OSMnx documentation recommends installing with conda. If you prefer to use pip, you need to make sure you install all the C extension dependencies on your system first (which is really difficult and time consuming on windows; for example the error you're getting says you haven't installed the geos dependency). I recommend using conda to install it like:

conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx

2 Comments

Hi Professor Boeing, thank you so much for helping me with the question. I did the conda installation following your advice. However, another error popped up when I was trying to import osmnx in jupyter notebook. I added the error codes back to my original question.
I cannot edit my original question so I'll just add a new comment here. I opened an issue regarding the problem in Jupyter Notebook (the error codes are the same when I was trying to import osmnx in PyCharm). Here's the issue link: github.com/conda-forge/osmnx-feedstock/issues/42

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.