问题
I'm not able to install osmnx in jupyter notebook. The following problem is occurring with shapely version 1.6
I could install shapely 1.4 but osmnx needs 1.6 version
The command I used is !pip install osmnx
Collecting Shapely>=1.6 (from osmnx) Using cached https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\shrinath\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Shrinath\\AppData\\Local\\Temp\\pip-install-3_oopeoz\\Shapely\\setup.py'"'"'; __file__='"'"'C:\\Users\\Shrinath\\AppData\\Local\\Temp\\pip-install-3_oopeoz\\Shapely\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\Shrinath\AppData\Local\Temp\pip-install-3_oopeoz\Shapely\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Shrinath\AppData\Local\Temp\pip-install-3_oopeoz\Shapely\setup.py", line 80, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\Shrinath\AppData\Local\Temp\pip-install-3_oopeoz\Shapely\shapely\_buildcfg.py", line 200, in <module>
lgeos = CDLL("geos_c.dll")
File "c:\users\shrinath\anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
回答1:
Did you follow the installation instructions in the OSMnx documentation? It recommends using pip only if you already have all the OSMnx dependencies already installed on your system (because some of them are tricky). From the link above: "If you have any trouble with the installation, try installing OSMnx in a new, clean conda environment using conda-forge and strict channel priority." This should fix it for you.
来源:https://stackoverflow.com/questions/57535819/why-im-getting-this-error-what-can-be-done-to-install-osmnx-on-windows-10