问题
I am trying to install osmnx using the command
python -m pip install osmnx
but it gives the following error:
'Command "python setup.py egg_info" failed with error code 1 in C:\Users\myname\AppData\Local\Temp\pip-install-o3ha6gld\Shapely\'
回答1:
For some reason you need to download the wheel for that specific module and install separately:
Install Shapely: OSError: [WinError 126] The specified module could not be found
Then OSMnx will continue to install normally
回答2:
Installation
You can install OSMnx with conda:
conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx
Alternatively, you can run OSMnx + Jupyter directly from the official docker container, or you can install OSMnx via pip if you already have all of its dependencies installed and tested on your system. Note: pip installation is nontrivial. If you don’t know exactly what you’re doing, just use conda as described above.
To upgrade OSMnx to a newer release, just remove the conda environment you created and then create a new one again following the steps above. Don’t just run conda update or you could get package conflicts.
回答3:
OSMnx installation instructions are provided in its documentation: https://osmnx.readthedocs.io/en/stable/
conda installation is strongly recommended to avoid issues:
conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx
来源:https://stackoverflow.com/questions/51365856/pip-install-osmnx-giving-error-code-1