trouble with anaconda install

199 views
Skip to first unread message

Eric Leroy

unread,
Apr 12, 2018, 8:08:49 AM4/12/18
to hyperspy-users
Hi,
I work on MacOS and I want to use hyperspy with Anaconda distribution.
I proceeded like this :
  1. install Anaconda
  2. create hyperspy environment with the following command : conda create -n hyperspy python=3.5 anaconda
  3. switch to hyperspy environment : conda activate hyperspy
  4. install hyperspy : conda install hyperspy -c conda-forge
  5. launch a Jupyter notebook (jupyter noteook) then create a python 3 notebook
  6. then launch the commands to start hyperspy as written in the documentation :
    1. %matplotlib qt
    2. import numpy as np
    3. import matplotlib.pyplot as plt
    4. import hyperspy.api as hs
  7. for the last command, I have the following message from python :
    1. /Users/ericleroy/anaconda3/envs/hspy35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
        from ._conv import register_converters as _register_converters
      WARNING:hyperspy.api:The ipywidgets GUI elements are not available, probably because the hyperspy_gui_ipywidgets package is not installed.
      WARNING:hyperspy.api:The traitsui GUI elements are not available, probably because the hyperspy_gui_traitui package is not installed.
  8. If I continue and for exampla want to load data with s=hs.load(), I have the following error message :
    1. ---------------------------------------------------------------------------
      ImportError                               Traceback (most recent call last)
      <ipython-input-7-190d830d3818> in <module>()
      ----> 1 s=hs.load()
      
      ~/anaconda3/envs/hspy35/lib/python3.5/site-packages/hyperspy/io.py in load(filenames, signal_type, stack, stack_axis, new_axis_name, lazy, **kwds)
          166         from hyperspy.signal_tools import Load
          167         load_ui = Load()
      --> 168         get_gui(load_ui, toolkey="load")
          169         if load_ui.filename:
          170             filenames = load_ui.filename
      
      ~/anaconda3/envs/hspy35/lib/python3.5/site-packages/hyperspy/ui_registry.py in get_gui(self, toolkey, display, toolkit, **kwargs)
           87     if not TOOLKIT_REGISTRY:
           88         raise ImportError(
      ---> 89             "No toolkit registered. Install hyperspy_gui_ipywidgets or "
           90             "hyperspy_gui_traitsui GUI elements. If hyperspy_gui_traits"
           91             "is installed, initialize a toolkit supported by traitsui "
      
      ImportError: No toolkit registered. Install hyperspy_gui_ipywidgets or hyperspy_gui_traitsui GUI elements. If hyperspy_gui_traitsis installed, initialize a toolkit supported by traitsui before importing HyperSpy.
    2. I tried to install hyperspy_gui_traitsui and hyperpy_gui_ipywidgets with pip and the error is not solved.

Do ou have any idea on how to solve the problem or can you tell me what I am doing worng?

Thank you

Best regards,

Eric

Thomas Aarholt

unread,
Apr 12, 2018, 8:22:17 AM4/12/18
to hyperspy-users
Can you try running it in the notebook again, but replacing the @matplotlib qt with @matplotlib notebook ? 

--
You received this message because you are subscribed to the Google Groups "hyperspy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hyperspy-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Leroy

unread,
Apr 12, 2018, 11:05:48 AM4/12/18
to hyperspy-users
if I do this, I have no warning when I import hyperspy but when I want to open data with s=hs.load(), I have this error message :
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-9-190d830d3818> in <module>()
----> 1 s=hs.load()

~/anaconda3/envs/hs14/lib/python3.5/site-packages/hyperspy/io.py in load(filenames, signal_type, stack, stack_axis, new_axis_name, lazy, **kwds)
    166         from hyperspy.signal_tools import Load
    167         load_ui = Load()
--> 168         get_gui(load_ui, toolkey="load")
    169         if load_ui.filename:
    170             filenames = load_ui.filename

~/anaconda3/envs/hs14/lib/python3.5/site-packages/hyperspy/ui_registry.py in get_gui(self, toolkey, display, toolkit, **kwargs)
    144         raise NotImplementedError(
    145             "There is no user interface registered for this feature."
--> 146             "Try installing {}.".format(propose))
    147     if not display:
    148         widgets = {}

NotImplementedError: There is no user interface registered for this feature.Try installing hyperspy_gui_traitsui.

Josh Taillon

unread,
Apr 12, 2018, 11:11:13 AM4/12/18
to hypersp...@googlegroups.com
Eric, that sounds like it might be working, because we do not have a loader implemented using the "ipywidgets" GUI base. You have to provide a string to the file path like hs.load("my_file.dm3").

If you want to get the traitsui working, can you try uninstalling through pip (pip uninstall hyperspy_gui_traitsui) and installing through conda (conda install hyperspy-gui-traitsui -c conda-forge). Assuming that works, try running `import hyperspy_gui_traitsui` directly to see if it generates any errors that could help explain the situation.

Also, feel free to jump onto the gitter chat (https://gitter.im/hyperspy/hyperspy) for more interactive assistance.

To unsubscribe from this group and stop receiving emails from it, send an email to hyperspy-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Joshua Taillon

Eric Leroy

unread,
Apr 12, 2018, 11:44:25 AM4/12/18
to hyperspy-users
Hi,
When I type import hyperspy_gui_traitsui, I have this error :
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-8-be6e20052baf> in <module>()
----> 1 import hyperspy_gui_traitsui

ImportError: No module named 'hyperspy_gui_traitsui'

Josh Taillon

unread,
Apr 12, 2018, 11:51:57 AM4/12/18
to hypersp...@googlegroups.com
Interesting... Even after installing through conda?

Can you post the output of `conda list | grep hyper` and `pip show hyperspy-gui-traitsui`?

--
You received this message because you are subscribed to the Google Groups "hyperspy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hyperspy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Joshua Taillon
Reply all
Reply to author
Forward
0 new messages