ilastik / ilastik-napari

ilastik plugin for napari
MIT License
13 stars 2 forks source link

Can't start Ilastik simple_labeling example #2

Closed rdemets closed 3 years ago

rdemets commented 3 years ago

Hi.

I am quite new to Napari and I've used Ilastik as a stand-alone software, but I wanted to try within the Napari N-dimensional environment.

I created an environment using the conda command : conda create --yes --name napari-ilastik --strict-channel-priority --channel ilastik-forge --channel conda-forge --channel nodefaults 'python=3.7' fastfilters

Then activated the environment and installed napari[all]. But when I tried to run the python code examples/simple_labeling.py, I got a KeyError : "Plugin 'napari_experimental_provide_dock_widget' does not provide any dock widgets"

I don't know if this comes from the newer Napari version or if I installed it wrongly. Please advice. Thank you very much.


Traceback (most recent call last): File ".\examples\simple_labeling.py", line 23, in main() File ".\examples\simple_labeling.py", line 18, in main viewer.window.add_plugin_dock_widget("napari_experimental_provide_dock_widget") File "D:\mbirdm\Napari\napari-ilastik\lib\site-packages\napari_qt\qt_main_window.py", line 963, in add_plugin_dock_widget plugin_name, widget_name File "D:\mbirdm\Napari\napari-ilastik\lib\site-packages\napari\plugins_plugin_manager.py", line 476, in get_widget raise KeyError(msg) KeyError: "Plugin 'napari_experimental_provide_dock_widget' does not provide any dock widgets"

emilmelnikov commented 3 years ago

I think this is because you didn't install this plugin into the environment. If you ran only pip install napari[all] without doing something like pip install -e ., you've only installed napari without the plugin itself, therefore, napari doesn't know where to look when the example script tries to add a dock widget.

Sorry for unclear installation instructions. I've updated the README, so there's hopefully less confusion now.

rdemets commented 3 years ago

Thanks a lot. It looks much clearer, but I got more errors. I found on forums reports of this, mentioning to install setuptools, but it didn't solve my problem. Sorry about that.

-----
Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/tmpiyrlpl46
       cwd: /Users/nus/Desktop/Napari-envs/napari-ilastik-main
  Complete output (36 lines):
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
      main()
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 117, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 155, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 135, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 3, in <module>
      setuptools.setup()
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools/dist.py", line 456, in __init__
      k: v for k, v in attrs.items()
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 281, in __init__
      self.finalize_options()
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools/dist.py", line 807, in finalize_options
      ep(self)
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools_scm/integration.py", line 59, in infer_version
      dist.metadata.version = _get_version(config)
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools_scm/__init__.py", line 173, in _get_version
      parsed_version = _do_parse(config)
    File "/private/var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/pip-build-env-z5cj0crf/overlay/lib/python3.6/site-packages/setuptools_scm/__init__.py", line 142, in _do_parse
      "use git+https://github.com/user/proj.git#egg=proj" % config.absolute_root
  LookupError: setuptools-scm was unable to detect version for '/Users/nus/Desktop/Napari-envs/napari-ilastik-main'.

  Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

  For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
  ----------------------------------------
WARNING: Discarding file:///Users/nus/Desktop/Napari-envs/napari-ilastik-main. Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/tmpiyrlpl46 Check the logs for full command output.
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/k2/cjdqf2jj64z662s7yr5jprw00000gn/T/tmpiyrlpl46 Check the logs for full command output.
emilmelnikov commented 3 years ago

Did you download this plugin as a ZIP file? Currently you need to clone this repository via git and do everything from there:

git clone https://github.com/ilastik/napari-ilastik.git

Also, it seems that you didn't activate the conda environment (conda activate napari-ilastik). Be careful when running things like pip install .... Usually you see the environment's name somewhere in your command prompt, but you can also double-check whether you've activated an environment or not by running conda info.

rdemets commented 3 years ago

Good call ! I used the ZIP instead of the git clone. Works well with git clone command. Thanks a lot !