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

Cannot install osgeo-gdal-python due to dependency on python2 #1340

Closed donCarlosOne closed 4 years ago

donCarlosOne commented 4 years ago

I've been trying unsuccesfully to install osgeo-gdal-python on MacOS Catalina using Homebrew.

I previously had python@2 installed, and it complained:

brew install --verbose osgeo/osgeo4mac/osgeo-gdal-python  
==> Installing osgeo-gdal-python from osgeo/osgeo4mac
Error: No available formula with the name "python2" (dependency of osgeo/osgeo4mac/osgeo-gdal-python)
==> 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.

I thought perhaps that by uninstalling python@2, this installer would do it for me. I believe it tried to install it, however Homebrew is no longer supporting python@2 at all (and I cannot even reinstall it via Homebrew manually):

brew install --verbose osgeo/osgeo4mac/osgeo-gdal-python 
==> Installing osgeo-gdal-python from osgeo/osgeo4mac
Error: No available formula with the name "python@2" (dependency of osgeo/osgeo4mac/osgeo-gdal-python)
==> Searching for a previously deleted formula (in the last month)...
python@2 was deleted from homebrew/core in commit 028f11f9e4:
  python@2: delete (https://github.com/Homebrew/homebrew-core/issues/49796)
  EOL 1 January 2020.
  We gave it 1 month more to live so that people had time to migrate.
  All in all, developers had 11 years to do their migration.
  You can use the `brew extract` command and maintain python@2 in your own
  tap if necessary:
  https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap

To show the formula before removal run:
  git -C "$(brew --repo homebrew/core)" show 028f11f9e4^:Formula/python@2.rb

If you still use this formula consider creating your own tap:
  https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap

So, Homebrew has indicated how to do this above - but somewhere the installer is still looking for "python2", not "python@2" as per my initial attempts.

Any workaround would be most appreciated as this is now restricting us in a dev project.

alazarolop commented 4 years ago

The formula accepts an option --without-python@2, can you successfully build it adding that?

aniruhil commented 4 years ago

same boat as @donCarlosOne

Tried the --without-python@2 option but to no avail.

Upgrading 1 outdated package: osgeo/osgeo4mac/osgeo-gdal-python 3.0.2 -> 3.0.4 Error: No available formula with the name "python2" (dependency of osgeo/osgeo4mac/osgeo-gdal-python)

alazarolop commented 4 years ago

I see. Unfortunately, I guess there isn't a simple workaround (e.g. editing the formula locally) and you will probably find the same error in formulas that depend on this GDAL version too. You'd better wait a bit for the update, which is on his way. It shouldn't take longer.

aniruhil commented 4 years ago

Thank you for looking into it @alazarolop, much appreciated. I'll wait for the update.

alazarolop commented 4 years ago

You are welcome. I'll let you know when everything is rightly set up

fjperini commented 4 years ago

@donCarlosOne @aniruhil Today I will update all these dependencies, we are working in another branch, so as not to break the dependencies in the future. For the new version of QGIS, everything will be updated.

alazarolop commented 4 years ago

It should be fixed in the latest release (https://github.com/OSGeo/homebrew-osgeo4mac/pull/1354).

aniruhil commented 4 years ago

thank you @alazarolop and @fjperini

atsokol commented 4 years ago

Thank you @alazarolop
Do you plan to fix osgeo-grass and other installations that depend on python@2 as well?

fjperini commented 4 years ago

@atsokol Yes, I already have osgeo-grass working. I will update it in a few hours!