jgc234 / optiburb

Cycling route generator for optimum "burbing" route.
MIT License
31 stars 7 forks source link

Failed to install on MacOS #7

Closed mlaich closed 3 years ago

mlaich commented 3 years ago

I get the following error when installing via Terminal. Either there's an issue with my python install or Rtree and oxmnx

robs-mac-pro:optiburb mlaich$ pip3 install -r requirements.txt

Requirement already satisfied: shapely in /usr/local/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (1.7.0)
Requirement already satisfied: gpxpy in /usr/local/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (1.4.2)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (1.19.1)
Requirement already satisfied: networkx in /usr/local/lib/python3.8/site-packages (from -r requirements.txt (line 4)) (2.4)
Requirement already satisfied: pandas in /usr/local/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (1.1.0)
Requirement already satisfied: geopandas in /usr/local/lib/python3.8/site-packages (from -r requirements.txt (line 6)) (0.8.1)
Collecting osmnx
  Using cached osmnx-0.15.1-py2.py3-none-any.whl (84 kB)
Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.8/site-packages (from networkx->-r requirements.txt (line 4)) (4.4.2)
Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.8/site-packages (from pandas->-r requirements.txt (line 5)) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.8/site-packages (from pandas->-r requirements.txt (line 5)) (2020.1)
Requirement already satisfied: fiona in /usr/local/lib/python3.8/site-packages (from geopandas->-r requirements.txt (line 6)) (1.8.13.post1)
Requirement already satisfied: pyproj>=2.2.0 in /usr/local/lib/python3.8/site-packages (from geopandas->-r requirements.txt (line 6)) (2.6.1.post1)
Collecting descartes>=1.1
  Using cached descartes-1.1.0-py3-none-any.whl (5.8 kB)
Collecting requests>=2.23
  Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
Collecting Rtree>=0.9
  Using cached Rtree-0.9.4.tar.gz (62 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.8/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/hxwg1sp12yqgc10bd7hdvlvw0000gn/T/pip-install-fxwmeoh_/Rtree/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/hxwg1sp12yqgc10bd7hdvlvw0000gn/T/pip-install-fxwmeoh_/Rtree/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 /private/var/folders/j0/hxwg1sp12yqgc10bd7hdvlvw0000gn/T/pip-pip-egg-info-t8kncwja
         cwd: /private/var/folders/j0/hxwg1sp12yqgc10bd7hdvlvw0000gn/T/pip-install-fxwmeoh_/Rtree/
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/j0/hxwg1sp12yqgc10bd7hdvlvw0000gn/T/pip-install-fxwmeoh_/Rtree/setup.py", line 3, in <module>
        import rtree
      File "/private/var/folders/j0/hxwg1sp12yqgc10bd7hdvlvw0000gn/T/pip-install-fxwmeoh_/Rtree/rtree/__init__.py", line 1, in <module>
        from .index import Rtree
      File "/private/var/folders/j0/hxwg1sp12yqgc10bd7hdvlvw0000gn/T/pip-install-fxwmeoh_/Rtree/rtree/index.py", line 6, in <module>
        from . import core
      File "/private/var/folders/j0/hxwg1sp12yqgc10bd7hdvlvw0000gn/T/pip-install-fxwmeoh_/Rtree/rtree/core.py", line 143, in <module>
        rt.Error_GetLastErrorNum.restype = ctypes.c_int
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
        func = self.__getitem__(name)
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
        func = self._FuncPtr((name_or_ordinal, self))
    AttributeError: dlsym(RTLD_DEFAULT, Error_GetLastErrorNum): symbol not found
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
jgc234 commented 3 years ago

Google tells me you're missing libspatialindex. See if you can instal that with whatever package manager you're using (eg brew)

mlaich commented 3 years ago

I tried that.

robs-mac-pro:optiburb mlaich$ brew install libspatialindex
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
nanorc
==> Updated Formulae
Updated 222 formulae.

Error: No available formula with the name "libspatialindex" 
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
jgc234 commented 3 years ago

On brew the name of the package appears to be spatialindex

mlaich commented 3 years ago

Thank you, worked a treat.