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

ModuleNotFoundError: No module named 'rpds.rpds' #1175

Closed
salahaz opened this issue Oct 11, 2023 · 7 comments
Closed

ModuleNotFoundError: No module named 'rpds.rpds' #1175

salahaz opened this issue Oct 11, 2023 · 7 comments
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup

Comments

@salahaz
Copy link

salahaz commented Oct 11, 2023

The following issue is raised when importing jsonschema from the latest release of v.4.19.1. I used to work with v4.17.0 and there were no issues. Any fix ?

rpds

@Julian
Copy link
Member

Julian commented Oct 11, 2023

Please share something which reproduces, as everything works fine here.

@Julian Julian added the Waiting for Author A PR waiting for author changes or issue waiting on reporter feedback label Oct 11, 2023
@amirbtb
Copy link

amirbtb commented Oct 11, 2023

Hi, I have the same error.
Here is my environment :

  • AWS Lambda with Python 3.9 runtime, x86_64 Architecture
  • jsonschema==4.19.1
  • rdps-py==0.10.4
    I got this error with a simple import :
from jsonschema import validators
from jsonschema import Draft4Validator

@Julian
Copy link
Member

Julian commented Oct 11, 2023

Lambda isn't a supported environment inasmuch as it isn't something that runs in CI here, and I don't personally have access or test on it. Everything may work there (and it seems likely it does, given I know many users do use it) but I don't directly support it even at the level that I provide support at all. Please provide some reproducer that doesn't involve it -- something that I can run which produces the behavior you're indicating.

@amirbtb
Copy link

amirbtb commented Oct 11, 2023

According to this stackoverflow, the issue appeared with 4.18 : https://stackoverflow.com/questions/76667202/aws-lambda-function-cant-find-module.
I'll try setting up a Dockerfile with everything required to test this use case.

@Julian
Copy link
Member

Julian commented Oct 11, 2023

rpds as a dependency was introduced in 4.18, so that's not surprising. Feel free to follow up if you have a reproducer. Going to close for now, as I don't believe anything is wrong with the package itself, I suspect it's Lambda doing wrong things on installation, but if that turns out to not be the case happy to look into things with the reproducer.

@Julian Julian closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2023
@Julian Julian removed the Waiting for Author A PR waiting for author changes or issue waiting on reporter feedback label Oct 11, 2023
@CynanX
Copy link

CynanX commented Feb 7, 2024

I am seeing this also when using AWS ZIP lambdas or AWS sam local. AWS Docker lambdas are working fine.

I can knock together a project demonstrating this using AWS sam local if that helps?

@Julian Julian added the Invalid Not a bug, PEBKAC, or an unsupported setup label Feb 16, 2024
@milahu
Copy link

milahu commented Oct 23, 2024

in my case, this error is caused by a mismatch of python versions
the main program is executed by python3.11

$ head -n1 /nix/store/flxxflpq0fbyjv4408nzybgs54wl518b-gns3-gui-2.2.47/bin/..gns3-wrapped-wrapped
#!/nix/store/30dxq7znh2rgb9n0nvdjhqw0qrfv99fq-python3-3.11.9/bin/python3.11

but rpds-py was compiled for python3.12

$ ls /nix/store/g1b4rcyviv5xldngyhyf0y3sphad50g0-python3.12-rpds-py-0.18.1/lib/python3.12/site-packages/rpds/
__init__.py
__init__.pyi
__pycache__
py.typed
rpds.cpython-312-x86_64-linux-gnu.so

so the python3.11 tries to import rpds.cpython-311-x86_64-linux-gnu.so
but that file is missing, hence the ModuleNotFoundError

why two different python versions

blame nixpkgs/pkgs/applications/networking/gns3/default.nix

  mkGui = args: callPackage (import ./gui.nix (args)) {
    inherit (libsForQt5) wrapQtAppsHook;
    python3Packages = python311Packages;
  };

python3Packages is pinned to version 3.11
but the default python3 version in nixpkgs is 3.12
so other dependencies use python3.12

ping nixpkgs gns3 maintainer @anthonyroussel
the fix is as simple as to remove
python3Packages = python311Packages;
which was added in NixOS/nixpkgs@d203ca9
fixed in milahu/nur-packages@96e66f8

milahu added a commit to milahu/nur-packages that referenced this issue Oct 23, 2024
revert d203ca98569fca1f9a0641a30cd9841b3b646c0a
from NixOS/nixpkgs#326646
which created derivations with 2 python versions (3.11 + 3.12)
which breaks the import of rpds:
ModuleNotFoundError: No module named 'rpds.rpds'
python-jsonschema/jsonschema#1175
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup
Projects
None yet
Development

No branches or pull requests

5 participants