SHARPpy
SHARPpy copied to clipboard
[BUG] name 'PYQT6' is not defined
Before submitting an issue to Github about SHARPpy, please follow the below checklist to ensure that your issue can be resolved quickly.
- [x] No other issues either open or closed describe what I'm reporting.
- [x] I have checked to see if my issue has been resolved in a new version of SHARPpy.
- [x] I have filled out the below information in as much detail as possible using dates, numbers, directions, pictures, etc.
- [x] I have checked the SHARPpy documentation to make sure I'm doing things correctly, and my problem doesn't exist between my monitor and chair.
- [ ] I have attached the log and config files from the ~/.sharppy folder. If no log files exist, I have run the program in debug mode (e.g., sharppy --debug).
The management team for SHARPpy is a small team of volunteers. Being as thorough as possible with your issue submission will help us help you!
Describe the bug When starting sharppy it instantly returns with the traceback:
Traceback (most recent call last):
File "F:\z0bin\miniconda3\envs\sharpie\Scripts\sharppy-script.py", line 6, in <module>
from runsharp.full_gui import main
File "F:\z0bin\miniconda3\envs\sharpie\lib\site-packages\runsharp\full_gui.py", line 8, in <module>
from sharppy.viz.map import MapWidget
File "F:\z0bin\miniconda3\envs\sharpie\lib\site-packages\sharppy\viz\__init__.py", line 1, in <module>
from .skew import plotSkewT
File "F:\z0bin\miniconda3\envs\sharpie\lib\site-packages\sharppy\viz\skew.py", line 11, in <module>
from qtpy.QtOpenGL import *
File "F:\z0bin\miniconda3\envs\sharpie\lib\site-packages\qtpy\QtOpenGL.py", line 14, in <module>
elif PYQT6:
NameError: name 'PYQT6' is not defined
(sharpie) PS C:\Users\jake9>
Versioning Information (please complete the following information):
- OS: Win 10 x64
- SHARPpy Version: 1.4.0
- Dependency Versions: qtpy-2.0.0-pyhd8ed1ab_0
- Screen dimensions 1920x1080
- SHARPpy distribution type: conda
Hi @jake9wi - thank you so much for providing this information and filling out the form! I'm able to help you pretty easily here. It looks like this is an issue where the qtpy library is anticipating Qt6 is available, and I haven't updated the conda recipe yet to account for that. Would you be able to show me your anaconda environment and the log files? Use the conda list command.
You may also find some success by telling SHARPpy to use Qt5, which can be done via export QT_API=PySide2 on Mac/Linux via the bash shell and setx QT_API "PySide2" on Windows.
I tried setting the env variable as suggested and got the same traceback.
(sharpie) PS C:\Users\jake9> conda list
# packages in environment at F:\z0bin\miniconda3\envs\sharpie:
#
# Name Version Build Channel
brotlipy 0.7.0 py39hb82d6ee_1003 conda-forge
bzip2 1.0.8 h8ffe710_4 conda-forge
ca-certificates 2021.10.8 h5b45459_0 conda-forge
certifi 2021.10.8 py39hcbf5309_1 conda-forge
cffi 1.15.0 py39h0878f49_0 conda-forge
charset-normalizer 2.0.9 pyhd8ed1ab_0 conda-forge
cryptography 36.0.1 py39h7bc7c5c_0 conda-forge
icu 68.2 h0e60522_0 conda-forge
idna 3.1 pyhd3deb0d_0 conda-forge
intel-openmp 2022.0.0 h57928b3_3663 conda-forge
jpeg 9d h8ffe710_0 conda-forge
libblas 3.9.0 12_win64_mkl conda-forge
libcblas 3.9.0 12_win64_mkl conda-forge
libclang 11.1.0 default_h5c34c98_1 conda-forge
libffi 3.4.2 h8ffe710_5 conda-forge
libiconv 1.16 he774522_0 conda-forge
liblapack 3.9.0 12_win64_mkl conda-forge
libpng 1.6.37 h1d00b33_2 conda-forge
libxml2 2.9.12 hf5bbc77_1 conda-forge
libxslt 1.1.33 h65864e5_3 conda-forge
libzlib 1.2.11 h8ffe710_1013 conda-forge
mkl 2021.4.0 h0e2418a_729 conda-forge
numpy 1.21.5 py39h6331f09_0 conda-forge
openssl 1.1.1l h8ffe710_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pip 21.3.1 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pyopenssl 21.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.6 pyhd8ed1ab_0 conda-forge
pyside2 5.13.2 py39hc084194_4 conda-forge
pysocks 1.7.1 py39hcbf5309_4 conda-forge
python 3.9.9 h9a09f29_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
qt 5.12.9 h5909a2a_4 conda-forge
qtpy 2.0.0 pyhd8ed1ab_0 conda-forge
requests 2.26.0 pyhd8ed1ab_1 conda-forge
setuptools 60.2.0 py39hcbf5309_0 conda-forge
sharppy 1.4.0 py39hde42818_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
sqlite 3.37.0 h8ffe710_0 conda-forge
tbb 2021.5.0 h2d74725_0 conda-forge
tk 8.6.11 h8ffe710_1 conda-forge
tzdata 2021e he74cb21_0 conda-forge
ucrt 10.0.20348.0 h57928b3_0 conda-forge
urllib3 1.26.7 pyhd8ed1ab_0 conda-forge
vc 14.2 hb210afc_5 conda-forge
vs2015_runtime 14.29.30037 h902a5da_5 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
win_inet_pton 1.1.0 py39hcbf5309_3 conda-forge
xz 5.2.5 h62dcd97_1 conda-forge
zlib 1.2.11 h8ffe710_1013 conda-forge
I am experiencing the exact same issue as well.
I was able to reproduce this problem by installing SHARPpy via conda and then running SHARPpy via "conda run sharppy".
@jake9wi and @jkrasting - I got past this problem by installing an older version of qtpy (version 1.10.0). You can install version 1.10.0 of qtpy by executing the following command in your conda environment:
conda install qtpy=1.10.0
If you get prompted to proceed while installing the package, be sure to enter y to proceed. When the install of the older qtpy is finished, try running SHARPpy again.
Thanks @skovic - I tried this. It no longer throws an exception, but it just hangs on startup.
(FYI - I am on an Intel Mac running MacOS Monterey)
@jkrasting If you look at the .sharppy subdirectory in your home directory, does sharppy.log have any error messages or exceptions present? Also if there is a sharppy-out.txt file, does it have any contents?
@skovic Setting qtpy=1.10.0 fixed it for me also.
@skovic -Nothing pops out at me. I've attached the sharppy.log file. I've also attached a picture of the hanging window and my conda environment. There is no sharppy-out.txt file.
conda_list.txt sharppy_log.txt
.
@jkrasting Looking at the log file, I don’t think that the program is hung. I think what you have is a pop up window that is notifying you that there is a new version available (see log message below); it’s just that the window hasn’t rendered properly.
022-01-12 08:10:11,609 /Users/krasting/miniconda3/envs/sharppy/lib/python3.7/site-packages/runsharp/full_gui.py main Line #: 1212 INFO A newer release of SHARPpy was found on Github Releases.
I see this same message on my Windows 10 system until I select one of the options on the pop up window.
Try this:
- Run SHARPpy.
- When this blank window appears, press the enter key on your keyboard.
- On my machine, this opens up my browser taking me to the site to download a new version.
- Wait a min or so, and SHARPpy eventually opens up.
If you still get a blank window it probably means that there is some sort of incompatibility between your version of Mac OS and one of the conda/python packages.
Thanks. I tried hitting “enter”, but it didn't work. I have the spinning rainbow wheel in MacOS, so it appears to be hung.
@jkrasting I've been trying to track down this issue myself. It looks like MacOS requires an extra environment variable. A temporary fix is to set this environment variable in the shell before executing SHARPpy.
export QT_MAC_WANTS_LAYER=1
I'm working on a pull request to fix this issue more permanently.
Nice find! I’ll give it a try …
@keltonhalbert - I can confirm this temporary fix works