A problem with Python
- gameoflifemaniac
- Posts: 1242
- Joined: January 22nd, 2017, 11:17 am
- Location: There too
Re: A problem with Python
Ok. Python finally started working, but some scripts don't work. When I run a rule generator, it says something like 'no module called ReadRuleTable'. But the files are in the glife folder! What is going on?
I have Python 2.7.15.
I have Python 2.7.15.
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!
Re: A problem with Python
When the error message comes up, you can hit "Ctrl+C" and get the actual text of the error message copied to the clipboard (not a screenshot) -- on Windows, anyway. If you quote that text, it's a lot more helpful than a report of "something like" the error message.gameoflifemaniac wrote:Ok. Python finally started working, but some scripts don't work. When I run a rule generator, it says something like 'no module called ReadRuleTable'. But the files are in the glife folder! What is going on?
I have Python 2.7.15.
1) What version of Golly did you end up with, and is it 32-bit or 64-bit?
2) Exactly which rule generator script did you try to run?
- gameoflifemaniac
- Posts: 1242
- Joined: January 22nd, 2017, 11:17 am
- Location: There too
Re: A problem with Python
Lol it works nowdvgrn wrote:When the error message comes up, you can hit "Ctrl+C" and get the actual text of the error message copied to the clipboard (not a screenshot) -- on Windows, anyway. If you quote that text, it's a lot more helpful than a report of "something like" the error message.gameoflifemaniac wrote:Ok. Python finally started working, but some scripts don't work. When I run a rule generator, it says something like 'no module called ReadRuleTable'. But the files are in the glife folder! What is going on?
I have Python 2.7.15.
1) What version of Golly did you end up with, and is it 32-bit or 64-bit?
2) Exactly which rule generator script did you try to run?
I tried Python 2.7.15 for Golly 3.2 and it didn't work. Why?
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!
Re: A problem with Python
I asked first. To be fair, you did answer over thirty-three percent of my questions, but that's not enough to have much hope of answering your question.gameoflifemaniac wrote:Lol it works nowdvgrn wrote:1) What version of Golly did you end up with, and is it 32-bit or 64-bit?
2) Exactly which rule generator script did you try to run?
I tried Python 2.7.15 for Golly 3.2 and it didn't work. Why?
- gameoflifemaniac
- Posts: 1242
- Joined: January 22nd, 2017, 11:17 am
- Location: There too
Re: A problem with Python
Fine...dvgrn wrote:I asked first. To be fair, you did answer over thirty-three percent of my questions, but that's not enough to have much hope of answering your question.gameoflifemaniac wrote:Lol it works nowdvgrn wrote:1) What version of Golly did you end up with, and is it 32-bit or 64-bit?
2) Exactly which rule generator script did you try to run?
I tried Python 2.7.15 for Golly 3.2 and it didn't work. Why?
1) Golly 2.8 32-bit
2) None worked so that didn't matter.
EDIT: Ok, I know it's because for 64-bit Golly 3.2 I need 64-bit Python.
EDIT 2: I downloaded the 32-bit version of Golly 3.2, and Python still doesn't work. Why?
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!
Re: A problem with Python
Not sure. From what you've said I can deduce with about 90% confidence thatgameoflifemaniac wrote:EDIT 2: I downloaded the 32-bit version of Golly 3.2, and Python still doesn't work. Why?
- 32-bit Python 2.7.15 is working on your 32-bit install of Golly 2.8, including running rule generator scripts.
(Good -- about time!) - 32-bit Python 2.7.15 is apparently not working on your 32-bit install of Golly 3.2.
- gameoflifemaniac
- Posts: 1242
- Joined: January 22nd, 2017, 11:17 am
- Location: There too
Re: A problem with Python
It just can't load the Python library.
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!
Re: A problem with Python
Hm, I can't think of any differences in Golly's Python handling between 2.8 and 3.2 that would cause any kind of trouble like that.gameoflifemaniac wrote:It just can't load the Python library.
So my speculation would be that Golly 3.2 is finding a GollyPrefs file somewhere that's telling Golly to look in the wrong place for a Python dll. If you have a GollyPrefs file in your Golly 2.8 folder, and another GollyPrefs in your {username}/AppData/Roaming/Golly folder, for example, then maybe something like that could happen.
If you're in the mood to experiment, go into your 32-bit Golly 2.8 folder and rename the Golly.exe file there to something else, like "Golly.exp". Then copy in the Golly.exe from your 32-bit Golly 3.2 folder and try running it from there.
Better would be to do a search of your hard drive for all GollyPrefs files, and rename all the ones that you don't think you're using for anything -- call them, say, GollyPrefs.bak. See if Golly 3.2 is happier after that.
I'm suggesting renaming -- and also carefully making a list of the full path and file name of every file you rename, before and after you rename it -- because I definitely don't want your Golly 2.8 to stop working again! As long as you can rename everything back to exactly the way it is now, then any experiments should be safe and temporary.
Re: A problem with Python
Why does running a Python script close golly for me?
Re: A problem with Python
I forget now which of the permutations of 32-bit vs. 64-bit Python vs. Golly causes that behavior, but it's worth checking the GollyPrefs that Golly is using, and making sure it's really pointing to a Python DLL that matches the bittitude of the Golly executable.danny wrote:Why does running a Python script close golly for me?
Can't think of anything else offhand, but keep posting if the mystery continues (with the usual tedious OS, Golly, and Python details).
Re: A problem with Python
Does your script perhaps have an exit() or quit() in place of g.exit()?danny wrote:Why does running a Python script close golly for me?
I don't know how exactly Golly deals with embedded Python and the exception that is raised by exit()/quit, but from testing there are certain scenarios where it can cause the Golly app to close.
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.
Semi-active here - recovering from a severe case of LWTDS.
- Hdjensofjfnen
- Posts: 1743
- Joined: March 15th, 2016, 6:41 pm
- Location: re^jθ
Re: A problem with Python
I have my own problem:
Since I am not an administrator on my Windows computer I can't uninstall Python 3 from my computer.Golly warning: wrote:The Python library does not have this symbol:
Py_InitModule4
Code: Select all
x = 5, y = 9, rule = B3-jqr/S01c2-in3
3bo$4bo$o2bo$2o2$2o$o2bo$4bo$3bo!
Code: Select all
x = 7, y = 5, rule = B3/S2-i3-y4i
4b3o$6bo$o3b3o$2o$bo!
Re: A problem with Python
The admin vs. non-admin detail might or might not be an issue.Hdjensofjfnen wrote:I have my own problem:Since I am not an administrator on my Windows computer I can't uninstall Python 3 from my computer.Golly warning: wrote:The Python library does not have this symbol:
Py_InitModule4
I've had no difficulty having Python 2.7.x and Python 3.x installed on the same computer.
M.I. Wright reported the same error message, several years ago, and it seemed to have to do with Python 3.x being the only version installed.
So if you can get an admin to install Python 2.7.x on your system -- 32-bit or 64-bit, depending on what flavor of Golly you want to be running -- then Python scripts ought to start working for you.
- Hdjensofjfnen
- Posts: 1743
- Joined: March 15th, 2016, 6:41 pm
- Location: re^jθ
Re: A problem with Python
Turns out apparently I can install it without admin intervention, but the progress bar in the executable is stuck at 0%.
Code: Select all
x = 5, y = 9, rule = B3-jqr/S01c2-in3
3bo$4bo$o2bo$2o2$2o$o2bo$4bo$3bo!
Code: Select all
x = 7, y = 5, rule = B3/S2-i3-y4i
4b3o$6bo$o3b3o$2o$bo!
Re: A problem with Python
You can run the executable all right, and pick a folder for installation. But without admin rights, when the installer tries to write the first file it's probably stuck trying to display a pop-up "Sign in as admin" window ... that for whatever reason you can't see.Hdjensofjfnen wrote:Turns out apparently I can install it without admin intervention, but the progress bar in the executable is stuck at 0%. :?