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

Problem with install dependencies in Python 3.8 #858

Closed
timdiller opened this issue Mar 6, 2023 · 6 comments
Closed

Problem with install dependencies in Python 3.8 #858

timdiller opened this issue Mar 6, 2023 · 6 comments

Comments

@timdiller
Copy link
Contributor

Problem Description
There is what I believe to a problem with the installation dependencies for Chaco. With a bare installation of Chaco, any attempted import results in ModuleNotFoundError: no module named 'pyparsing'. I have not tried this on platforms other than macOS, but I suspect this is not platform dependent.

Reproduction Steps:

❯ edm install -e foo chaco
No value provided for --version. Assuming 3.8
Fetching indices for runtime repositories. done
Fetching indices for package repositories. done
Fetching indices for runtime repositories. done
Installing runtime... done
The following packages will be installed:

    chaco                5.1.1-1        1022     KiB
    enable               5.3.1-5           3.3   MiB
    fonttools            4.31.1-1        985     KiB
    importlib_resources  5.4.0-1          27     KiB
    intel_openmp         2021.4.28-1       1.1   MiB
    libfreetype          2.12.1-1        637     KiB
    libharfbuzz          3.2.0-4         924     KiB
    liblcms2             2.12-1          197     KiB
    libopenjpeg          2.4.0.post1-1   190     KiB
    libpng               1.6.37-100      242     KiB
    libtiff              4.3.0-2         213     KiB
    libturbojpeg         2.1.2-1         430     KiB
    libzstd              1.5.0-1           1.12  MiB
    mkl                  2021.3.0-1      192.63  MiB
    mkl_service          2.4.0-1          47     KiB
    numpy                1.21.2-2          7.45  MiB
    pillow_simd          9.0.0.post1-2   876     KiB
    pyface               7.4.4-2           2.41  MiB
    traits               6.4.1-1           4.76  MiB
    traitsui             7.4.3-1           2.62  MiB
    zipp                 3.7.0-1           6     KiB

Do you want to continue ? [Y/n]: 
Installing/removing package(s)
chaco               [...................................................................................]

❯ edm shell -e foo
Starting new shell in EDM environment 'foo'.
Type 'exit' or 'Ctrl+D' to return.

$foo ❯ python
Enthought Deployment Manager -- https://www.enthought.com/
Python 3.8.12 |Enthought, Inc. (x86_64)| (default, Sep 27 2021, 11:51:02) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from chaco.api import ArrayPlotData                                                    
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tdiller/.edm/envs/foo/lib/python3.8/site-packages/chaco/api.py", line 343, in <module>
    from chaco.overlays.api import (
  File "/Users/tdiller/.edm/envs/foo/lib/python3.8/site-packages/chaco/overlays/api.py", line 63, in <module>
    from chaco.overlays.layers.api import (
  File "/Users/tdiller/.edm/envs/foo/lib/python3.8/site-packages/chaco/overlays/layers/api.py", line 11, in <module>
    from .status_layer import ErrorLayer, StatusLayer, WarningLayer
  File "/Users/tdiller/.edm/envs/foo/lib/python3.8/site-packages/chaco/overlays/layers/status_layer.py", line 17, in <module>
    from enable.savage.svg.document import SVGDocument
  File "/Users/tdiller/.edm/envs/foo/lib/python3.8/site-packages/enable/savage/svg/document.py", line 27, in <module>
    from . import css
  File "/Users/tdiller/.edm/envs/foo/lib/python3.8/site-packages/enable/savage/svg/css/__init__.py", line 10, in <module>
    from .transform import transformList
  File "/Users/tdiller/.edm/envs/foo/lib/python3.8/site-packages/enable/savage/svg/css/transform.py", line 14, in <module>
    from pyparsing import Group, Literal, Optional, delimitedList
ModuleNotFoundError: No module named 'pyparsing'

Expected behavior:
Either Chaco should include pyparsing as a dependency such that it is installed during environment creation, or maybe chaco.api could be reworked such that the pyparsing is not needed. [credit: @mdickinson for the diagnosis]

@mdickinson
Copy link
Member

Thanks, @timdiller. It's worth noting that Enable is in the mix too - the dependency on pyparsing goes through Enable. However, pyparsing isn't needed for a simple import enable.api. So I see three possible resolutions:

  • Enable could make pyparsing a hard dependency, in which case the fix would be with the Enable dependencies and recipes.
  • Enable makes pyparsing an optional dependency, but since Chaco is using the bits of Enable that require pyparsing, Chaco would make pyparsing an explicit dependency
  • Chaco is reworked to make pyparsing an optional dependency, so that in particular import chaco.api doesn't attempt to bring in pyparsing.

@mdickinson
Copy link
Member

@jwiggins Should pyparsing be a non-optional dependency of Enable? Or should we be fixing this entirely in Chaco-land?

@jwiggins
Copy link
Member

jwiggins commented Mar 6, 2023

It should probably be an optional dependency of Enable since it's only needed for the SVG bits

@mdickinson
Copy link
Member

@jwiggins Thanks. Then I think the most desirable solution is probably option 3: make pyparsing an optional dependency of Chaco, and ensure (somehow) that import chaco.api doesn't automatically try to import pyparsing.

@corranwebster
Copy link
Contributor

Slightly orthogonal, but sometimes I wonder if we should pull the svg stuff out into at least its own top-level package in enable project - almost no one knows its there and that would allow us to surface things like this more clearly.

@corranwebster
Copy link
Contributor

This should now be resolved by #891, in particular this line:

"enable[layout,svg]>=5.2.0"

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

No branches or pull requests

4 participants