Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.6.0 - Launch error #100

Closed
THEtomaso opened this issue Feb 14, 2019 · 14 comments
Closed

v2.6.0 - Launch error #100

THEtomaso opened this issue Feb 14, 2019 · 14 comments

Comments

@THEtomaso
Copy link

THEtomaso commented Feb 14, 2019

Issue:

PySol Fan Club edition v2.6.0 crashes at startup.

Log:

Traceback (most recent call last):
  File "pysol.py", line 36, in <module>
  File "C:\projects\pysolfc\pysollib\main.py", line 30, in <module>
  File "C:\projects\pysolfc\pysollib\app.py", line 32, in <module>
  File "C:\projects\pysolfc\pysollib\images.py", line 28, in <module>
  File "C:\projects\pysolfc\pysollib\pysoltk.py", line 45, in <module>
  File "C:\projects\pysolfc\pysollib\tile\toolbar.py", line 29, in <module>
  File "C:\projects\pysolfc\pysollib\ui\tktile\menubar.py", line 7, in <module>
  File "C:\projects\pysolfc\pysollib\hint.py", line 36, in <module>
  File "C:\projects\pysolfc\pysollib\util.py", line 26, in <module>
ImportError: No module named 'site'

(Win8.1Pro,x64)

@kingjon3377
Copy link
Contributor

I see a related crash at startup on Mac OS X Sierra. It shows a dialog box saying "PySolFC Error" with buttons "Open Console" and "Terminate" (and no other text); if I invoke the PySolFC binary embedded in the .app directly from the command line, the following stack trace is printed to the console:

Traceback (most recent call last):
  File "/Users/kingjon/Downloads/PySolFC.app/Contents/Resources/__boot__.py", line 386, in <module>
    _run()
  File "/Users/kingjon/Downloads/PySolFC.app/Contents/Resources/__boot__.py", line 370, in _run
    exec(compile(source, path, 'exec'), globals(), globals())
  File "/Users/kingjon/Downloads/PySolFC.app/Contents/Resources/pysol.py", line 41, in <module>
    sys.exit(main(sys.argv))
  File "pysollib/main.pyc", line 414, in main
  File "pysollib/main.pyc", line 195, in pysol_init
  File "pysollib/util.pyc", line 106, in __init__
AttributeError: module 'site' has no attribute 'PREFIXES'
2019-02-14 19:16:04.532 PySolFC[64098:772602] PySolFC Error

@shlomif
Copy link
Owner

shlomif commented Feb 15, 2019

Thanks for the report. @Programator2 : any idea how we can include https://docs.python.org/3/library/site.html in the windows installer? The macOS error is more strange because https://docs.python.org/3/library/site.html clearly specifies a PREFIX var.

@Programator2
Copy link
Collaborator

site module is explicitly excluded by py2exe (see windows_excludes in py2exe/hook.py). Presumably in older Python versions it wasn't part of the Windows Python distribution. However, I see that it's present in 3.4, which is used to create the Windows binary.

One solution that would work but is quite ugly is to manually insert the compiled site and _sitebuiltins modules into library.zip.

I can do it if no one comes up with a better solution.

@shlomif
Copy link
Owner

shlomif commented Feb 15, 2019 via email

@kingjon3377
Copy link
Contributor

The macOS error is more strange because docs.python.org/3/library/site.html clearly specifies a PREFIX var.

I dug through the Travis log to find out how the .app was built, and found a "stripped-down" site.py in the py2app source code, which does not contain the string "prefix" at all.

shlomif added a commit that referenced this issue Feb 16, 2019
It does not provide site.PREFIXES .
@KarolS
Copy link

KarolS commented Feb 16, 2019

I just had the same problem. I recommend removing the Windows installer download from Sourceforge until the problem is fixed.

@shlomif
Copy link
Owner

shlomif commented Feb 16, 2019

@KarolS : hi, I made the 2.4.0 installer the default for now for windows.

@shlomif
Copy link
Owner

shlomif commented Feb 17, 2019

@Programator2 : for v2.6.1 I implemented a workaround for importing site in 8a93f4b , but now the appveyor build fails - https://help.appveyor.com/discussions/problems/20470-downloads-from-sourceforgenet-started-failing .

@Programator2
Copy link
Collaborator

According to the log, sourceforge.net was unavailable. Run the build again, it should work now.

@shlomif
Copy link
Owner

shlomif commented Feb 17, 2019

@Programator2 : the failure is likely not your fault but it still happens after rebuilding.

@shlomif
Copy link
Owner

shlomif commented Feb 18, 2019

Hi all! 2.6.1 hopefully fixes it - please test - https://sourceforge.net/projects/pysolfc/files/PySolFC/PySolFC-2.6.1/ - thanks!

@kingjon3377
Copy link
Contributor

I can confirm that the 2.6.1 MacOS .app no longer crashes with the symptoms described above. (But it still doesn't start properly; I'll open a new issue with the details of that.)

@shlomif
Copy link
Owner

shlomif commented Feb 18, 2019

@kingjon3377 : thanks for the info.

@THEtomaso
Copy link
Author

This fixes the crash under Windows too!
Well done!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants