Golly 4.0

For general discussion about Conway's Game of Life.
User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Golly 4.0

Post by Andrew » October 30th, 2020, 8:04 am

Golly 4.0 is now available from sourceforge:

https://sourceforge.net/projects/golly/ ... golly-4.0/

See Help > Changes for what's new. Note in particular that Golly now requires Python 3.3 or later to run .py scripts, so all users (including Mac users) will need to download an appropriate 64-bit installer for their platform from https://www.python.org/downloads/. Python 3.9 was recently released and seems to work fine with Golly.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

GUYTU6J
Posts: 2200
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Golly 4.0

Post by GUYTU6J » October 31st, 2020, 3:38 am

Awesome update!
---
However, I've got an error when using the repeat.py, saying that
error.png
error.png (9.47 KiB) Viewed 8310 times

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: Golly 4.0

Post by LaundryPizza03 » October 31st, 2020, 7:44 am

I can't seem to use Python anymore. Changing to the version I'm using (3.8) did not help. The directory should be /Library/Frameworks/Python.framework/Versions/3.8/Python, but that doesn't work. I am using macOS. Lua works fine, however.

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Golly 4.0

Post by dvgrn » October 31st, 2020, 8:09 am

GUYTU6J wrote:
October 31st, 2020, 3:38 am
I've got an error when using the repeat.py...
Looks like nobody has updated repeat.py to work with Python 3.x yet. "xrange" is a Python 2.x keyword; in Python 3.x it's just plain "range".

Please post in this new script request thread where you got your copy of repeat.py from. I know it's posted on the forums somewhere, but "repeat" isn't the best name to search for with the forums' lovely search functionality.

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 4.0

Post by Andrew » October 31st, 2020, 8:01 pm

LaundryPizza03 wrote:
October 31st, 2020, 7:44 am
I can't seem to use Python anymore. Changing to the version I'm using (3.8) did not help. The directory should be /Library/Frameworks/Python.framework/Versions/3.8/Python, but that doesn't work. I am using macOS.
I'll need more info. How exactly did you install Python 3.8? Did you download the installer from www.python.org?

Open your GollyPrefs file in a text editor and tell me what the "python3_lib=..." line says. I use Python 3.9 so mine says:

Code: Select all

python3_lib=/Library/Frameworks/Python.framework/Versions/3.9/Python
You might just need to change the version number to 3.8 (but quit Golly.app first!).

Run Terminal.app and tell me the results of running these commands:

Code: Select all

which python3
python3 --version
file /Library/Frameworks/Python.framework/Versions/3.8/Python
Golly 4.0 for Mac was built using the Python 3.9 header files, so it could be that the stable ABI changes don't work as advertised and you'll have to download and install Python 3.9.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Golly 4.0

Post by gameoflifemaniac » November 1st, 2020, 3:48 am

I installed Python 3.9 64-bit and Golly still couldn't find the library. The exact same situation as 2 years ago. Can someone help me?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: Golly 4.0

Post by Saka » November 1st, 2020, 6:33 am

gameoflifemaniac wrote:
November 1st, 2020, 3:48 am
I installed Python 3.9 64-bit and Golly still couldn't find the library. The exact same situation as 2 years ago. Can someone help me?
Does it work once you give it the path to your python39.dll?

If you haven't done that:
1. Open up your python shell from somewhere (make sure you open the right version if you have multiple versions installed)
2. Type in:

Code: Select all

import os
os.path
3. Check around the location it output.
For me, the location given was

Code: Select all

C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39\\lib\\ntpath.py
And python39.dll was in the folder

Code: Select all

C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Golly 4.0

Post by gameoflifemaniac » November 1st, 2020, 1:41 pm

Saka wrote:
November 1st, 2020, 6:33 am
gameoflifemaniac wrote:
November 1st, 2020, 3:48 am
I installed Python 3.9 64-bit and Golly still couldn't find the library. The exact same situation as 2 years ago. Can someone help me?
Does it work once you give it the path to your python39.dll?

If you haven't done that:
1. Open up your python shell from somewhere (make sure you open the right version if you have multiple versions installed)
2. Type in:

Code: Select all

import os
os.path
3. Check around the location it output.
For me, the location given was

Code: Select all

