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

Installing fails with an error message #16

Closed
ikselven opened this issue Aug 23, 2019 · 1 comment
Closed

Installing fails with an error message #16

ikselven opened this issue Aug 23, 2019 · 1 comment

Comments

@ikselven
Copy link
Contributor

@ikselven ikselven commented Aug 23, 2019

Hi,
installing PyRAT in a conda environment fails with an error message from Matplotlib.

Steps to reproduce:

  • clone this repository
  • create a new conda environment with conda env create -n pyratenv -f requirements.txt
  • activate the environment conda activate pyratenv
  • run python setup.py install --user

Expected Result:
The installation succeeds without any error.

Actual Result:
The installation fails, printing the following lines:

  INFO: LeeSigma cython module not found. (run build process?)
  INFO: LeeSigma2 cython module not found. (run build process?)
  INFO: N-Dimensional Beltrami cython modules not found. (run build process?)
  INFO: Bilateral module not found. (run build process?)
  INFO: SRAD cython module not found. (run build process?)
  INFO: EMDES cython module not found. (run build process?)
  INFO: IDANQ cython module not found. (run build process?)
  DEBUG: Loaded backend Qt5Agg version unknown.
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    import pyrat.lib.nlsar.nlsetup as nlsetup
  File "/home/user/Documents/PyRAT/pyrat/__init__.py", line 105, in <module>
    from . import filter
  File "/home/user/Documents/PyRAT/pyrat/filter/__init__.py", line 8, in <module>
    from .Spectrum import *
  File "/home/user/Documents/PyRAT/pyrat/filter/Spectrum.py", line 10, in <module>
    from pyrat.filter import Unweight
  File "/home/user/Documents/PyRAT/pyrat/filter/Unweight.py", line 2, in <module>
    matplotlib.use('Qt5Agg')
  File "/home/user/.local/share/anaconda3/envs/pyratenv/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 307, in wrapper
    return func(*args, **kwargs)
  File "/home/user/.local/share/anaconda3/envs/pyratenv/lib/python3.7/site-packages/matplotlib/__init__.py", line 1297, in use
    switch_backend(name)
  File "/home/user/.local/share/anaconda3/envs/pyratenv/lib/python3.7/site-packages/matplotlib/pyplot.py", line 230, in switch_backend
    newbackend, required_framework, current_framework))
ImportError: Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running

I've taken a look into what is causing this and found the following line to be the source of the error:

import matplotlib.pyplot # pseudo-import to suppress some unnecessary debug code

Removing this import lets the installation complete successfully.

@birgander2

This comment has been minimized.

Copy link
Owner

@birgander2 birgander2 commented Dec 3, 2019

This error is related to matplotlib, not PyRAT. You need to configure to use the qt5 backend, which is pretty much standard nowadays. You'll run into trobles if you remove this line, since pyplot is used in some places.

@birgander2 birgander2 closed this Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.