ilastik / ilastik-napari

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

not clear how to install - run plugin #5

Open k-dominik opened 2 years ago

k-dominik commented 2 years ago

Hello,

I was following the installation instructions in the Readme, but got the following error

```pytb Running setup.py develop for napari-ilastik ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/.../napari-ilastik/setup.py'"'"'; __file__='"'"'/.../napari-ilastik/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= cwd: /.../sources/napari-ilastik/ Complete output (28 lines): running develop WARNING: The user site-packages directory is disabled. error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '/usr/local/lib/python3.8/dist-packages/test-easy-install-116871.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /usr/local/lib/python3.8/dist-packages/ Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html Please make the appropriate changes for your system and try again. ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/.../sources/napari-ilastik/setup.py'"'"'; __file__='"'"'/.../sources/napari-ilastik/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output. ```

first of all I was wondering why at all anything happens outside conda? I don't want to do anything in /usr/local/...

also it would be nice to have a conda-only solution for installation.

Also when I go the conda route, (guessing dependencies) I get

$: python examples/simple_labeling.py 
Traceback (most recent call last):
  File "examples/simple_labeling.py", line 23, in <module>
    main()
  File "examples/simple_labeling.py", line 18, in main
    viewer.window.add_plugin_dock_widget("napari-ilastik")
  File "/.../miniconda3/envs/napari-ilastik/lib/python3.7/site-packages/napari/_qt/qt_main_window.py", line 647, in add_plugin_dock_widget
    plugin_name, widget_name
  File "/.../miniconda3/envs/napari-ilastik/lib/python3.7/site-packages/napari/plugins/_plugin_manager.py", line 578, in get_widget
    raise KeyError(msg)
KeyError: "Plugin 'napari-ilastik' does not provide any dock widgets"
emilmelnikov commented 2 years ago

I was following the installation instructions in the Readme, but got the following error first of all I was wondering why at all anything happens outside conda? I don't want to do anything in /usr/local/...

Thanks for spotting the issue! The problem is the missing pip dependency in lockfiles, therefore, system-wide pip will be used (or whatever version you had in your current PATH). I'll add pip to lockfiles, and change pip to python -m pip in README, which is the recommended practice from people close to Python development.

also it would be nice to have a conda-only solution for installation.

This plugin is supposed to be available through pip because napari searches plugins in PyPI. Unfortunately, fastfilters is a conda-only dependency, but I was planning to replace it with the new Halide-based implementation. Of course, adding a conda package on top of that would be nice too.

Also when I go the conda route, (guessing dependencies) I get

This is expected if you did not install this package, because napari's plugin system works by examining packages' entry points, specified through distutils or setuptools in setup.cfg or setup.py.

k-dominik commented 2 years ago

only plugin discovery (as in downloadable from within napari) goes via pypi (does only matter if the plugin is actually on there - no installation instructions needed). Plugin execution should still work from a conda environment (locally "installed" plugins can be run afaik). Hence it would be great to have a conda only - as in no pip involved - way to install a dev env for this plugin.

edit: entry points can be set in meta.yaml