CodeMouse92 / Timecard

Track time beautifully.
https://codemouse92.github.io/Timecard/
BSD 3-Clause "New" or "Revised" License
31 stars 7 forks source link

Problem with shiboken and python 3.8 #19

Closed mosheduminer closed 4 years ago

mosheduminer commented 4 years ago

Timecard failed silently on startup on my windows machine (windows 10, python 3.8). However, by running python timecard-app.exe, I received the following error message:

Traceback (most recent call last):
  File "C:\Users\moshe\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\moshe\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "timecard-app.exe\__main__.py", line 4, in <module>
  File "C:\Users\moshe\AppData\Local\Programs\Python\Python38\lib\site-packages\timecard\__main__.py", line 11, in <module>
    from timecard.interface import interface
  File "C:\Users\moshe\AppData\Local\Programs\Python\Python38\lib\site-packages\timecard\interface\interface.py", line 8, in <module>
    from timecard.interface.app import App
  File "C:\Users\moshe\AppData\Local\Programs\Python\Python38\lib\site-packages\timecard\interface\app.py", line 12, in <module>
    from PySide2.QtWidgets import QApplication, QVBoxLayout, QWidget
  File "C:\Users\moshe\AppData\Local\Programs\Python\Python38\lib\site-packages\PySide2\__init__.py", line 51, in <module>
    _setupQtDirectories()
  File "C:\Users\moshe\AppData\Local\Programs\Python\Python38\lib\site-packages\PySide2\__init__.py", line 21, in _setupQtDirectories
    import shiboken2
  File "C:\Users\moshe\AppData\Local\Programs\Python\Python38\lib\site-packages\shiboken2\__init__.py", line 27, in <module>
    from .shiboken2 import *
ImportError: DLL load failed while importing shiboken2: The specified procedure could not be found.

This appears to be a shiboken with python 3.8 issue, according to this stack overflow answer. Since the import error involves a DLL, I assume it is also a windows-only problem.

Since this is a shiboken problem, I suppose not much can be done, but I think fair warning should be given that timecard won't work on windows with python 3.8.

CodeMouse92 commented 4 years ago

Thanks so much for the report!

I do know about this. It's a known bug in PySide2 in relation to 3.8.0, and it's been addressed in a later version of PySide2. Unfortunately, it's beyond my direct control. This has a similar form on Linux that was mostly addressed by PySide2 v5.14.0.

The only thing I can recommend is to either use Python 3.7 or Python 3.8.1. You can have both installed on your machine at the same time, and then can start Timecard with 3.7 specifically with...

python3.7 timecard-app.exe

I plan to ensure the PyInstaller script explicitly uses Python 3.7 to get around this; that will form the basis for the official Windows release (with installer).

TamGamer97 commented 3 years ago

i am using python 3.7.5 and i am getting an error saying the following: :-1: error: ImportError: DLL load failed while importing shiboken2: The specified procedure could not be found. can someone help me please

CodeMouse92 commented 3 years ago

@TamGamer97 Assuming you installed from pip, run the following...

pip install --upgrade pyside2

That will ensure you have the latest PySide2. Then try to run Timecard again.

If you still have errors, please open a new Issue, and include the versions of the dependencies, which you can find via...

pip freeze

Thank you.