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

Installation in napari on windows fails #14

Open
haesleinhuepf opened this issue Jul 29, 2021 · 6 comments
Open

Installation in napari on windows fails #14

haesleinhuepf opened this issue Jul 29, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@haesleinhuepf
Copy link

Hi all,

I was just trying to install napari-yapic-prediction in my napari (the Windows-app) and it didn't work. I think this error tells why:

Collecting yapic

  Downloading yapic-1.2.5.tar.gz (28 kB)

    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\rober\AppData\Local\Programs\napari\python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Windows\\Temp\\pip-install-5p4s3xd8\\yapic_1152ae89b51f45939f9a046ce41aa97a\\setup.py'"'"'; __file__='"'"'C:\\Windows\\Temp\\pip-install-5p4s3xd8\\yapic_1152ae89b51f45939f9a046ce41aa97a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Windows\Temp\pip-pip-egg-info-d7cqmuzo'
         cwd: C:\Windows\Temp\pip-install-5p4s3xd8\yapic_1152ae89b51f45939f9a046ce41aa97a\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Windows\Temp\pip-install-5p4s3xd8\yapic_1152ae89b51f45939f9a046ce41aa97a\setup.py", line 3, in <module>
        from yapic.version import __version__
    ModuleNotFoundError: No module named 'yapic'
    ----------------------------------------

image

Futhermore, that's my napari info:

napari: 0.4.10
Platform: Windows-10-10.0.19041-SP0
Python: 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]
Qt: 5.15.2
PyQt5: 5.15.4
NumPy: 1.19.5
SciPy: 1.6.3
Dask: 2021.06.0
VisPy: 0.6.6

OpenGL:
- GL version: 4.6.14756 Compatibility Profile Context 20.40.44.02 27.20.14044.2001
- MAX_TEXTURE_SIZE: 16384

Screens:
- screen 1: resolution 1920x1200, scale 1.0

Plugins:
- OpenCL_Random_Forest_Classifier: 0.4.0
- StarDist: 2021.6.28
- animation: 0.0.2
- cellpose-napari: 0.1.3
- clEsperanto: 0.9.8
- console: 0.0.3
- devbio: 0.1.0
- napari-czifile2: 0.2.4
- napari-features: 0.1.1
- napari-skimage-regionprops: 0.1.3
- napari_webcam: 0.1.12
- ome-types: 0.2.7
- scikit-image
- svg: 0.1.5

Let me know if I can help fixing/testing the issue!

Best,
Robert

@amgfernandes
Copy link
Contributor

@dlesmesl can you please check this issue and help Robert figuring out what the problem is?

@amgfernandes amgfernandes added the bug Something isn't working label Aug 2, 2021
@dlesmesl
Copy link
Contributor

dlesmesl commented Aug 2, 2021

Hello @haesleinhuepf, did you already install yapic in the virtual environment where you installed napari?
Just some quick reminders:

  1. Supported python version: 3.8
  2. Before installing yapic, install tensorflow (2.4.1) ---> pip install tensorflow-gpu==2.4.1 (if you have gpu, otherwise pip install tensorflow==2.4.1)
  3. Install yapic ---> pip install yapic

Once you have yapic installed in the same environment where napari is, you should be able to install the prediction plugin.

Please let me know if you have questions!

@haesleinhuepf
Copy link
Author

Hey @dlesmesl ,

thanks for your feedback! I just tried by copy-pasting "tensorflow-gpu==2.4.1" in the plugin installer dialog of napari. Reminder: I'm working with the napari-app. It's not called from command line. It starts via Windows start-menu.
image

Afterwards, I also installed yapic the same way. A similar error comes up then (see full error log below).

If I install tensorflow and yapic from my command line within a conda environment using pip install ..., it works though in napari! Thus, feel free to close this issue. But I'm curious: Do you have an idea why it doesn't work via the napari-plugin-installer?

Thanks!

Best,
Robert

Collecting yapic

  Using cached yapic-1.2.5.tar.gz (28 kB)

    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\rober\AppData\Local\Programs\napari\python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Windows\\Temp\\pip-install-2tz6j3vx\\yapic_59131a11a5c74418aaa51dcbd498cd68\\setup.py'"'"'; __file__='"'"'C:\\Windows\\Temp\\pip-install-2tz6j3vx\\yapic_59131a11a5c74418aaa51dcbd498cd68\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Windows\Temp\pip-pip-egg-info-2nw1gx2f'
         cwd: C:\Windows\Temp\pip-install-2tz6j3vx\yapic_59131a11a5c74418aaa51dcbd498cd68\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Windows\Temp\pip-install-2tz6j3vx\yapic_59131a11a5c74418aaa51dcbd498cd68\setup.py", line 3, in <module>
        from yapic.version import __version__
    ModuleNotFoundError: No module named 'yapic'
    ----------------------------------------

WARNING: Discarding https://files.pythonhosted.org/packages/ba/6c/e6b9c3ae9d62d96daa6e5561383c70981c3d833d2a185ea916f6693ae0ad/yapic-1.2.5.tar.gz#sha256=e2d5b33dde36034b362d3bbfb429a30a7640f94dee7c943d1e2f1135c663b839 (from https://pypi.org/simple/yapic/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

  Using cached yapic-1.2.4.tar.gz (28 kB)

Collecting yapic_io>=0.1.2

  Using cached yapic_io-0.2.2.tar.gz (32 kB)

Collecting docopt>=0.6.2

  Using cached docopt-0.6.2.tar.gz (25 kB)

    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\rober\AppData\Local\Programs\napari\python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Windows\\Temp\\pip-install-2tz6j3vx\\docopt_f4cc50a315fa4af5aa0409ca0ff760a8\\setup.py'"'"'; __file__='"'"'C:\\Windows\\Temp\\pip-install-2tz6j3vx\\docopt_f4cc50a315fa4af5aa0409ca0ff760a8\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Windows\Temp\pip-pip-egg-info-0cnv6xz9'
         cwd: C:\Windows\Temp\pip-install-2tz6j3vx\docopt_f4cc50a315fa4af5aa0409ca0ff760a8\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Windows\Temp\pip-install-2tz6j3vx\docopt_f4cc50a315fa4af5aa0409ca0ff760a8\setup.py", line 3, in <module>
        from docopt import __version__
    ModuleNotFoundError: No module named 'docopt'
    ----------------------------------------

WARNING: Discarding https://files.pythonhosted.org/packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz#sha256=49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491 (from https://pypi.org/simple/docopt/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Collecting yapic

  Using cached yapic-1.2.3.tar.gz (16 kB)

  Using cached yapic-1.2.2.tar.gz (14 kB)

  Using cached yapic-1.2.1.tar.gz (14 kB)

  Using cached yapic-1.2.0.tar.gz (14 kB)

  Using cached yapic-1.0.1.tar.gz (9.9 kB)

  Using cached yapic-1.0.0.tar.gz (11 kB)

ERROR: Cannot install yapic==1.0.0, yapic==1.0.1, yapic==1.2.0, yapic==1.2.1, yapic==1.2.2, yapic==1.2.3 and yapic==1.2.4 because these package versions have conflicting dependencies.


The conflict is caused by:
    yapic 1.2.4 depends on docopt>=0.6.2
    yapic 1.2.3 depends on docopt>=0.6.2
    yapic 1.2.2 depends on docopt>=0.6.2
    yapic 1.2.1 depends on docopt>=0.6.2
    yapic 1.2.0 depends on docopt>=0.6.2
    yapic 1.0.1 depends on docopt>=0.6.2
    yapic 1.0.0 depends on docopt>=0.6.2

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

WARNING: You are using pip version 21.1.2; however, version 21.2.1 is available.
You should consider upgrading via the 'C:\Users\rober\AppData\Local\Programs\napari\python\python.exe -m pip install --upgrade pip' command.

@pranjaldhole
Copy link
Contributor

@haesleinhuepf you don't need to install tensorflow beforehand as the plugin will install tensorflow-gpu or tensorflow-cpu version based on whether or not you have a configured nvidia gpu on your system.

@dlesmesl The issue seems related to how windows reads the setup file. It seems that in the setup file, it should be looking for yapic.version as relative path; but perhaps it is looking for package called yapic which doesn't exist. I wasn't able to reproduce the error in my Linux system nor did the tox windows build seem to capture the error. Can you check if you can reproduce the bug on windows system? I suspect it might be a python issue than the package issue.

There is a similar issue I found for docopt: docopt/docopt#453 which was fixed by installing reinstalling python.

@haesleinhuepf can you try to create a fresh conda environment for napari with python=3.8 and see if you can reproduce error? It could be that your python installation had a bug similar to aforementioned issue.
Make sure you update your anaconda base environment with conda update conda.

Let us know if the bug still persists.

@pranjaldhole
Copy link
Contributor

@haesleinhuepf I just noticed that you're using napari bundled app and not via conda. In my experience, the bundled app is a bit buggy (at least this was the case two months ago). I had gotten several complaints with plugin installations which were rectified when napari was installed via anaconda. Perhaps this is sufficient. Let us know.

Once you install anaconda on your system, do following in anaconda bash prompt (search for it in start menu):

conda create -n napari-env python=3.8
conda activate napari-env
pip install "napari[all]"
napari

That will launch napari. Then you need to install the plugin napari-yapic-prediction similar to how you did previously.

Let me know if this solves the issue.

@dlesmesl
Copy link
Contributor

dlesmesl commented Aug 3, 2021

@pranjaldhole Thanks for the clarification! I just recap again over the plugin setup and you're right, in theory it should install yapic on the way. As you said, it might be because of how python is installed, it's important to keep in mind that yapic is supported on python 3.8 so in any case the python version is 3.9 (which supports napari), it might create a conflict to install yapic.

On the other hand, I wanted to remind @haesleinhuepf that the napari installer dialog can only install napari plugins, and yapic itself is not a napari plugin, it's an independent software so that's why it could only be installed in command line (although in this specific case it shouldn't be necessary because it's a requirement of our plugin as pranjal said).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants