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

[Bug]: Python3.12 Installation failed #2279

Open
1 task done
yuanchaolie opened this issue Aug 27, 2024 · 6 comments · May be fixed by #2322
Open
1 task done

[Bug]: Python3.12 Installation failed #2279

yuanchaolie opened this issue Aug 27, 2024 · 6 comments · May be fixed by #2322

Comments

@yuanchaolie
Copy link

Describe the bug

python 3.12 has an error during installation and cannot be installed successfully

Dataset

N/A

Model

N/A

Steps to reproduce the behavior

Reproduction failed

anomalib install -v

or

anomalib install --option loggers

or

anomalib install --option dev

Only this command was successful

anomalib install --option core

OS information

OS information:

  • OS: [e.g. windows 11 23h2]
  • Python version: [e.g. 3.12.5]
  • CUDA/cuDNN version: [e.g. 12.4.1]

Expected behavior

Hope for a fix

Screenshots

No response

Pip/GitHub

pip

What version/branch did you use?

No response

Configuration YAML

...

Logs

[08/27/24 23:10:04] Collecting pathtools (from wandb<=0.15.9,>=0.12.17)
Collecting pathtools (from wandb<=0.15.9,>=0.12.17)
                    Using cached pathtools-0.1.2.tar.gz (11 kB)
  Using cached pathtools-0.1.2.tar.gz (11 kB)
  Preparing metadata (setup.py) ... error
                    python setup.py egg_info exited with 1
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\xxx\AppData\Local\Temp\pip-install-dbsmshni\pathtools_9997dca997774198b3057eb85fba7411\setup.py", line 25, in <module>
          import imp
      ModuleNotFoundError: No module named 'imp'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
                    metadata generation failed
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@alexriedel1
Copy link
Contributor

alexriedel1 commented Aug 29, 2024

For anyone who wants to fix this: imp became importlib in Python 3.12 https://docs.python.org/3/whatsnew/3.12.html#imp

@yuanchaolie
Copy link
Author

对于任何想要解决这个问题的人:imp 在 Python 3.12 中变成了 importlib https://docs.python.org/3/whatsnew/3.12.html#imp

The problem now is that pathtools are used, and pathtools reference imp

@alexriedel1
Copy link
Contributor

对于任何想要解决这个问题的人:imp 在 Python 3.12 中变成了 importlib https://docs.python.org/3/whatsnew/3.12.html#imp

The problem now is that pathtools are used, and pathtools reference imp

ah you're right! the issue comes with the wandb version. wandb/wandb#6446
it's fixed in newer wandb versions and maybe can check if the latest wandb is compatible with anomalib

@yuanchaolie
Copy link
Author

ah you're right! the issue comes with the wandb version. wandb/wandb#6446 it's fixed in newer wandb versions and maybe can check if the latest wandb is compatible with anomalib

Collecting wandb<=0.15.9,>=0.12.17

It doesn't seem to work, and anomalib itself will install the specified version "wandb-0.15.9-py3-none-any"

@samet-akcay
Copy link
Contributor

@ashwinvaidya17, can you remind us what was the breaking change in newer versions of wandb?

@yuanchaolie
Copy link
Author

@ashwinvaidya17, can you remind us what was the breaking change in newer versions of wandb?

I'm not sure if replacing wandb works, but now under 3.12 it's because the wandb version used references the old pathtools, which in turn references the error caused by imp

@samet-akcay samet-akcay linked a pull request Sep 25, 2024 that will close this issue
9 tasks
@github-staff github-staff deleted a comment from yiweifengyan Oct 23, 2024
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

Successfully merging a pull request may close this issue.

3 participants