I installed gdal using homedal because I need it for ortho4xp, which uses python3. I noticed that gdal depends on both python and python@2. Gdal is not the only package doing this. It pulls in numpy, which also specifies both python versions as a dependency. It seems there are lots of packages still requiring python@2

I'm assuming there's a reason for packages requiring both versions of python but I was wondering if there are ways of avoiding having to have python2 around?

  • I’m going to assume that you understand and it says were established when the packages were tested so that’s why they all link against python 2 and address the practical options you have as opposed to explain packaging basics. Please let me know if I missed the mark in my answer and you’re Looking at how to figure out why one specific package has one specific requirement of python 2. – bmike Feb 23 at 12:02
  • It's actually several packages that have python2 as a dependency several of which also depend on python2. See my comment below your answer. – Jilles van Gurp Feb 26 at 11:28

There is no getting around the pain of managing dependencies. What you are seeing is that for many, many years python 2 was the standard and as we finally are reaching the end of support, some major frameworks are making the move after preparing for years to do so. For the next 6 months, I would expect most active or easy to port projects to move to python 3. Time will tell of course.

If you feel you want or need to force your transition to python 3 in homebrew, I would try first removing it so you can validate you actually need it.

brew rm python@2

If you do have it as a dependency, you probably can do nothing and just give up a little space and a little time as every package you care about gets updated to use python 3. Set your path to use the version you want and just let it fade into history.

  • I guess the third option would be for you to actively go submit pull requests and literally change each package you depend on to get them fixed and running on python three. This is all open source and anyone that cares to contribute is who actually does the work maintaining these packages. – bmike Feb 23 at 12:00
  • I know I can forcibly remove it or create a PR. However, I'm assuming somebody had a good reason for having this dependency. Just curious what it was or whether there are mechanisms to get rid of this that I have missed. I'm a bit reluctant to barge in creating PRs without first understanding the reasoning behind this. In my experience, people appreciate doing your homework first. – Jilles van Gurp Feb 26 at 11:25
  • @JillesvanGurp I added some opinion to my answer in an edit as to why you are seeing this now. It’s just the transition has started at long last for homebrew and leaving python 2 behind imo. Nothing more and nothing less. The good reason is python 2 is end of life. – bmike Feb 26 at 12:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .