'Pyomo unable to locate GLPK solver (mac)

Quite new to Python and struggling to get glpk to work in a model using pyomo.

I'm trying to use the GLPK solver with Pyomo. I have a working model that is tested to work, but keep getting an error saying GLPK can't be found.

I'm on a Mac (MacOS Big Sur 11.6), installed Anaconda and created a virtual environment using Python 3.7, as I could not load all of the packages I need in 3.10. glpk is installed into the environment, but when I launch a Jupyter notebook and run a model that is tested to work, I get the following error message.

"WARNING: Could not locate the 'glpsol' executable, which is required for solver 'glpk'"

The same issue is found here, but I was not able to employ the same solution on my Mac.

Appreciate any advice, very new to Python and would love to get this set up so I can get going. Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source