Skip to content
This repository has been archived by the owner on May 24, 2019. It is now read-only.

QGIS3 Install Failed on Matplotlib Dependency #50

Open
joec58 opened this issue Jan 3, 2018 · 17 comments
Open

QGIS3 Install Failed on Matplotlib Dependency #50

joec58 opened this issue Jan 3, 2018 · 17 comments

Comments

@joec58
Copy link

joec58 commented Jan 3, 2018

brew install qgis/qgisdev/qgis3-dev

Error: No available formula with the name "homebrew/science/matplotlib" (dependency of qgis/qgisdev/qgis3-dev)

==> Searching for a previously deleted formula (in the last month)...

homebrew/science/matplotlib was deleted from homebrew/science in commit 224eed91:
   Deprecate Homebrew/homebrew-science (https://github.com/Homebrew/homebrew-science/issues/6616)
@Malauch
Copy link

Malauch commented Jan 3, 2018

I hit the same problem. The cause is that matplotlib was moved recently to Homebrew/core so it's no longer "homebrew/science/matplotlib" but just "matplotlib".

BTW when I tried to install with "--ignore-dependencies" it crashed like that:

macos-high-sierra-2:Homebrew michaljurewicz$ brew install qgis3-dev --ignore-dependencies
==> Installing qgis3-dev from qgis/qgisdev
==> Cloning https://github.com/qgis/QGIS.git
Updating /Users/michaljurewicz/Library/Caches/Homebrew/qgis3-dev--git
==> Checking out branch master
==> /usr/local/bin/pip3 install --user future psycopg2 python-dateutil httplib2 pytz six nose2 pygments jinja2 pyyaml requests
==> cmake -G Ninja -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cella
Last 15 lines from /Users/michaljurewicz/Library/Logs/Homebrew/qgis3-dev/02.cmake:
-DGSL_CONFIG=/usr/local/opt/gsl/bin/gsl-config
-DGSL_INCLUDE_DIR=/usr/local/opt/gsl/include
-DGSL_LIBRARIES='-L/usr/local/opt/gsl/lib -lgsl -lgslcblas'
-DWITH_SERVER=TRUE
-DPOSTGRES_CONFIG=/usr/local/opt/postgresql/bin/pg_config
-DWITH_GRASS7=TRUE
-DGRASS_PREFIX7='/usr/local/opt/grass7/grass-base'
-DWITH_GLOBE=FALSE
-DWITH_ORACLE=FALSE
-DWITH_QSPATIALITE=FALSE
-DWITH_APIDOC=FALSE
-DWITH_3D=FALSE
-DCLANG_TIDY_EXE=
..

@songololo
Copy link

I am running into the same issues. Kyng Chaos builds also fail due to matplotlib related errors, and the brew cask install qgis route no longer works due to removal of homebrew science...

Looking forward to QGIS 3 and hoping this formula will provide a route to usage.

@Malauch
Copy link

Malauch commented Jan 5, 2018

For now, the best option is to fix formula locally. I just used:
brew edit qgis3-dev
and then change line 86
depends_on "homebrew/science/matplotlib" to depends_on "matplotlib" and it's working again.

@joec58
Copy link
Author

joec58 commented Jan 5, 2018

Changing "homebrew/science/matplotlib" to "matplotlib" didn't work for me.

==> Installing qgis3-dev from qgis/qgisdev
Error: No available formula with the name "matplotlib" (dependency of qgis/qgisdev/qgis3-dev)

Even a brew search matplotlib failed to find it.

No formula found for "matplotlib".
Open pull requests:
med-file: import from homebrew/science (https://github.com/Homebrew/homebrew-core/pull/22412)
nest: migrate to homebrew/core (https://github.com/Homebrew/homebrew-core/pull/21561)

The discussion at https://github.com/Homebrew/homebrew-core/pull/21561 last month was still debating whether matplotlib would be allowed to migrate to homebrew core.

@Malauch
Copy link

Malauch commented Jan 5, 2018

I have tried one more time and it definitely works. But maybe it's because I have already installed matplotlib?

@dd-a
Copy link

dd-a commented Jan 5, 2018

I face the same problem and @Malauch 's solution works perfectly for me although I didn't specifically install matplotlib since the move from "homebrew/science/" .

@smellman
Copy link

smellman commented Jan 6, 2018

https://github.com/Homebrew/homebrew-science/issues/6331

matplotlib - 8500 do not migrate: use pip or vendor.

matplotlib will not provide with homebrew.
How about to add matplotlib to py_req?

@smellman
Copy link

smellman commented Jan 6, 2018

PR: #51

I try matplotlib with pip install, I can build it and run QGIS 2.99.
But I get following message:

btm ~ $ brew install --no-sandbox qgis/qgisdev/qgis3-dev
==> Installing qgis3-dev from qgis/qgisdev
==> Cloning https://github.com/qgis/QGIS.git
Updating /Users/btm/Library/Caches/Homebrew/qgis3-dev--git
==> Checking out branch master
==> /usr/local/bin/pip3 install --user future psycopg2 python-dateutil httplib2 pytz six nose2 pygments jinja2 pyyaml requests owslib matplotlib
==> cmake -G Ninja -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/qgis3-dev/2.99 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DC
==> cmake --build . --target all -- -j 8
==> cmake --build . --target install -- -j 8
Error: Failed changing dylib ID of /usr/local/Cellar/qgis3-dev/2.99/libexec/python/lib/python/site-packages/matplotlib/.dylibs/libpng16.16.dylib
  from /DLC/matplotlib/libpng16.16.dylib
    to /usr/local/opt/qgis3-dev/libexec/python/lib/python/site-packages/matplotlib/.dylibs/libpng16.16.dylib
Error: Failed to fix install linkage
The formula built, but you may encounter issues using it or linking other
formula against it.

@songololo
Copy link

songololo commented Jan 7, 2018

matplotlib could perhaps be installed per this method: Python for Formula Authors

It seems that it requires defining resources required by a python package, e.g. (the following is generated by running homebrew-pypi-poet)

resource "backports.functools_lru_cache" do
  url "https://files.pythonhosted.org/packages/4e/91/0e93d9455254b7b630fb3ebe30cc57cab518660c5fad6a08aac7908a4431/backports.functools_lru_cache-1.4.tar.gz"
  sha256 "31f235852f88edc1558d428d890663c49eb4514ffec9f3650e7f3c9e4a12e36f"
end
resource "Cycler" do
  url "https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz"
  sha256 "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8"
end
resource "matplotlib" do
  url "https://files.pythonhosted.org/packages/50/27/57ab73d1b094540dec1a01d2207613248d8106f3c3f40e8d86f02eb8d18b/matplotlib-2.1.1.tar.gz"
  sha256 "659f5e1aa0e0f01488c61eff47560c43b8be511c6a29293d7f3896ae17bd8b23"
end
resource "pyparsing" do
  url "https://files.pythonhosted.org/packages/3c/ec/a94f8cf7274ea60b5413df054f82a8980523efd712ec55a59e7c3357cf7c/pyparsing-2.2.0.tar.gz"
  sha256 "0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04"
end
resource "python-dateutil" do
  url "https://files.pythonhosted.org/packages/54/bb/f1db86504f7a49e1d9b9301531181b00a1c7325dc85a29160ee3eaa73a54/python-dateutil-2.6.1.tar.gz"
  sha256 "891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca"
end
resource "pytz" do
  url "https://files.pythonhosted.org/packages/60/88/d3152c234da4b2a1f7a989f89609ea488225eaea015bc16fbde2b3fdfefa/pytz-2017.3.zip"
  sha256 "fae4cffc040921b8a2d60c6cf0b5d662c1190fe54d718271db4eb17d44a185b7"
end
resource "six" do
  url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz"
  sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"
end

then installing these resources inside of the install section, e.g.

venv = virtualenv_create(libexec, "python3")
%w[backports.functools_lru_cache Cycler matplotlib pyparsing python-dateutil pytz six].each do |r|
  venv.pip_install resource(r)
end

No idea yet how this relates to the present script...

@AndrewAnnex
Copy link

👍 for using a venv

removing the matplotlib line fixed the build (without additonal options like 3d that I want to try) for me after I cleaned out a lot of junk using brew cleanup / doctor and removing old qt versions.

@yuletide
Copy link

yuletide commented Jan 26, 2018

Tried both #51 and deleting the matplotlib manually using brew edit, with no luck. @AndrewAnnex did you make any other changes to get it to build?

I got python binding errors on OSX 10.13.2 with Python 3.6.3 installed via Anaconda,


Last 15 lines from /Users/a/Library/Logs/Homebrew/qgis3-dev/03.cmake:
      QgsPythonUtilsImpl::exitPython() in qgspythonutilsimpl.cpp.o
  "_Py_Initialize", referenced from:
      QgsPythonUtilsImpl::init() in qgspythonutilsimpl.cpp.o
      QgsPythonUtilsImpl::initPython(QgisInterface*) in qgspythonutilsimpl.cpp.o
      QgsPythonUtilsImpl::initServerPython(QgsServerInterface*) in qgspythonutilsimpl.cpp.o
  "__Py_NoneStruct", referenced from:
      QgsPythonUtilsImpl::getTraceback() in qgspythonutilsimpl.cpp.o
      QgsPythonUtilsImpl::PyObjectToQString(_object*) in qgspythonutilsimpl.cpp.o
      QgsPythonUtilsImpl::getError(QString&, QString&) in qgspythonutilsimpl.cpp.o
ld: symbol(s) not found for architecture x86_64

Very eager to try out 3.0.

@AndrewAnnex
Copy link

I remember having to remove any and all QT related things. After I removed all QT 4 and 5 components I think it worked after that. I could go through my bash history to work out what I removed if more specific steps are needed.

@xqiushi
Copy link

xqiushi commented Jan 31, 2018

I hit the same problem.

brew edit qgis3-dev

and then delete the line 86 depends_on "homebrew/science/matplotlib" and it's working now.

@stamogis
Copy link

stamogis commented Feb 8, 2018

If I delete or comment the line 86, I get the error message
Error: no implicit conversion of Symbol into String
and the installation stops.

@Nenuial
Copy link

Nenuial commented Feb 21, 2018

I replaced the homebrew/science dependency with brewsci and for me it seems to work well (without matplotlib qgis3-dev still compiled without errors but I was no longer able to install plugins that relied on matplotlib).
Maybe this could be a solution ?

@ThePromenader
Copy link

Do

brew edit qgis3-dev

and change

depends_on "homebrew/science/matplotlib"

to

depends_on "brewsci/science/matplotlib"

...and that should work. At least, it did for me.

Homebrew moved its directories around recently, and the formula wasn't updated accordingly.

@songololo
Copy link

songololo commented Mar 2, 2018

Since homebrew deprecated homebrew-science and have decided not to migrate matplotlib into homebrew-core it may be worth using the embedded venv approach. Here is an example of how to install matplotlib using this approach.
See lines:

  • 47-72
  • 96-102
  • 108-110

We can conceivably do the same for qgis3 if there is interest?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests