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

BUG: Add importlib_resources #27

Merged
merged 1 commit into from
Mar 11, 2021
Merged

BUG: Add importlib_resources #27

merged 1 commit into from
Mar 11, 2021

Conversation

larsoner
Copy link
Contributor

@larsoner larsoner commented Feb 24, 2021

I am hitting a bug as of yesterday on 7.3.0 pyface:

$ python -c "from traits.etsconfig.api import ETSConfig; ETSConfig.toolkit = 'qt4'; from mayavi import mlab"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/larsoner/anaconda3/envs/mne/lib/python3.8/site-packages/mayavi/mlab.py", line 15, in <module>
    from mayavi.core.common import process_ui_events
  File "/home/larsoner/anaconda3/envs/mne/lib/python3.8/site-packages/mayavi/core/common.py", line 21, in <module>
    from pyface import api as pyface
  File "/home/larsoner/anaconda3/envs/mne/lib/python3.8/site-packages/pyface/api.py", line 13, in <module>
    from .about_dialog import AboutDialog
...
  File "/home/larsoner/anaconda3/envs/mne/lib/python3.8/site-packages/pyface/resource/api.py", line 13, in <module>
    from .resource_manager import ResourceManager
  File "/home/larsoner/anaconda3/envs/mne/lib/python3.8/site-packages/pyface/resource/resource_manager.py", line 20, in <module>
    from importlib_resources import files
ModuleNotFoundError: No module named 'importlib_resources'

Looks like this requirement was added 3 months ago, so in the 7.3.0 cycle:

https://github.com/enthought/pyface/blame/9419755294ce22aad96c2b323023f92013d83e48/etstool.py#L95

I'm not sure if this is the right fix / place to do it, I'm not very experienced with conda-forge!

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-admin, please rerender

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipe:

  • noarch: python recipes are recommended to have a lower bound on the python version. This recommendation will become a requirement in the future.

@github-actions
Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.
I tried to rerender for you, but it looks like there was nothing to do.

1 similar comment
@github-actions
Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.
I tried to rerender for you, but it looks like there was nothing to do.

@larsoner
Copy link
Contributor Author

FYI I tracked this down based on what I think might be related errors on CIs on Linux and on Windows, where I see:

ValueError: cannot set toolkit to qt4 because it has already been set to null

@yoda-vid
Copy link

Looks like these newly missing dependencies are also mentioned in enthought/mayavi#1000. I get a importlib_metadata error from Pyface:

Python 3.7.10 (default, Feb 26 2021, 10:16:00) 
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from mayavi import mlab
Traceback (most recent call last):
  File "/src/pyface/pyface/base_toolkit.py", line 73, in <module>
    import importlib.metadata as importlib_metadata
ModuleNotFoundError: No module named 'importlib.metadata'

and then the importlib_resources error after installing import_metadata.

@larsoner
Copy link
Contributor Author

cc @grlee77 hoping for a review on this one so that the package can be fixed

@grlee77 grlee77 merged commit 6c7b156 into conda-forge:master Mar 11, 2021
@grlee77
Copy link
Member

grlee77 commented Mar 11, 2021

Thanks @larsoner and @yoda-vid. My apologies that this PR got neglected for so long. If either of you want to be co-maintainers here, please make a separate PR for that.

@ntorresalberto
Copy link

Looks like these newly missing dependencies are also mentioned in enthought/mayavi#1000. I get a importlib_metadata error from Pyface:

Python 3.7.10 (default, Feb 26 2021, 10:16:00) 
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from mayavi import mlab
Traceback (most recent call last):
  File "/src/pyface/pyface/base_toolkit.py", line 73, in <module>
    import importlib.metadata as importlib_metadata
ModuleNotFoundError: No module named 'importlib.metadata'

and then the importlib_resources error after installing import_metadata.

Just wanted to point out that I found this error again with Python 3.8.10 and mayavi.

For future googlers, the solution was to conda install pyface (which solved it even though I already had it installed, it still pulled importlib_metadata and importlib_resourc~).

@petervandenabeele
Copy link

I hit this when trying to run JupyterHub that was installed with conda / mamba install.

ModuleNotFoundError: No module named 'importlib_resources'

The proposed fix to do conda install pyface did not work for me.

What did work for me was to add mamba install ... importlib_metadata importlib_resources ....
After that, my JupyterHub and Notebooks started correctly.

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.

None yet

6 participants