Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xantufrog

macrumors regular
Original poster
Jul 7, 2023
130
135
I’ve been trying to set up my G4 iBook to serve as a platform for python 2.7 development. Python itself installed easy, but I’m running into trouble with libraries for doing more with it. In particular I’d love an early version of sci-kit learn, but this requires scipy, numpy, etc. and those…

I’ve been trying to use Macports and it is not only interminably slow to build anything but it seems to fail left and right. I’m almost there with numpy but macports won’t install coreutils. Is there an alternate route for this on Tiger?

or any other suggestions for other routes to getting functional python environ with those dependencies on it beyond the base?

I may switch to leopard to try again (I’ve been making headway with python 3.6 actually on my g4 iMac with leopard), but it is so slow on these
 
  • Like
Reactions: G4fanboy
I’ve been trying to set up my G4 iBook to serve as a platform for python 2.7 development. Python itself installed easy, but I’m running into trouble with libraries for doing more with it. In particular I’d love an early version of sci-kit learn, but this requires scipy, numpy, etc. and those…

I’ve been trying to use Macports and it is not only interminably slow to build anything but it seems to fail left and right. I’m almost there with numpy but macports won’t install coreutils. Is there an alternate route for this on Tiger?

or any other suggestions for other routes to getting functional python environ with those dependencies on it beyond the base?

I may switch to leopard to try again (I’ve been making headway with python 3.6 actually on my g4 iMac with leopard), but it is so slow on these

You can use tiger.sh to install coreutils. There are other packages in there you might find useful as well. Good luck with everything.

 
  • Like
Reactions: xantufrog
Hey @xantufrog ! Let me know if there are any packages you'd like added. I just dusted all of this off while looking at how difficult it might be to get a Golang port working. Unfortunately it looks like it will involve learning a lot about PowerPC assembly 😰
 
Hey @xantufrog ! Let me know if there are any packages you'd like added. I just dusted all of this off while looking at how difficult it might be to get a Golang port working. Unfortunately it looks like it will involve learning a lot about PowerPC assembly 😰
Thanks! If I can get far enough with dependencies I'll be trying to install matplotlib, if that's something you think is feasible. Reading this thread (https://forums.macrumors.com/threads/python-3-6-and-matplotlib-on-powerpc.2112874/) it looks like install is feasible but going the macports route did give a headache to Andropov!
 
  • Like
Reactions: cellularmitosis
@cellularmitosis interesting - coreutils 9 installed great using your resource, but it looks like psy27-scipy from macports was coreutils 9.3 (or, maybe it would accept coreutils9.0 but isn't detecting it in the /opt/ install location). Do you know if there is a way trick/force an install process like this to try working with a different version (in this case, 9.0 instead of 9.3)?

Thanks!
 
Last edited:
Actually, I think the issue may be not the version number of coreutils, but instead that macports doesn't "see" what these tools install, because I just had the same issue, this time with the "m4" package, on my leopard machine. Like with coreutils on tiger, macports is looking for this dependency, doesn't find it, and tries to install (but here the macports version it tries and fails to install appears to be the same version number as the one already installed with your tools)
 
Yes, I should have asked how you were planning on pulling everything together. Macports is not going to "see" (or "like" for that matter) anything that isn't installed via Macports. This can be a little frustrating at first, but after a while of using it I can appreciate why it is the way it is. I could perhaps try to help you with some of your Macports errors if you'd like.

You oculd try to build outside of Macports and link against its libraries, but take a look at Baracuda's post here on why it's not advised (I've never done it, but I don't intend to either).

https://forums.macrumors.com/threads/unofficial-macports-10-5-binary-repo.2376248/post-32017120

Perhaps you could build without using any Macports at all? I'm not sure how many dependencies you have, but that honestly might be easier. YMMV, I hope that helps.
 
Yes, I should have asked how you were planning on pulling everything together. Macports is not going to "see" (or "like" for that matter) anything that isn't installed via Macports. This can be a little frustrating at first, but after a while of using it I can appreciate why it is the way it is. I could perhaps try to help you with some of your Macports errors if you'd like.

You oculd try to build outside of Macports and link against its libraries, but take a look at Baracuda's post here on why it's not advised (I've never done it, but I don't intend to either).

https://forums.macrumors.com/threads/unofficial-macports-10-5-binary-repo.2376248/post-32017120

Perhaps you could build without using any Macports at all? I'm not sure how many dependencies you have, but that honestly might be easier. YMMV, I hope that helps.
Good to know! Thank you. I think my strategy may need to abandon macports like you suggest and build from the bottom up. I’ll grab some screenshots of the errors though in case you see something obvious!
 
I wonder if there's a way to tell macports to ignore a dependency? "I already have this in $PATH, don't build it"
 
I’ve been trying to set up my G4 iBook to serve as a platform for python 2.7 development. Python itself installed easy, but I’m running into trouble with libraries for doing more with it. In particular I’d love an early version of sci-kit learn, but this requires scipy, numpy, etc. and those…

I’ve been trying to use Macports and it is not only interminably slow to build anything but it seems to fail left and right. I’m almost there with numpy but macports won’t install coreutils. Is there an alternate route for this on Tiger?

or any other suggestions for other routes to getting functional python environ with those dependencies on it beyond the base?

I may switch to leopard to try again (I’ve been making headway with python 3.6 actually on my g4 iMac with leopard), but it is so slow on these

1. Try coreutils-devel, I recall they worked better.
2. Report issues on https://trac.macports.org – you may get help.

3. IMO, Tiger is pretty broken, and it is unfeasible to support it properly. There are very few people who can and want do something for PPC, and Tiger is not prioritized. Unfortunately, we are here in a situation of like You want it fixed – fix it for yourself and others.
Having said that, it still make sense to open a ticket.

UPD. It is already there: https://trac.macports.org/ticket/67248
 
Last edited:
@cellularmitosis interesting - coreutils 9 installed great using your resource, but it looks like psy27-scipy from macports was coreutils 9.3 (or, maybe it would accept coreutils9.0 but isn't detecting it in the /opt/ install location). Do you know if there is a way trick/force an install process like this to try working with a different version (in this case, 9.0 instead of 9.3)?

Thanks!

Well, if the requirement is superficial, you can patch configure, so that version number is not checked or is set to what you need. Usually this is done in the opposite scenario though – when we have a newer version of a dependency, but configure does not know about it.

Alternatively, you can patch specific source files, reverting changes that broken the build of a newer version. This is the correct approach, but often – understandably – not an easy one.

If you think that you do not need a dependency, just delete it from the portfile. It is it added via a variant, build with sudo port upgrade --enforce-variants PORTNAME -variant (if you are rebuilding) or sudo port install PORTNAME -variant.

Do not dump random software into Macports prefix, it will not work, but will produce unknown and undesirable consequences.
 
I wonder if there's a way to tell macports to ignore a dependency? "I already have this in $PATH, don't build it"

Delete/comment out from the portfile :)

Or move into a variant, build without it – this is useful if you are actually fixing something and intend to submit a PR. For example, some ports may force variants with broken dependencies – those should be disabled, conditionally on a system version.
 
  • Like
Reactions: cellularmitosis
1. Try coreutils-devel, I recall they worked better.
2. Report issues on https://trac.macports.org – you may get help.

3. IMO, Tiger is pretty broken, and it is unfeasible to support it properly. There are very few people who can and want do something for PPC, and Tiger is not prioritized. Unfortunately, we are here in a situation of like You want it fixed – fix it for yourself and others.
Having said that, it still make sense to open a ticket.

UPD. It is already there: https://trac.macports.org/ticket/67248
Thanks for all the replies and guidance. I'll keep digging.

Re. Tiger, to be fair I'm having just as many failed install issues on Leopard with macports as well (although not the same packages). And Leopard is noticably slower on these - I am having trouble seeing the value and keep gravitating back to Tiger. Maybe the newer software support was a big deal when they were new but now they both feel like similarly archaic and unsupported systems which struggle on the web, so Tiger feels pretty competitive thanks to its speed (unless of course I need a program only Leopard can run!)
 
Thanks for all the replies and guidance. I'll keep digging.

Re. Tiger, to be fair I'm having just as many failed install issues on Leopard with macports as well (although not the same packages). And Leopard is noticably slower on these - I am having trouble seeing the value and keep gravitating back to Tiger. Maybe the newer software support was a big deal when they were new but now they both feel like similarly archaic and unsupported systems which struggle on the web, so Tiger feels pretty competitive thanks to its speed (unless of course I need a program only Leopard can run!)

Well, with Leopard you will have better support. I am reasonably confident that whatever I fix for 10.6 ppc will work on Leopard too (obviously, some exceptions may be there). Tiger is a different story.

I won’t agree that they are similar. On 10.5–10.6 you have the latest compilers working, and most of the software either builds or is fixable (at least as far as C/C++/Fortran/R go). Tiger has archaic toolchain which will not support building a new GCC and many basic ports regularly broken.

P. S. You probably may get impression that no one ever bothers to fix anything – I had such an impression time ago myself. In reality, unfortunately, upstream developers are often either disinterested to support older/less common systems or ignorant of associated requirements, and continuously break something. So to have a given port fixed for PowerPC it is not enough to just fix it once, but rather keep fixing whatever upstream breaks. Now consider how many ports are there in Macports vs how many people are there with a motivation, time and hardware. It is simply impossible to keep everything working.
Whatever someone fixes, keeps verifying upon every update – and fixes again whatever got “improved” to the point of breakage – will work relatively smoothly. Say, I think that building R-arrow for `ppc` on Leopard can be done from scratch with default portfiles (and that implies building A LOT). Because I have fixed every problematic port in the chain, and then I update them, and fix again. I have no idea of the status of something which I never tried to build though. And often no one has :)
 
  • Like
Reactions: xantufrog
Well, with Leopard you will have better support. I am reasonably confident that whatever I fix for 10.6 ppc will work on Leopard too (obviously, some exceptions may be there). Tiger is a different story.

I won’t agree that they are similar. On 10.5–10.6 you have the latest compilers working, and most of the software either builds or is fixable (at least as far as C/C++/Fortran/R go). Tiger has archaic toolchain which will not support building a new GCC and many basic ports regularly broken.

P. S. You probably may get impression that no one ever bothers to fix anything – I had such an impression time ago myself. In reality, unfortunately, upstream developers are often either disinterested to support older/less common systems or ignorant of associated requirements, and continuously break something. So to have a given port fixed for PowerPC it is not enough to just fix it once, but rather keep fixing whatever upstream breaks. Now consider how many ports are there in Macports vs how many people are there with a motivation, time and hardware. It is simply impossible to keep everything working.
Whatever someone fixes, keeps verifying upon every update – and fixes again whatever got “improved” to the point of breakage – will work relatively smoothly. Say, I think that building R-arrow for `ppc` on Leopard can be done from scratch with default portfiles (and that implies building A LOT). Because I have fixed every problematic port in the chain, and then I update them, and fix again. I have no idea of the status of something which I never tried to build though. And often no one has :)
Thanks for the clarification - I may have to upgrade the ibook to leopard then and at least then I'm working with the same support structure on both my old PPCs!
 
  • Like
