pysaml2 icon indicating copy to clipboard operation
pysaml2 copied to clipboard

Import Error ”path” from dependencies lib ”importlib-resources”.

Open kento-machida opened this issue 2 years ago • 4 comments

We are facing an error with a dependent library "importlib-sources" that pysaml2 uses. It updated this version to "6.0.0" on 7 Jul 2023. One of the changes was the removal of "path". Pysaml2 is that External libraries are not fixed.

File "/usr/local/lib/python3.9/site-packages/saml2/sigver.py", line 16, in <module>
from importlib_resources import path as _resource_path
ImportError: cannot import name 'path' from 'importlib_resources' (/usr/local/lib/python3.9/site-packages/importlib_resources/__init__.py)

Code Version

Pysaml2 6.5.0 Python 3.9

Expected Behavior

We can be used without errors by importing external libraries

Current Behavior

Getting an error importing ”path” from an external library "importlib-sources".

Possible Solution

Fix "importlib-sources" in the past version. Or replace this with another solution.

Steps to Reproduce

kento-machida avatar Jul 10 '23 09:07 kento-machida

+1, facing the same issue, any solution discovered so far?

aklesh-sakunia avatar Jul 10 '23 13:07 aklesh-sakunia

+1 here

hicder avatar Jul 10 '23 22:07 hicder

Found a workaround, pin this dependency version in your requirements.txt:

importlib-resources==5.13.0

Or

pip install --force-reinstall "importlib-resources==5.13.0"

farioas avatar Jul 10 '23 22:07 farioas

If python version is above 3.9, you can solve it by upgrading pysaml2 version.

kento-machida avatar Jul 14 '23 06:07 kento-machida