C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39\\lib\\ntpath.py
And python39.dll was in the folder

Code: Select all

C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39
It kinda found it. I directed it to python3.dll instead of python39.dll because that's what Golly told me to do and only that worked. But now I get the error:

Golly warning:
The Python library does not have this symbol: Py_Initialize

EDIT: Will someone help me
Last edited by gameoflifemaniac on November 2nd, 2020, 4:36 am, edited 1 time in total.
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
bubblegum
Posts: 959
Joined: August 25th, 2019, 11:59 pm
Location: click here to do nothing

Re: Golly 4.0

Post by bubblegum » November 1st, 2020, 2:29 pm

The main reason I use Golly 3.x over Golly 4.0 still is because Golly 4.0's font looks terrible. Could there be an option to change it?
Each day is a hidden opportunity, a frozen waterfall that's waiting to be realised, and one that I'll probably be ignoring
sonata wrote:
July 2nd, 2020, 8:33 pm
conwaylife signatures are amazing[citation needed]
anything

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Golly 4.0

Post by dvgrn » November 1st, 2020, 2:37 pm

bubblegum wrote:
November 1st, 2020, 2:29 pm
The main reason I use Golly 3.x over Golly 4.0 still is because Golly 4.0's font looks terrible. Could there be an option to change it?
I don't think that's true for all operating systems. What OS are you talking about?

User avatar
bubblegum
Posts: 959
Joined: August 25th, 2019, 11:59 pm
Location: click here to do nothing

Re: Golly 4.0

Post by bubblegum » November 1st, 2020, 2:53 pm

dvgrn wrote:
November 1st, 2020, 2:37 pm
bubblegum wrote:
November 1st, 2020, 2:29 pm
The main reason I use Golly 3.x over Golly 4.0 still is because Golly 4.0's font looks terrible. Could there be an option to change it?
I don't think that's true for all operating systems. What OS are you talking about?
Windows 10. On reflection it looks pretty much exactly the same but that almost makes it worse. Plus I have no idea what font is actually being used and etc etc etc.
Each day is a hidden opportunity, a frozen waterfall that's waiting to be realised, and one that I'll probably be ignoring
sonata wrote:
July 2nd, 2020, 8:33 pm
conwaylife signatures are amazing[citation needed]
anything

fluffykitty
Posts: 1175
Joined: June 14th, 2014, 5:03 pm
Contact:

Re: Golly 4.0

Post by fluffykitty » November 1st, 2020, 5:54 pm

On macOS 10.14.5, the file area's font is white, rendering the names of non-selected items unreadable, and there's a gap between the file area and the layer/state select bar. The attached screenshot shows both of these issues.
Attachments
Screen Shot 2020-11-01 at 1.48.04 PM.png
Screen Shot 2020-11-01 at 1.48.04 PM.png (90.84 KiB) Viewed 8163 times

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 4.0

Post by Andrew » November 1st, 2020, 6:59 pm

fluffykitty wrote:
November 1st, 2020, 5:54 pm
On macOS 10.14.5, the file area's font is white, rendering the names of non-selected items unreadable, ...
Thanks for the screenshot (bubblegum, take note!). Golly doesn't know about Apple's new Dark mode, so you have 2 options:

1. Disable Dark mode for ALL apps by opening System Preferences > General and clicking the Light appearance.

2. If you only want to prevent Dark mode for Golly, then quit Golly if it's running, open Terminal.app and enter this command:

Code: Select all

defaults write net.sourceforge.golly NSRequiresAquaSystemAppearance -bool yes
EDIT: There's no need to do the above if you go to sourceforge and download Golly 4.0.1 for macOS.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: Golly 4.0

Post by LaundryPizza03 » November 2nd, 2020, 8:53 am

Andrew wrote:
October 31st, 2020, 8:01 pm
LaundryPizza03 wrote:
October 31st, 2020, 7:44 am
I can't seem to use Python anymore. Changing to the version I'm using (3.8) did not help. The directory should be /Library/Frameworks/Python.framework/Versions/3.8/Python, but that doesn't work. I am using macOS.
I'll need more info. How exactly did you install Python 3.8? Did you download the installer from www.python.org?

Open your GollyPrefs file in a text editor and tell me what the "python3_lib=..." line says. I use Python 3.9 so mine says:

