Search code examples
pythonanacondaopenstreetmaposmnxpyproj

PyProj issue in working with OSMnx package


I have recently installed the OSMnx package using Anaconda environment (python 3.10.2) based on the installation instruction provided here. Once I try to import the OSMnx package into Python environment, it shows the following notification:

C:\Users\Reza\anaconda3\envs\ox\lib\site-packages\pyproj\__init__.py:91: 
UserWarning: Valid PROJ data directory not found. Either set the path using the 
environmental variable PROJ_LIB or with `pyproj.datadir.set_data_dir`. 
warnings.warn(str(err))

I have tried several solutions suggested on the Internet, but none of them worked for me! Do you have any ideas for resolving this problem?


Solution

  • Since this could be a difficult problem to reproduce, and since you have tried many solutions but none have worked for you, I recommend running OSMnx using Docker, following these simple steps:

    1. Install Docker.
    2. Pull the Docker image of OSMnx: docker pull gboeing/osmnx.
    3. Change the location to your work directory: cd path/to/workdir.
    4. Go to the "Usage" section of this page, and depending on your operating system and the way you want to run OSMnx, choose a command and run it.