allegroai / clearml-server

ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
https://clear.ml/docs
Other
386 stars 134 forks source link

AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. #243

Closed scheckley closed 6 months ago

scheckley commented 6 months ago

Deployed Clearml via docker on aws.

AWS Linux WebApp: 1.15.0-472 • Server: 1.15.0-472 • API: 2.29 Python 3.12

Attempting to run the example Python matplot lib code:

import numpy as np
import matplotlib.pyplot as plt

# Add the following two lines to your code, to have ClearML automatically log your experiment
from clearml import Task
task = Task.init(project_name='my test', task_name='clearml demo')

# Create a plot using matplotlib, or you can also use plotly
plt.scatter(np.random.rand(50), np.random.rand(50), c=np.random.rand(50), alpha=0.5)
# Plot will be reported automatically to clearml
plt.show()

# Report some scalars
for i in range(100):
    task.get_logger().report_scalar(title="graph title", series="linear", value=i*2, iteration=i)

Returns:


Ignoring pip: markers 'python_version < "3.10"' don't match your environment
Collecting pip<22.3
  Using cached pip-22.2.2-py3-none-any.whl.metadata (4.2 kB)
Using cached pip-22.2.2-py3-none-any.whl (2.0 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-22.2.2
ERROR: Exception:
Traceback (most recent call last):
  File "/home/ubuntu/.clearml/venvs-builds/3.12/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/home/ubuntu/.clearml/venvs-builds/3.12/lib/python3.12/site-packages/pip/_internal/commands/list.py", line 164, in run
    packages: "_ProcessedDists" = [
                                  ^
  File "/home/ubuntu/.clearml/venvs-builds/3.12/lib/python3.12/site-packages/pip/_internal/metadata/base.py", line 646, in <genexpr>
    return (d for d in it if d.canonical_name not in skip)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/.clearml/venvs-builds/3.12/lib/python3.12/site-packages/pip/_internal/metadata/base.py", line 594, in iter_all_distributions
    for dist in self._iter_distributions():
  File "/home/ubuntu/.clearml/venvs-builds/3.12/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 168, in _iter_distributions
    for dist in finder.find_eggs(location):
  File "/home/ubuntu/.clearml/venvs-builds/3.12/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 136, in find_eggs
    yield from self._find_eggs_in_dir(location)
  File "/home/ubuntu/.clearml/venvs-builds/3.12/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 103, in _find_eggs_in_dir
    from pip._vendor.pkg_resources import find_distributions
  File "/home/ubuntu/.clearml/venvs-builds/3.12/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2164, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

clearml_agent: ERROR: Command '['/home/ubuntu/.clearml/venvs-builds/3.12/bin/python', '-m', 'pip', '--disable-pip-version-check', 'list']' returned non-zero exit status 2.

1715723736200 ip-172-31-34-208:gpuall DEBUG Process failed, exit code 1

Is clearml-agent incompatible with Python 3.12?

jkhenning commented 6 months ago

Hi @scheckley , this looks like a pip error, not an agent error

scheckley commented 6 months ago

Hi @scheckley , this looks like a pip error, not an agent error

ah thanks. i was working off a minimal clearml.conf and pulled down the full one with the pip versions. set it to use v22.4 and it works. it was defaulting to v20.

scheckley commented 6 months ago

fixed.