OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
364 stars 111 forks source link

Numpy seems to not be available (AKA libopenblasp-r0.3.6.dylib not found) #1245

Closed luispuerto closed 4 years ago

luispuerto commented 5 years ago

Please answers the following

I've...

Describe the bug

When opening QGIS this window show ups:

Screen Shot 2019-09-05 at 10 44 39
Couldn't load plugin 'processing' 

ImportError: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the multiarray numpy extension module failed.  Most likely you are trying to import a failed build of numpy. Here is how to proceed: - If you're working with a numpy git repository, try `git clean -xdf`   (removes all files not under version control) and rebuild numpy. - If you are simply trying to use the numpy version that you have installed:   your installation is broken - please reinstall numpy. - If you have already reinstalled and that did not fix the problem, then:   1. Check that you are using the Python you expect (you're using /usr/local/Cellar/osgeo-qgis/3.8.0_1/QGIS.app/Contents/MacOS/QGIS),     and that you have no directories in your PATH or PYTHONPATH that can     interfere with the Python and numpy versions you're trying to use.   2. If (1) looks fine, you can open a new issue at     https://github.com/numpy/numpy/issues.  Please include details on:     - how you installed Python     - how you installed numpy     - your operating system     - whether or not you have multiple versions of Python installed     - if you built from source, your compiler versions and ideally a build log     Note: this error has many possible causes, so please don't comment on     an existing issue about this - open a new one instead. Original error was: dlopen(/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.3.6.dylib   Referenced from: /usr/local/Cellar/osgeo-qgis-res/3.8.0/libexec/vendor/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so   Reason: image not found 
Traceback (most recent call last):
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/numpy/core/__init__.py", line 40, in 
    from . import multiarray
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/numpy/core/multiarray.py", line 12, in 
    from . import overrides
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/numpy/core/overrides.py", line 6, in 
    from numpy.core._multiarray_umath import (
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: dlopen(/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.3.6.dylib
  Referenced from: /usr/local/Cellar/osgeo-qgis-res/3.8.0/libexec/vendor/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so
  Reason: image not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 312, in loadPlugin
    __import__(packageName)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/__init__.py", line 25, in 
    from processing.tools.general import *              # NOQA
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/tools/general.py", line 32, in 
    from processing.core.Processing import Processing
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/core/Processing.py", line 54, in 
    from processing.algs.qgis.QgisAlgorithmProvider import QgisAlgorithmProvider  # NOQA
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py", line 76, in 
    from .HypsometricCurves import HypsometricCurves
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/qgis/HypsometricCurves.py", line 25, in 
    import numpy
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/numpy/__init__.py", line 142, in 
    from . import core
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/numpy/core/__init__.py", line 71, in 
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
  your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
  1. Check that you are using the Python you expect (you're using /usr/local/Cellar/osgeo-qgis/3.8.0_1/QGIS.app/Contents/MacOS/QGIS),
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy versions you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

     Note: this error has many possible causes, so please don't comment on
     an existing issue about this - open a new one instead.

Original error was: dlopen(/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.3.6.dylib
  Referenced from: /usr/local/Cellar/osgeo-qgis-res/3.8.0/libexec/vendor/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so
  Reason: image not found

Python version: 3.7.4 (default, Jul  9 2019, 18:13:23) [Clang 10.0.1 (clang-1001.0.46.4)] 
QGIS version: 3.8.0-Zanzibar Zanzibar, exported 

Python Path:
/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python
/Users/lpuerto/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/lpuerto/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/plugins
/usr/local/opt/osgeo-gdal-python/lib/python3.7/site-packages
/usr/local/opt/osgeo-qgis/QGIS.app/Contents/Resources/python
/usr/local/opt/osgeo-qgis/lib/python3.7/site-packages
/usr/local/opt/lib/python3.7/site-packages
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python37.zip
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload
/Users/lpuerto/Library/Python/3.7/lib/python/site-packages
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/geos
/usr/local/Cellar/osgeo-matplotlib/3.1.1/libexec/lib/python3.7/site-packages
/usr/local/Cellar/numpy/1.16.4_1/libexec/nose/lib/python3.7/site-packages
/usr/local/Cellar/protobuf/3.9.1_1/libexec/lib/python3.7/site-packages
/Users/lpuerto/Library/Application Support/QGIS/QGIS3/profiles/default/python
/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/../Resources/python/IPython/extensions

To Reproduce

Just open QGIS, but perhaps it's just me.

luispuerto commented 5 years ago

@fjperini perhaps it's just me that I've updated something or something like that, but perhaps it's time to update.

I'm glad to help, but I really don't know where to start.

luispuerto commented 5 years ago

The problem it's due to update of openblas and probably the issue will go away if I build again qgis locally.

A easy workaround to the issue is:

$ ln -s /usr/local/opt/openblas/lib/libopenblasp-r0.3.7.dylib /usr/local/opt/openblas/lib/libopenblasp-r0.3.6.dylib

I really don't know why they don't point to the versionless symbolic links that are available /usr/local/opt/openblas/lib/libopenblas.dylib so we'll avoid this stupid problems.

Is this due to our formula or it's upstream?

luispuerto commented 5 years ago

I see here that on osgeo-qgis-res formula el link es contra el version-less symbolic link. So I guess an expansion happens on the compilation or something?

alazarolop commented 5 years ago

I run in a similar issue last week reinstalling QGIS. I poured osgeo-qgis formula, but then I needed to rebuild from source osgeo-qgis-res. I also think it's related to upgraded formulas that hasn't been implemented in the bottle.

I'm sure @fjperini will solve it straight, but it the mean time you can try to rebuild osgeo-qgis-res:

brew reinstall --build-from-source osgeo-qgis-res

I think another issue can be related with this too (https://github.com/OSGeo/homebrew-osgeo4mac/issues/1244#issue-489883661)

jasonrwang commented 5 years ago

I had the same issue and needed to run brew reinstall https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/a0eba645a8b51153c81e514437c42ef0b98b8830/Formula/osgeo-gdal-python.rb (osgeo-gdal-python 2.4.1_1) as well to get 'processing' to open properly. Rebuilding from source didn't work, but that's likely more of my fault for running Catalina.

rendzina commented 4 years ago

The problem it's due to update of openblas and probably the issue will go away if I build again qgis locally.

A easy workaround to the issue is:

$ ln -s /usr/local/opt/openblas/lib/libopenblasp-r0.3.7.dylib /usr/local/opt/openblas/lib/libopenblasp-r0.3.6.dylib

I really don't know why they don't point to the versionless symbolic links that are available /usr/local/opt/openblas/lib/libopenblas.dylib so we'll avoid this stupid problems.

Is this due to our formula or it's upstream?

Thanks @luispuerto, your 'ln' link suggestion here certainly solved the initial problem @fjperini had reported, and which I also experienced. It also fixed the previously missing 'Vector' menu tools 'Geoprocessing Tools', 'Geometry Tools', 'Analysis Tools', 'Data Management Tools', and 'Research Tools'. These options now appear and function correctly where they were previously missing. Also the Processing menu has now appeared and works correctly.

songololo commented 4 years ago

@jasonrwang do you know if the above issues affect QGIS formula installation on Catalina?

New issue created to track Catalina stability for QGIS formula: https://github.com/OSGeo/homebrew-osgeo4mac/issues/1268

rendzina commented 4 years ago

I have upgraded to Catalina with a previously working QGIS Zanzibar 3.8. It still works fine after upgrade.

From: shongololo notifications@github.com Reply to: OSGeo/homebrew-osgeo4mac reply@reply.github.com Date: Friday, 25 October 2019 at 10:26 To: OSGeo/homebrew-osgeo4mac homebrew-osgeo4mac@noreply.github.com Cc: Stephen Hallett s.hallett@cranfield.ac.uk, Comment comment@noreply.github.com Subject: Re: [OSGeo/homebrew-osgeo4mac] Numpy seems to not be available (AKA libopenblasp-r0.3.6.dylib not found) (#1245)

@jasonrwanghttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_jasonrwang&d=DwMCaQ&c=KveGjKEXiH4bMFgGs-LRbCbewnnyGW6-rJ0JK7ViA_E&r=x_69-FlyLj8N7N87W4RRsWqnkjze4yUbpAgwmbZjWY4&m=VwiXLOL6SIznbiZDfJ9KQkaiDxEYImFuzTquDF04ss8&s=xxxWnMb3aKpHLot58qDQDjiPEO3CkajBiNPrhgbMxSc&e= do you know if the above issues affect QGIS formula installation on Catalina?

New issue created to track Catalina stability for QGIS formula:

1268https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OSGeo_homebrew-2Dosgeo4mac_issues_1268&d=DwMCaQ&c=KveGjKEXiH4bMFgGs-LRbCbewnnyGW6-rJ0JK7ViA_E&r=x_69-FlyLj8N7N87W4RRsWqnkjze4yUbpAgwmbZjWY4&m=VwiXLOL6SIznbiZDfJ9KQkaiDxEYImFuzTquDF04ss8&s=HtMHTOoObjKFI53zLbu7jyo4VR_dqYshdkBmSHTcAR8&e=

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OSGeo_homebrew-2Dosgeo4mac_issues_1245-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DABN5PAYAYJFENJX2VIX7COTQQK3UVA5CNFSM4IUAWCQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECHYXZY-23issuecomment-2D546278375&d=DwMCaQ&c=KveGjKEXiH4bMFgGs-LRbCbewnnyGW6-rJ0JK7ViA_E&r=x_69-FlyLj8N7N87W4RRsWqnkjze4yUbpAgwmbZjWY4&m=VwiXLOL6SIznbiZDfJ9KQkaiDxEYImFuzTquDF04ss8&s=2FjwEg-TJDZb9ZEjWRPxyWDaARiLZL22KoWMtQ8Whek&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ABN5PA5I4SO2SJXS2BCJASLQQK3UVANCNFSM4IUAWCQA&d=DwMCaQ&c=KveGjKEXiH4bMFgGs-LRbCbewnnyGW6-rJ0JK7ViA_E&r=x_69-FlyLj8N7N87W4RRsWqnkjze4yUbpAgwmbZjWY4&m=VwiXLOL6SIznbiZDfJ9KQkaiDxEYImFuzTquDF04ss8&s=Z9NEQwHk2CuNJ9uSkredMGMvTqZW2BlM-7UjJ3IAqJM&e=.

jasonrwang commented 4 years ago

@songololo @rendzina Yes, though I no longer think it is because of Catalina. See here: https://github.com/OSGeo/homebrew-osgeo4mac/issues/1261#issuecomment-540098248

jasonrwang commented 4 years ago

On another note, this (hack-y) "fix" above doesn't solve all the underlying issues. I can't get Raster > Miscellaneous > Merge to work because of another similar issue, and soft-linking doesn't fix it. Luckily, I was able to use Build Virtual Raster instead to achieve the same goal.

Short log:

Reason: Incompatible library version: _gdal.cpython-37m-darwin.so requires version 27.0.0 or later, but libgdal.26.dylib provides version 26.0.0

Full (relevant) log:

2019-10-25T12:39:03 INFO GDAL execution console output Traceback (most recent call last): File "/usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/bin/gdal_merge.py", line 38, in from osgeo import gdal File "/usr/local/opt/osgeo-gdal-python/lib/python3.7/site-packages/osgeo/init.py", line 21, in _gdal = swig_import_helper() File "/usr/local/opt/osgeo-gdal-python/lib/python3.7/site-packages/osgeo/init.py", line 17, in swig_import_helper _mod = imp.load_module('_gdal', fp, pathname, description) File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py", line 342, in load_dynamic return _load(spec) ImportError: dlopen(/usr/local/opt/osgeo-gdal-python/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/osgeo-gdal/lib/libgdal.26.dylib Referenced from: /usr/local/opt/osgeo-gdal-python/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-darwin.so Reason: Incompatible library version: _gdal.cpython-37m-darwin.so requires version 27.0.0 or later, but libgdal.26.dylib provides version 26.0.0