spacetelescope / wss_tools

Python tools for JWST Wavefront Sensing Software
https://wss-tools.readthedocs.io
BSD 3-Clause "New" or "Revised" License
11 stars 10 forks source link

Add PyQt to setup.py install_requires #60

Closed laurenmarietta closed 4 years ago

laurenmarietta commented 5 years ago

I've run into this problem now a number of times while trying to install wss_tools. I get the following traceback:

> quip quip_wcs_test/ops_file_congrid2048_assignwcs.xml 
Traceback (most recent call last):
  File "/Users/lchambers/miniconda3/envs/mirage/lib/python3.6/site-packages/qtpy/__init__.py", line 204, in <module>
    from PySide import __version__ as PYSIDE_VERSION  # analysis:ignore
ModuleNotFoundError: No module named 'PySide'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/lchambers/miniconda3/envs/mirage/bin/quip", line 10, in <module>
    sys.exit(_main())
  File "/Users/lchambers/miniconda3/envs/mirage/lib/python3.6/site-packages/wss_tools/quip/main.py", line 430, in _main
    main(sys.argv[1:])
  File "/Users/lchambers/miniconda3/envs/mirage/lib/python3.6/site-packages/wss_tools/quip/main.py", line 185, in main
    gmain.reference_viewer(sys_args)
  File "/Users/lchambers/miniconda3/envs/mirage/lib/python3.6/site-packages/ginga/rv/main.py", line 715, in reference_viewer
    viewer.main(options, args)
  File "/Users/lchambers/miniconda3/envs/mirage/lib/python3.6/site-packages/ginga/rv/main.py", line 355, in main
    ginga_toolkit.choose()
  File "/Users/lchambers/miniconda3/envs/mirage/lib/python3.6/site-packages/ginga/toolkit.py", line 75, in choose
    from ginga.qtw import QtHelp  # noqa
  File "/Users/lchambers/miniconda3/envs/mirage/lib/python3.6/site-packages/ginga/qtw/QtHelp.py", line 35, in <module>
    from qtpy import QtCore
  File "/Users/lchambers/miniconda3/envs/mirage/lib/python3.6/site-packages/qtpy/__init__.py", line 210, in <module>
    raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found

I fix this by installing PyQt, so I think this error could be avoided by adding PyQt5 to the install_requires list in setup.py.

pllim commented 5 years ago

That sounds reasonable. Since you already did the work, do you want to open a pull request to this repo? Thanks!

laurenmarietta commented 5 years ago

Given that this is my last week at ST, I'm quite swamped and don't have the time to do that right now - but I hope it will be an easy addition!

pllim commented 5 years ago

Actually, thinking about this more, Qt is a non-Python library. qtpy or PyQt is a Python wrapper around it. I am not sure if PyPI can pull down the underlying Qt library by just having it in setup.py. conda pulls it down but not pip, I think.

How exactly did you install wss_tools? Did you follow exactly the instructions at https://wss-tools.readthedocs.io/en/latest/wss_tools/install.html ?

pllim commented 4 years ago

If someone else run into this problem and can provide more info, please open a new issue.