Skip to content

Env check#614

Merged
thewtex merged 9 commits intoInsightSoftwareConsortium:mainfrom
bnmajor:env-check
Feb 26, 2023
Merged

Env check#614
thewtex merged 9 commits intoInsightSoftwareConsortium:mainfrom
bnmajor:env-check

Conversation

@bnmajor
Copy link
Collaborator

@bnmajor bnmajor commented Feb 14, 2023

Adds an environment check notebook that is designed to check the environment that the user is running in to make sure that all required dependencies and extensions are correctly installed. Ideally run first before any other notebooks to prevent common issues around dependencies and extension loading.

@bnmajor bnmajor requested a review from thewtex February 14, 2023 16:31
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@bnmajor bnmajor force-pushed the env-check branch 3 times, most recently from f7af940 to c75b7b8 Compare February 20, 2023 22:55
@bnmajor
Copy link
Collaborator Author

bnmajor commented Feb 21, 2023

@thewtex It looks like Python 3.11 is failing with the following:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[2], line 1
----> 1 from itkwidgets import view
      3 try:
      4     import imageio.v2 as imageio

File ~/work/itkwidgets/itkwidgets/itkwidgets/__init__.py:6
      3 from imjoy_rpc import register_default_codecs
      4 register_default_codecs()
----> 6 from .imjoy import register_itkwasm_imjoy_codecs
      7 register_itkwasm_imjoy_codecs()
      9 from .viewer import Viewer, view

File ~/work/itkwidgets/itkwidgets/itkwidgets/imjoy.py:5
      1 from dataclasses import asdict
      3 from typing import Dict 
----> 5 import itkwasm
      6 import numcodecs
      7 from imjoy_rpc import api

File /opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/itkwasm/__init__.py:14
     12 from .text_file import TextFile
     13 from .text_stream import TextStream
---> 14 from .pipeline import Pipeline
     15 from .pipeline_input import PipelineInput
     16 from .pipeline_output import PipelineOutput

File /opt/hostedtoolcache/Python/3.11.2/x[64](https://github.com/InsightSoftwareConsortium/itkwidgets/actions/runs/4234626820/jobs/7357183283#step:6:65)/lib/python3.11/site-packages/itkwasm/pipeline.py:20
     17 from .int_types import IntTypes
     18 from .float_types import FloatTypes
---> 20 from wasmer import engine, wasi, Store, Module, ImportObject, Instance
     21 from wasmer_compiler_cranelift import Compiler
     23 def _memoryview_to_numpy_array(component_type, buf):

File /opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/wasmer/__init__.py:1
----> 1 raise ImportError("Wasmer is not available on this system")

ImportError: Wasmer is not available on this system

It does seem that there are no wheels for Wasmer for 3.11: https://pypi.org/project/wasmer/1.1.0/#files, but running the tests locally in a conda env with 3.11 I am not seeing this error. I am running Ubuntu 20.04 still but ubuntu-latest has been on 22.04 since October so that shouldn't be the issue I don't think? Any ideas?

@thewtex
Copy link
Member

thewtex commented Feb 22, 2023

@bnmajor yes, I ran into this, too, filed an issue: wasmerio/wasmer-python#696

For now, let's disable 3.11 in CI, create an issue to re-enable. I will likely use an alternative to wasmer-python itk-wasm.

@bnmajor
Copy link
Collaborator Author

bnmajor commented Feb 23, 2023

@thewtex Sounds good, thanks! #618 disables 3.11 testing for now

Add a notebook designed to make sure that all requirements are installed in the
current environment and all extensions have been loaded before the user runs
any of the other notebooks.
Update notebooks and documentation to all refer to itkwidgets v1.0a23.
Support Python 3.7 as well as >=3.8
Jupyter will re-run any js in the output cells when the notebook is loaded,
which can create a situation with the environment check notebook where the
page refreshes infinitely. Make sure the condition is always set to false
after evaluation to prevent this from happening.
Includes additional information on setting up environments and how to raise an
issue if there continue to be problems.
@bnmajor
Copy link
Collaborator Author

bnmajor commented Feb 23, 2023

@thewtex This should be good to go now

@@ -0,0 +1,272 @@
{
Copy link
Member

@thewtex thewtex Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid the impression that all the dependencies fetched here are required for itkwidgets, can please clarify here:

required dependencies -> example notebook dependencies

other notebooks -> example notebooks


Reply via ReviewNB

@thewtex
Copy link
Member

thewtex commented Feb 24, 2023

@bnmajor thank you so much!

Please see minor issue noted inline.

Required dependencies -> example notebook dependencies
other notebooks -> example notebooks.
@bnmajor
Copy link
Collaborator Author

bnmajor commented Feb 25, 2023

@thewtex Thanks! Fixed now 🙂

@bnmajor bnmajor requested a review from thewtex February 25, 2023 17:48
Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@thewtex thewtex merged commit c8f7f61 into InsightSoftwareConsortium:main Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants