lukasmonk / lucaschessR2

Lucas Chess R Version 2
GNU General Public License v3.0
268 stars 40 forks source link

lucas "R" version doesn't start for me #59

Closed ahahahaah closed 1 year ago

ahahahaah commented 1 year ago

hi i use only portable versions (no installations)

at the bottom of this page https://lucaschess.pythonanywhere.com/downloads_previous when i start the last version which is not the R version: "version 11.17" the program works. but when i launch any of the "R" version the program crashes at the launch.

what changed in the "R" version that doesnt work with my system (win7 pro 64bits, which is considered as compatible)? there is a note that says that the R version is not compatible with win xp, but im not even in this case.

lukasmonk commented 1 year ago

I have not received any further incidents regarding this issue. Version 11.17 is compiled with python 2.7 Version R is compiled with python 3.7 Do you know something about python? if so I can help you to find the problem because I can´t replicate it.

ahahahaah commented 1 year ago

no i'm not a programer. but this means that my system has a problem with python 3.7? do you think i can uninstall it and reinstall a "clean" version of python?

Xyrio commented 1 year ago

still same crash as in #30 ? wild guess: try unplugging all usb? try reinstall/repair vcredist https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 google ucrtbase.dll and see what problems/solutions are related to it.

i have win 7 sp1 64 (german) and it works.

you seem to have french? could it be some codepage problem related to french specific letters? like the folder structure you try to run from, does it have non english letters? i tried with german specific letter and space in folder name but still worked.

the one that i have that works is: C:\Windows\System32\ucrtbase.dll version 10.0.14393.2990 size 994.384 Bytes

ahahahaah commented 1 year ago

yeah it's the same crash i checked the C:\Windows\System32\ucrtbase.dll and the version is not the same as yours mine is 10.0.14393.2247 size 998.912 Bytes

i installed some vcredist x64 from the link you give but none of them changes the version of my ucrtbase.dll

but according to what lukasmonk said, the changements from version 11.17 to version R is the Python version. so it seems that the issue is something here, in my case.

lukasmonk commented 1 year ago

You could remove ucrtbase.dll from bin folder in the LucasChessR/bin folder

lukasmonk commented 1 year ago

Someone (Eric) told me that this was solved in his case by launching the sfc /scannow command in a cmd window.

Xyrio commented 1 year ago

my environment has python 3.8.9 but LucasR uses its own bundled python. and since ucrtbase.dll is also bundled it is unlikely to be the problem as they r the same for both of us.

Xyrio commented 1 year ago

well if i rename the bin\ucrtbase.dll then lucasr.exe runs but gui never appears.

lukasmonk commented 1 year ago

You could copy C:\Windows\System32\ucrtbase.dll to lucasChessR\bin

Xyrio commented 1 year ago

yes, that is equivalent and same effect for me. i tried too.

Xyrio commented 1 year ago

well if nothing works you can still get virtualbox and ubuntu live cd then run lucasr on linux :)

Xyrio commented 1 year ago

hmm seem i permanently broke all lucasr. even old 2.04 wont start now after the ucrtbase.dll experiment. even though i resotred the original file.

Xyrio commented 1 year ago

hmm weird there still seems to be some kind of interaction with the python version installed in the environment. i renamed my environment python.exe so it cannot be found and then it startet again. @ahahahaah try this too. also empty your %tmp% as much as possible. something might be cached sometimes. there is also the windows compatibility mode you could try. then there is C:\Windows\Prefetch\lucasr.exe* files you could delete.

wow what a mess. as long as my python 3.8.9 can be found in the environment lucasr just runs in the background without any gui. removing it from path doesnt help either, it must be some king of registry key that is read.

Xyrio commented 1 year ago

ah nvm it was my configured external engines ( ExtEngines.pk ) somehow broke. external engines used external pythong.

ahahahaah commented 1 year ago

thanks for trying to help. indeed, none of these solutions work in my case. while reading your posts i was thinking about something.

is is possible to "ignore" the integrated python of the program and force to use the python on my system? if yes, how can i do that?

Xyrio commented 1 year ago

doubtful but @lukasmonk might know something.

you can try to download same python 3.7 version lucasr uses and run it standalone to see what problem it has on your system. however if 3.7 has a problem it would not be surprising if 3.8 or other versions also have the same problem.

lukasmonk commented 1 year ago

You could do the following:

  1. Install python 3.7
  2. Download the sources https://github.com/lukasmonk/lucaschessR2/archive/refs/heads/main.zip, and uncompress
  3. In a cmd, and in the LucasChessR folder, run: pip install -r requirements.txt
  4. In the LucasChessR/bin folder: pythonw LucasR.py
ahahahaah commented 1 year ago

i have a message that says "pip" command is unknown

lukasmonk commented 1 year ago

In a bat, PATH=;\Scripts pip install -r requirements.txt

ahahahaah commented 1 year ago

i dont know if it worked or not but a window opened and closed immediately so i have tryed your next step "In the LucasChessR/bin folder: pythonw LucasR.py" but i have a message that said pythonw is an unknown command (like it was said for the command pip)

ahahahaah commented 1 year ago

shit i have not installed python 3.7 (the 1st step) let me restart, i will come back again im idiot

ahahahaah commented 1 year ago

after the pip command image

and after the pythonw command image nothing else

lukasmonk commented 1 year ago

The pip command must finish without errors. Download from https://www.lfd.uci.edu/~gohlke/pythonlibs/ psutil: imagen

then pip install [path file downloaded]

ahahahaah commented 1 year ago

i have a 64bits processor, you sure i should get the win32 version?

lukasmonk commented 1 year ago

Yes.

ahahahaah commented 1 year ago

here is what i obtain image

lukasmonk commented 1 year ago

Do you have more python installed? Go to the python3.7 folder, Scripts subfolder and try again.

ahahahaah commented 1 year ago

i don't find the python3.7 folder ^^ what is the normal path?

Xyrio commented 1 year ago

python -V python -c "import os, sys; print(os.path.dirname(sys.executable))"

lukasmonk commented 1 year ago

c:\Program Files (x86)\Python37-32\

Xyrio commented 1 year ago

fyi: python-3.7.9-amd64.exe tried to install to my users %appdata%\..\Local\Programs\Python\Python37

ahahahaah commented 1 year ago

yeah i have found it here C:\Users\ok\AppData\Local\Programs\Python\Python37\Scripts what should i do with this folder?

Xyrio commented 1 year ago

i guess you should get the 32bit version otherwise you will end up having same problems as me ( #56 )

lukasmonk commented 1 year ago

I leave a link valid only for today: https://www.filemail.com/d/agwvjqambbyorgh Unzip, then exec : WinPython Command Prompt.exe from the folder created, a command prompt appear, then exec LucasR.bat

I have downloaded Winpython with 3.7.7 version of python Then I have downloaded the LucasChessR2 sources from GitHub, then I have copied it as a subfolder of winpython I have executing WinPython Command Prompt.exe, I have gone to Lucaschessr2, then pip install -r requirements.txt

Xyrio commented 1 year ago

i downloaded official: https://www.python.org/downloads/release/python-379/ lets see how far i get

there is also this: https://sourceforge.net/projects/winpython/files/WinPython_3.7/3.7.7.1/ the 32 one...

Xyrio commented 1 year ago

i runs for me with official. now testing other one... works

ahahahaah commented 1 year ago

i dont know if i had done things correctly ive unzipped the file and run the winpython command prompt.exe and directly typed lucasr.bat image

Xyrio commented 1 year ago

try uninstall the previously installed python 64 bit if it is still there? then start the winpython prompt new and try again.

Xyrio commented 1 year ago

also see if set PYTHONHOME is empty or not. type in console set py to list all variables starting with py. there are possibly some more. just for checking.

Xyrio commented 1 year ago

well if PYTHONHOME exists you need to remove it (only remove PYTHONHOME) from the environment variables:

hotkey: winkey + pause -> advanced system settings -> advanced (3rd tab) -> environment variables windows... in the next window find it in one of the 2 lists then delete it and press ok on both windows.

if it is a system variable you might need to restart windows pc to take effect.

tutorial on youtube for environment variables: https://www.youtube.com/watch?v=bEroNNzqlF4

ahahahaah commented 1 year ago

1st ive uninstalled python, previously installed same effect when i launch lucasr.py. the error message talks about "no module named 'encodings' " so maybe i have something not installed in my system?

2nd i don't understand what pythonhome is i have typed "set py" in the winpython command prompt.exe here is the result image

Xyrio commented 1 year ago

PYTHONHOME can cause the exception you have (tried it myself and i get your exception). but you dont have it so hmm

source: https://github.com/python/cpython/issues/71241#issuecomment-1093715201

Xyrio commented 1 year ago

check if PATH has any other python folders set PATH

Xyrio commented 1 year ago

try removing the PYTHON one. after you start the winpython console do: set PYTHON= that temporary removes it for the current window, then python -c "print('test')" to confirm that python works at all then try lucasr.bat

ahahahaah commented 1 year ago

the test failed image wwwhen i lunch it i have the crash

Xyrio commented 1 year ago

unseting python failed: there is a = after set python like set python= otherwise i am out of ideas for now :)

but that tells us that python itself has a problem.

ahahahaah commented 1 year ago

it's already a precious information, thanks

Xyrio commented 1 year ago

well one thing to try would be to set the var: set PYTHONHOME=C:\Users\ok\Desktop\WPy32-3771\python-3.7.7\ python -c "print('test')"

Xyrio commented 1 year ago

since it cannot find stuff maybe telling it directly where to look helps:

set PYTHONHOME=C:\Users\ok\Desktop\WPy32-3771\python-3.7.7\
set PYTHONPATH=C:\Users\ok\Desktop\WPy32-3771\python-3.7.7\Lib
python -c "print('test')"
ahahahaah commented 1 year ago

hey with the pythonhome command now the print test command works!! :D and now when i launch lucasr.py i don't have the same behaviour than previously image