Code: Select all

python3_lib=/Library/Frameworks/Python.framework/Versions/3.9/Python
You might just need to change the version number to 3.8 (but quit Golly.app first!).

Run Terminal.app and tell me the results of running these commands:

Code: Select all

which python3
python3 --version
file /Library/Frameworks/Python.framework/Versions/3.8/Python
Golly 4.0 for Mac was built using the Python 3.9 header files, so it could be that the stable ABI changes don't work as advertised and you'll have to download and install Python 3.9.
I'm using 3.9 now, so it's changed.
  • which python3: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
  • python3 --version: Python 3.9.0
  • file /Library/Frameworks/Python.framework/Versions/3.9/Python: /Library/Frameworks/Python.framework/Versions/3.9/Python: Mach-O 64-bit dynamically linked shared library x86_64
The output for which python3 doesn't work in Golly, either.

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

wildmyron
Posts: 1542
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: Golly 4.0

Post by wildmyron » November 2nd, 2020, 12:13 pm

gameoflifemaniac wrote:
November 1st, 2020, 1:41 pm
Saka wrote:
November 1st, 2020, 6:33 am
gameoflifemaniac wrote:
November 1st, 2020, 3:48 am
I installed Python 3.9 64-bit and Golly still couldn't find the library. The exact same situation as 2 years ago. Can someone help me?
Does it work once you give it the path to your python39.dll?

If you haven't done that:
1. Open up your python shell from somewhere (make sure you open the right version if you have multiple versions installed)
2. Type in:

Code: Select all

import os
os.path
3. Check around the location it output.
For me, the location given was

Code: Select all

C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39\\lib\\ntpath.py
And python39.dll was in the folder

Code: Select all

C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39
It kinda found it. I directed it to python3.dll instead of python39.dll because that's what Golly told me to do and only that worked. But now I get the error:

Golly warning:
The Python library does not have this symbol: Py_Initialize
Unfortunately, it seems that you really do need to give the path to the fully versioned dll, not the one named python3.dll. I tested this with Python 3.9 installed from python.org and also got the "The Python library does not have this symbol: Py_Initialize" warning. When I changed it to python39.dll Golly can successfully run Python scripts again.

To make this change you will need to edit your GollyPrefs file. Make sure Golly is closed and then open GollyPrefs in a text editor (you can find it by going to

Code: Select all

%APPDATA%\Golly\
in File Explorer). Find the line starting with "python3_lib=" and change the "python3.dll" to "python39.dll". Alternatively, delete the line, run Golly v4.0 again, run a Python script and then enter the full path to the python39.dll file.

Hopefully that gets you going.
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Golly 4.0

Post by gameoflifemaniac » November 2nd, 2020, 12:43 pm

wildmyron wrote:
November 2nd, 2020, 12:13 pm
gameoflifemaniac wrote:
November 1st, 2020, 1:41 pm
Saka wrote:
November 1st, 2020, 6:33 am

Does it work once you give it the path to your python39.dll?

If you haven't done that:
1. Open up your python shell from somewhere (make sure you open the right version if you have multiple versions installed)
2. Type in:

Code: Select all

import os
os.path
3. Check around the location it output.
For me, the location given was

Code: Select all

C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39\\lib\\ntpath.py
And python39.dll was in the folder

Code: Select all

C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python39
It kinda found it. I directed it to python3.dll instead of python39.dll because that's what Golly told me to do and only that worked. But now I get the error:

Golly warning:
The Python library does not have this symbol: Py_Initialize
Unfortunately, it seems that you really do need to give the path to the fully versioned dll, not the one named python3.dll. I tested this with Python 3.9 installed from python.org and also got the "The Python library does not have this symbol: Py_Initialize" warning. When I changed it to python39.dll Golly can successfully run Python scripts again.

To make this change you will need to edit your GollyPrefs file. Make sure Golly is closed and then open GollyPrefs in a text editor (you can find it by going to

Code: Select all

%APPDATA%\Golly\
in File Explorer). Find the line starting with "python3_lib=" and change the "python3.dll" to "python39.dll". Alternatively, delete the line, run Golly v4.0 again, run a Python script and then enter the full path to the python39.dll file.

Hopefully that gets you going.
Thanks so much, it works now!
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 4.0

Post by Andrew » November 2nd, 2020, 4:09 pm

gameoflifemaniac wrote:
November 1st, 2020, 1:41 pm
I directed it to python3.dll instead of python39.dll because that's what Golly told me to do ...
Where did Golly tell you to use python3.dll?
The notes in Help > Python Scripting clearly state that Golly looks for python39.dll on Windows.

Anyway, glad you managed to get it working.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

wildmyron
Posts: 1542
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: Golly 4.0

Post by wildmyron » November 3rd, 2020, 1:49 am

Andrew wrote:
November 2nd, 2020, 4:09 pm
gameoflifemaniac wrote:
November 1st, 2020, 1:41 pm
I directed it to python3.dll instead of python39.dll because that's what Golly told me to do ...
Where did Golly tell you to use python3.dll?
The notes in Help > Python Scripting clearly state that Golly looks for python39.dll on Windows.
It's in the "Could not load the Python3 library" dialog:
Golly_python3.png
Golly_python3.png (6.51 KiB) Viewed 8067 times
It does seem rather confusing.

====

I'm having the same issue as LaundryPizza03 on my MacBook. (Following on from the failed attempt to try to get it to work with HomeBrew's Python3.8.)

Answers to the questions you asked:

Golly 4.0 downloaded from Sourceforge.
Andrew wrote:How exactly did you install Python 3.8?
Python 3.9 installed using the installer downloaded from www.python.org. All options left as default.
Andrew wrote:Open your GollyPrefs file in a text editor and tell me what the "python3_lib=..." line says.

Code: Select all

python3_lib=/Library/Frameworks/Python.framework/Versions/3.9/Python
Andrew wrote:Run Terminal.app and tell me the results of running these commands:

Code: Select all

$ which python3
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
$ python3 --version
Python 3.9.0
$ file /Library/Frameworks/Python.framework/Versions/3.9/Python
/Library/Frameworks/Python.framework/Versions/3.9/Python: Mach-O 64-bit dynamically linked shared library x86_64
# More version information
$ python3
Python 3.9.0 (v3.9.0:9cf6752276, Oct  5 2020, 11:29:23) 
[Clang 6.0 (clang-600.0.57)] on darwin
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 4.0

Post by Andrew » November 3rd, 2020, 6:22 am

wildmyron wrote:
November 3rd, 2020, 1:49 am
It's in the "Could not load the Python3 library" dialog: ...
Ouch -- that's annoying. It's a pity nobody noticed this while testing the 4.0 beta versions. Hopefully that's because only a tiny minority of Windows users end up having to replace python39.dll with the full path to that file (I still have no idea why that's occasionally necessary -- I've never had to do that on any of my Windows systems).
I'm having the same issue as LaundryPizza03 on my MacBook.
Hmm, this is very puzzling. Your python3_lib setting is exactly the same as mine and the Terminal output is exactly the same. Just to be 100% clear, are you saying that when you try to run any .py script you get Golly's dialog saying it couldn't load the Python library? Is the path shown in that dialog *exactly* the same as the python3_lib path?

A few other questions:

Which version of macOS are you using? (I'm on 10.15.6.)

Are you logged in as an admin user? (Shouldn't matter if not. In fact I just tested logging into a non-admin account, downloaded Golly 4.0 from sf and had no problems running bricklayer.py.)

Where is your GollyPrefs file? If it's in the standard ~/Library/Application Support/Golly/ location, try moving it into the same folder as Golly.app and see if that makes any difference.

What is the output from running this command in Terminal:

Code: Select all

ls -al /Library/Frameworks/Python.framework/Versions/3.9/Python
On my Mac I get:

Code: Select all

-rwxrwxr-x  1 root  admin  3705920  6 Oct 02:36 /Library/Frameworks/Python.framework/Versions/3.9/Python
I'm really struggling to think of any other difference that might explain why you're having this problem.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 4.0

Post by Andrew » November 3rd, 2020, 6:26 pm

@wildmyron: A few more thoughts. Run these commands in Terminal (on my Mac the results are empty):

Code: Select all

echo $DYLD_LIBRARY_PATH
echo $DYLD_FALLBACK_LIBRARY_PATH
Save the following code as dltest.c, build and run dltest and see if you get an error message:

Code: Select all

// to build: gcc -mmacosx-version-min=10.10 -o dltest dltest.c
#include <stdio.h>
#include <dlfcn.h>
int main(int argc, char *argv[])
{
    if (dlopen("/Library/Frameworks/Python.framework/Versions/3.9/Python", RTLD_NOW | RTLD_GLOBAL)) {
        printf("success\n");
    } else {
        printf("error: %s\n", dlerror());
    }
}
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: Golly 4.0

Post by LaundryPizza03 » November 4th, 2020, 9:52 pm

Andrew wrote:
November 3rd, 2020, 6:22 am
wildmyron wrote:
November 3rd, 2020, 1:49 am
It's in the "Could not load the Python3 library" dialog: ...
Ouch -- that's annoying. It's a pity nobody noticed this while testing the 4.0 beta versions. Hopefully that's because only a tiny minority of Windows users end up having to replace python39.dll with the full path to that file (I still have no idea why that's occasionally necessary -- I've never had to do that on any of my Windows systems).
I'm having the same issue as LaundryPizza03 on my MacBook.
Hmm, this is very puzzling. Your python3_lib setting is exactly the same as mine and the Terminal output is exactly the same. Just to be 100% clear, are you saying that when you try to run any .py script you get Golly's dialog saying it couldn't load the Python library? Is the path shown in that dialog *exactly* the same as the python3_lib path?

A few other questions:

Which version of macOS are you using? (I'm on 10.15.6.)

Are you logged in as an admin user? (Shouldn't matter if not. In fact I just tested logging into a non-admin account, downloaded Golly 4.0 from sf and had no problems running bricklayer.py.)

Where is your GollyPrefs file? If it's in the standard ~/Library/Application Support/Golly/ location, try moving it into the same folder as Golly.app and see if that makes any difference.

What is the output from running this command in Terminal:

Code: Select all

ls -al /Library/Frameworks/Python.framework/Versions/3.9/Python
On my Mac I get:

Code: Select all

-rwxrwxr-x  1 root  admin  3705920  6 Oct 02:36 /Library/Frameworks/Python.framework/Versions/3.9/Python
I'm really struggling to think of any other difference that might explain why you're having this problem.
It happens when I attempt to run any Python script. The path in Golly-prefs is exactly the same as the python3_lib path.

I'm using 10.15.5. Your command gives

Code: Select all

-rwxrwxr-x  1 root  admin  3705920 Oct  5 10:36 /Library/Frameworks/Python.framework/Versions/3.9/Python
Moving from said standard location (~/Library/Application Support/Golly/) to the folder with Golly.app had no effect.

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

User avatar
Scorbie
Posts: 1692
Joined: December 7th, 2013, 1:05 am

Re: Golly 4.0

Post by Scorbie » November 4th, 2020, 10:33 pm

Oh, no, I will investigate about the Windows issue :(

wildmyron
Posts: 1542
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: Golly 4.0

Post by wildmyron » November 6th, 2020, 2:29 am

Andrew wrote:
November 3rd, 2020, 6:22 am
wildmyron wrote:
November 3rd, 2020, 1:49 am
It's in the "Could not load the Python3 library" dialog: ...
Ouch -- that's annoying. It's a pity nobody noticed this while testing the 4.0 beta versions. Hopefully that's because only a tiny minority of Windows users end up having to replace python39.dll with the full path to that file (I still have no idea why that's occasionally necessary -- I've never had to do that on any of my Windows systems).
Indeed. Unfortunately I'd seen the separate parts of this issue but didn't put the pieces together because I haven't had much time for testing (just enough to get it to work on Windows).

I believe the difference in behaviour requiring (or not) the full path to python39.dll comes from options selected during installation of Python. I suspect that if "Add Python 3.X to PATH" is selected during installation then it won't be necessary to give the full path to the dll file, but I haven't had a chance to test this on my Windows box.
Andrew wrote:
November 3rd, 2020, 6:22 am
I'm having the same issue as LaundryPizza03 on my MacBook.
Hmm, this is very puzzling. Your python3_lib setting is exactly the same as mine and the Terminal output is exactly the same. Just to be 100% clear, are you saying that when you try to run any .py script you get Golly's dialog saying it couldn't load the Python library? Is the path shown in that dialog *exactly* the same as the python3_lib path?
My answers are pretty much the same as LaundryPizza03's, but given here for completeness.

Yes, the Python library dialog pops up when I try to run any Python script. I've copy+pasted both paths you mentioned and made sure that they match.
A few other questions:

Which version of macOS are you using? (I'm on 10.15.6.)
I'm using 10.15.6
Are you logged in as an admin user? (Shouldn't matter if not. In fact I just tested logging into a non-admin account, downloaded Golly 4.0 from sf and had no problems running bricklayer.py.)
I am logged in as an admin user. Just to be sure, I logged in as a non-admin user, downloaded Golly from SF again, extracted and ran Golly, and tried to run a Python script. It failed in the same way.
Where is your GollyPrefs file? If it's in the standard ~/Library/Application Support/Golly/ location, try moving it into the same folder as Golly.app and see if that makes any difference.
GollyPrefs was in the standard location. I tried with a fresh GollyPrefs in the golly-4.0-mac folder but there was no difference in behaviour.
What is the output from running this command in Terminal:

Code: Select all

ls -al /Library/Frameworks/Python.framework/Versions/3.9/Python
On my Mac I get:

Code: Select all

-rwxrwxr-x  1 root  admin  3705920  6 Oct 02:36 /Library/Frameworks/Python.framework/Versions/3.9/Python
It's the same apart from modification time:

Code: Select all

-rwxrwxr-x  1 root  admin  3705920  5 Oct 23:36 /Library/Frameworks/Python.framework/Versions/3.9/Python
Andrew wrote:
November 3rd, 2020, 6:26 pm
@wildmyron: A few more thoughts. Run these commands in Terminal (on my Mac the results are empty):

Code: Select all

echo $DYLD_LIBRARY_PATH
echo $DYLD_FALLBACK_LIBRARY_PATH
Both those vars are empty

Code: Select all

$ echo $DYLD_LIBRARY_PATH

$ echo $DYLD_FALLBACK_LIBRARY_PATH

$
Save the following code as dltest.c, build and run dltest and see if you get an error message:

Code: Select all

// to build: gcc -mmacosx-version-min=10.10 -o dltest dltest.c
#include <stdio.h>
#include <dlfcn.h>
int main(int argc, char *argv[])
{
    if (dlopen("/Library/Frameworks/Python.framework/Versions/3.9/Python", RTLD_NOW | RTLD_GLOBAL)) {
        printf("success\n");
    } else {
        printf("error: %s\n", dlerror());
    }
}
It works without error:

Code: Select all

$ gcc -mmacosx-version-min=10.10 -o dltest dltest.c
$ ./dltest
success
$ 
I wondered about testing the Python library with some other app which requires embedded Python. Can you (or anyone else) suggest an app which embeds Python3 and uses it in a similar way which I could test with?

Also, would it be helpful for me to do a debug build of Golly from src on my Mac and try to get more info that way? If so, is Command Line Tools sufficient, or do I need XCode installed? It would probably take quite a while to do a build on this old MacBook, but it should be able to do the job.
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 4.0

Post by Andrew » November 6th, 2020, 3:36 am

wildmyron wrote:
November 6th, 2020, 2:29 am
I wondered about testing the Python library with some other app which requires embedded Python. Can you (or anyone else) suggest an app which embeds Python3 and uses it in a similar way which I could test with?
Sorry, I don't know of any other apps like that.
Also, would it be helpful for me to do a debug build of Golly from src on my Mac and try to get more info that way? ...
Leave that as a last resort. Let me dig into the wxMac code that calls dlopen. I'll try to do a build of Golly that exposes the dlerror string so you can hopefully see exactly why the dlopen call is failing on your system.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 4.0

Post by Andrew » November 6th, 2020, 4:59 am

@wildmyron and @LaundryPizza03: Please try running a .py script with this special build:

http://www.trevorrow.com/golly/Golly-4.0.1-Mac.dmg

Along with the usual "Could not load the Python library" dialog, you should get an extra "Golly Error" dialog box.
Please tell me the *exact* error message in that box. (Note that you can click and drag to copy the text,
then ctrl-click in it to get a pop-up menu with a Copy item that will copy the text to the clipboard.)
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

Post Reply