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] Conan 1 is broken for Python 3.12 #14801

Closed
jwillikers opened this issue Sep 21, 2023 · 5 comments
Closed

[bug] Conan 1 is broken for Python 3.12 #14801

jwillikers opened this issue Sep 21, 2023 · 5 comments
Milestone

Comments

@jwillikers
Copy link
Contributor

jwillikers commented Sep 21, 2023

Environment details

  • Operating System+version: Fedora Linux 39
  • Compiler+version: GCC 13.2.1
  • Conan version: 1.61.0
  • Python version: 3.12.0rc3

Note: The imp module was removed in Python 3.12. See here.

Steps to reproduce

  1. python3 -m pip install conan==1.61
  2. conan --version

Logs

conan --version
Traceback (most recent call last):
  File "/home/jordan/.local/bin/conan", line 5, in <module>
    from conans.conan import run
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/conan.py", line 7, in <module>
    from conans.client.command import main
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/client/command.py", line 14, in <module>
    from conans.client.conan_api import Conan, default_manifest_folder, _make_abs_path, ProfileData
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/client/conan_api.py", line 13, in <module>
    from conans.client.cmd.create import create
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/client/cmd/create.py", line 3, in <module>
    from conans.client.cmd.test import install_build_and_test
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/client/cmd/test.py", line 6, in <module>
    from conans.client.manager import deps_install
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/client/manager.py", line 7, in <module>
    from conans.client.installer import BinaryInstaller, call_system_requirements
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/client/installer.py", line 27, in <module>
    from conans.model.graph_lock import GraphLockFile
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/model/graph_lock.py", line 7, in <module>
    from conans.client.graph.python_requires import PyRequires
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/client/graph/python_requires.py", line 5, in <module>
    from conans.client.loader import parse_conanfile
  File "/home/jordan/.local/lib/python3.12/site-packages/conans/client/loader.py", line 2, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
@franramirez688 franramirez688 added this to the 1.62 milestone Sep 22, 2023
@jwillikers
Copy link
Contributor Author

This was fixed for Conan V2 in #10127 but the fix was never backported to Conan V1.

@RubenRBS
Copy link
Member

Hi! Thanks a lot for your report. We didn't originally backport this for backwards compatibility reasons - Some corner cases of imp's usage differ from importlib's, so we stuck with the old deprecated api around.

Our plan is to release 1.62 with a check for Python 3.12 to fallback to the newer importlib - Note that this might have unintended differences in corer cases when running under 3.12 in Conan 1 compared to previous Python's versions

@jwillikers
Copy link
Contributor Author

@RubenRBS Thanks! I've patched Conan 1 locally to use importlib and I haven't been experiencing any problems. I'll let you know if I run into anything. Unfortunately, we're pretty much blocked from upgrading to Conan V2 until the Qt Conan package is upgraded to support it.

@RubenRBS
Copy link
Member

Thanks! Hopefully the transition to importlib under Python 3.12 goes smoothly then :)

(Thanks for the qt ping, I've asked the team to try to prioritize it if possible to try to unblock you)

@RubenRBS
Copy link
Member

Closed in #14841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants