napari / napari

napari: a fast, interactive, multi-dimensional image viewer for python
https://napari.org
BSD 3-Clause "New" or "Revised" License
2.17k stars 418 forks source link

Installing plugin via napari doesn't install dependencies. #2111

Closed adamltyson closed 3 years ago

adamltyson commented 3 years ago

šŸ› Bug

Installing a plugin via the GUI in napari doesn't (appear to) install the dependencies that are installed if using pip directly.

To Reproduce

Steps to reproduce the behavior: 1.

conda create --name plugin-test python=3.8
conda activate plugin-test
pip install napari[pyqt5]
napari
  1. Install napari-brainreg plugin via napari GUI
  2. Plugin shows an error ModuleNotFoundError: No module named 'bg_atlasapi', and the dependencies (such as bg-atlasapi) do not show up with conda list
  3. pip install napari-brainreg fixes the issue

Expected behavior

Installation of plugins with napari should be identical to a normal pip installation

Environment

napari: 0.4.2
Platform: Linux-4.18.2-041802-generic-x86_64-with-glibc2.10
Python: 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0]
Qt: 5.15.2
PyQt5: 5.15.2
NumPy: 1.19.5
SciPy: 1.6.0
Dask: 2020.12.0
VisPy: 0.6.6

GL version: 4.6.0 NVIDIA 418.67
MAX_TEXTURE_SIZE: 32768

Plugins:
- brainreg: 0.2.3
- brainreg_standard: 0.2.3
- napari_plugin_engine: 0.1.9
- svg: 0.1.4

cc @tlambert03

tlambert03 commented 3 years ago

thanks @adamltyson! will take a look soon

tlambert03 commented 3 years ago

Hi @adamltyson,

I just tried to reproduce this but wasn't able to. Everything worked fine via the gui plugin installer on ubuntu 20.04.