Reactions: barracuda156
I’ve been trying to set up my G4 iBook to serve as a platform for python 2.7 development. Python itself installed easy, but I’m running into trouble with libraries for doing more with it. In particular I’d love an early version of sci-kit learn, but this requires scipy, numpy, etc. and those…

I’ve been trying to use Macports and it is not only interminably slow to build anything but it seems to fail left and right. I’m almost there with numpy but macports won’t install coreutils. Is there an alternate route for this on Tiger?

or any other suggestions for other routes to getting functional python environ with those dependencies on it beyond the base?

I may switch to leopard to try again (I’ve been making headway with python 3.6 actually on my g4 iMac with leopard), but it is so slow on these

I got lapack and fftw built, but I'm running into trouble with numpy under python3.

Edit: I am also just now remembering that my python2 build was just an initial bare-bones effort. In particular, it doesn't have the SSL module, which as it turns out means you can't install pip :(

The python 3 package is currently much more fully fleshed out, but I'm not opposed to revisiting the python2 package.
 
  • Like
Reactions: xantufrog
I got lapack and fftw built, but I'm running into trouble with numpy under python3.

Edit: I am also just now remembering that my python2 build was just an initial bare-bones effort. In particular, it doesn't have the SSL module, which as it turns out means you can't install pip :(

The python 3 package is currently much more fully fleshed out, but I'm not opposed to revisiting the python2 package.

Pythons are poorly written and poorly maintained. Gotta live with that.

numpy, while doing nonsense with arch settings, builds on PPC. I have checked now, and I have installed every version from py38-* to py311-*, as well as py27-*. I never ran tests for it though. Won’t be surprised if something does not work.

P. S. If you build in Macports and on the release version of MacOS – open tickets on Trac for whatever is broken. While Pythons in upstream may remain semi-broken, at least maybe something gets fixed in Macports for them.
 
  • Like
Reactions: cellularmitosis
What a mess this all is - so, I switched to Leopard and got kind of far with python 3.6 via macports. Numpy seems to be installed. But scipy can't install because m4 package fails in some bizarre way (which is needed for bison, etc).

I'm wondering if I should 1) uninstall all macports ports and macports, 2) install 3.1 via brew instead, and 3) if it's possible to install pip on 3.1 and have that handle dependencies? Surely a version of python contemporary to Leopard can be installed with its contemporary package versions (I don't want to install 2023 stuff here - I know that's an absurd ask).

Any advice? I want to try to keep everything clean and simple
 
What a mess this all is - so, I switched to Leopard and got kind of far with python 3.6 via macports. Numpy seems to be installed. But scipy can't install because m4 package fails in some bizarre way (which is needed for bison, etc).

I'm wondering if I should 1) uninstall all macports ports and macports, 2) install 3.1 via brew instead, and 3) if it's possible to install pip on 3.1 and have that handle dependencies? Surely a version of python contemporary to Leopard can be installed with its contemporary package versions (I don't want to install 2023 stuff here - I know that's an absurd ask).

Any advice? I want to try to keep everything clean and simple

Wait, I can reboot to 10.5 and check current state of m4. I guess the error is this one? :)
 

Attachments

  • 20230822_145923.jpg
    20230822_145923.jpg
    519.4 KB · Views: 54
Last edited:
*edit* sorry! you are right, that's the issue I have. Thank you! I was looking at a different thread. I'll try this...

Try the patch suggested there, it should work. I will try to do something about merging the fix, it is indeed annoying to have it broken (I tried building now, and yes, it fails).
 
Try the patch suggested there, it should work. I will try to do something about merging the fix, it is indeed annoying to have it broken (I tried building now, and yes, it fails).
thanks! I fear I'm missing something - when I type the command 'diff -u configure.old configure' in the /opt/local/var/macports dir it can't find the file configure and looking around I can't see where that may be? sorry for the noob question - clearly learning how macports works as I go
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.