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

Missing py4j dependency when trying to import pyspark from inside the container #122

Open
theoctober19th opened this issue Dec 3, 2024 · 1 comment

Comments

@theoctober19th
Copy link
Member

Upon running Python3 shell inside the container spawned from Charmed Spark Rock image, the import pyspark fails, with a missing py4j dependency.

Steps to Reproduce:

docker pull ghcr.io/canonical/charmed-spark:3.5.1-22.04_edge
docker run -d ghcr.io/canonical/charmed-spark:3.5.1-22.04_edge
docker container exec -it <container_name> bash

python3
>>> import pyspark

Observed Error:

>>> import pyspark
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/spark/python/pyspark/__init__.py", line 58, in <module>
    from pyspark.conf import SparkConf
  File "/opt/spark/python/pyspark/conf.py", line 23, in <module>
    from py4j.java_gateway import JVMView, JavaObject
ModuleNotFoundError: No module named 'py4j'

PS, this was found in both base Spark image as well as Jupyterlab image, in versions 3.4 as well as 3.5.

Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-6133.

This message was autogenerated

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

1 participant