environment immediately after env creation and pip install napari[pyqt] ```sh # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge alabaster 0.7.12 pypi_0 pypi appdirs 1.4.4 pypi_0 pypi babel 2.9.0 pypi_0 pypi backcall 0.2.0 pypi_0 pypi ca-certificates 2020.12.5 ha878542_0 conda-forge cachey 0.2.1 pypi_0 pypi certifi 2020.12.5 py38h578d9bd_1 conda-forge chardet 4.0.0 pypi_0 pypi dask 2021.2.0 pypi_0 pypi decorator 4.4.2 pypi_0 pypi docstring-parser 0.7.3 pypi_0 pypi docutils 0.16 pypi_0 pypi freetype-py 2.2.0 pypi_0 pypi heapdict 1.0.1 pypi_0 pypi idna 2.10 pypi_0 pypi imageio 2.9.0 pypi_0 pypi imagesize 1.2.0 pypi_0 pypi ipykernel 5.5.0 pypi_0 pypi ipython 7.21.0 pypi_0 pypi ipython-genutils 0.2.0 pypi_0 pypi jedi 0.18.0 pypi_0 pypi jinja2 2.11.3 pypi_0 pypi jupyter-client 6.1.11 pypi_0 pypi jupyter-core 4.7.1 pypi_0 pypi ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge libffi 3.3 h58526e2_2 conda-forge libgcc-ng 9.3.0 h2828fa1_18 conda-forge libgomp 9.3.0 h2828fa1_18 conda-forge libstdcxx-ng 9.3.0 h6de172a_18 conda-forge magicgui 0.2.6 pypi_0 pypi markupsafe 1.1.1 pypi_0 pypi napari 0.4.5 pypi_0 pypi napari-console 0.0.3 pypi_0 pypi napari-plugin-engine 0.1.9 pypi_0 pypi napari-svg 0.1.4 pypi_0 pypi ncurses 6.2 h58526e2_4 conda-forge numpy 1.20.1 pypi_0 pypi numpydoc 1.1.0 pypi_0 pypi openssl 1.1.1j h7f98852_0 conda-forge packaging 20.9 pypi_0 pypi parso 0.8.1 pypi_0 pypi pexpect 4.8.0 pypi_0 pypi pickleshare 0.7.5 pypi_0 pypi pillow 8.1.0 pypi_0 pypi pip 21.0.1 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.16 pypi_0 pypi psutil 5.8.0 pypi_0 pypi ptyprocess 0.7.0 pypi_0 pypi pydantic 1.7.3 pypi_0 pypi pygments 2.8.0 pypi_0 pypi pyopengl 3.1.5 pypi_0 pypi pyparsing 2.4.7 pypi_0 pypi pyqt5 5.15.3 pypi_0 pypi pyqt5-qt 5.15.2 pypi_0 pypi pyqt5-sip 12.8.1 pypi_0 pypi python 3.8.8 hffdb5ce_0_cpython conda-forge python-dateutil 2.8.1 pypi_0 pypi python_abi 3.8 1_cp38 conda-forge pytz 2021.1 pypi_0 pypi pyyaml 5.4.1 pypi_0 pypi pyzmq 22.0.3 pypi_0 pypi qtconsole 5.0.2 pypi_0 pypi qtpy 1.9.0 pypi_0 pypi readline 8.0 he28a2e2_2 conda-forge requests 2.25.1 pypi_0 pypi scipy 1.6.1 pypi_0 pypi setuptools 49.6.0 py38h578d9bd_3 conda-forge six 1.15.0 pypi_0 pypi snowballstemmer 2.1.0 pypi_0 pypi sphinx 3.5.1 pypi_0 pypi sphinxcontrib-applehelp 1.0.2 pypi_0 pypi sphinxcontrib-devhelp 1.0.2 pypi_0 pypi sphinxcontrib-htmlhelp 1.0.3 pypi_0 pypi sphinxcontrib-jsmath 1.0.1 pypi_0 pypi sphinxcontrib-qthelp 1.0.3 pypi_0 pypi sphinxcontrib-serializinghtml 1.1.4 pypi_0 pypi sqlite 3.34.0 h74cdb3f_0 conda-forge tifffile 2021.2.26 pypi_0 pypi tk 8.6.10 h21135ba_1 conda-forge toolz 0.11.1 pypi_0 pypi tornado 6.1 pypi_0 pypi traitlets 5.0.5 pypi_0 pypi typing-extensions 3.7.4.3 pypi_0 pypi urllib3 1.26.3 pypi_0 pypi vispy 0.6.6 pypi_0 pypi wcwidth 0.2.5 pypi_0 pypi wheel 0.36.2 pyhd3deb0d_0 conda-forge wrapt 1.12.1 pypi_0 pypi xz 5.2.5 h516909a_1 conda-forge zlib 1.2.11 h516909a_1010 conda-forge ```
environment diff after installing napari-brainreg via gui ```sh > bg-atlasapi 1.0.0 pypi_0 pypi > bg-space 0.5.0 pypi_0 pypi > click 7.1.2 pypi_0 pypi > colorama 0.4.4 pypi_0 pypi > commonmark 0.9.1 pypi_0 pypi > future 0.18.2 pypi_0 pypi > meshio 4.3.10 pypi_0 pypi > napari-brainreg 0.2.3 pypi_0 pypi > pandas 1.2.2 pypi_0 pypi > rich 9.12.3 pypi_0 pypi > tqdm 4.58.0 pypi_0 pypi > treelib 1.6.1 pypi_0 pypi ```

here's where bg_atlasapi got installed for me:

In [1]: import bg_atlasapi

In [2]: bg_atlasapi.__file__
Out[2]: '/home/talley/miniconda3/envs/plugin-test/lib/python3.8/site-packages/bg_atlasapi/__init__.py'

can you maybe test this on master one more time? I recently fixed something for the bundle installer, I wouldn't have expected it to fix this... but maybe?

adamltyson commented 3 years ago

Looks fixed to me (either my machine, or somewhere between 0.4.2 and 0.4.5). Thanks for looking into it!

adamltyson commented 3 years ago

Just an FYI - I think I might have tracked down this issue. I'm used to using the terminal in PyCharm, but this doesn't seem to play well with napari. There are a few issues when interacting "outside" of napari, such as saving images, and installing plugins. These issues aren't present with the normal Ubuntu terminal.