ERROR: <some package> Cannot load recipe. . . ImportError: cannot import name 'export_conandata_patches'
See original GitHub issueEnvironment Details
- Ubuntu 18.04
- gcc (Ubuntu 11.1.0-1ubuntu1~18.04.1) 11.1.0
- Conan 1.53.3
- Python 3.6.9
Config:
[log]
run_to_output = True # environment CONAN_LOG_RUN_TO_OUTPUT
run_to_file = False # environment CONAN_LOG_RUN_TO_FILE
level = 50 # environment CONAN_LOGGING_LEVEL
print_run_commands = False # environment CONAN_PRINT_RUN_COMMANDS
[general]
default_profile = default
compression_level = 9 # environment CONAN_COMPRESSION_LEVEL
sysrequires_sudo = True # environment CONAN_SYSREQUIRES_SUDO
request_timeout = 60 # environment CONAN_REQUEST_TIMEOUT (seconds)
default_package_id_mode = semver_direct_mode # environment CONAN_DEFAULT_PACKAGE_ID_MODE
revisions_enabled = True
[storage]
path = /home/gary/Repo/ConanData
[proxies]
[hooks]
attribute_checker
Profile:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
CC=/usr/bin/gcc-11
CXX=/usr/bin/g++-11
Steps to reproduce (Include if Applicable)
conan install -r conanio bzip2/1.0.6@ OR conan install -r conanio bzip2/1.0.8@ OR conan install -r conanio zlib/1.2.12@ OR conan install -pr=c++20 -r conanio poco/1.12.2@ (fails because of zlib/1.2.12) e.t.c.
Logs (Executed commands with output) (Include/Attach if Applicable)
→ conan install -pr=c++20 -r conanio zlib/1.2.12@
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
CC=/usr/bin/gcc-11
CXX=/usr/bin/g++-11
ERROR: zlib/1.2.12: Cannot load recipe.
Error loading conanfile at '/home/gary/Repo/ConanData/zlib/1.2.12/_/_/export/conanfile.py': Unable to load conanfile in /home/gary/Repo/ConanData/zlib/1.2.12/_/_/export/conanfile.py
File "/usr/lib/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/gary/Repo/ConanData/zlib/1.2.12/_/_/export/conanfile.py", line 3, in <module>
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, load, replace_in_file, save
ImportError: cannot import name 'export_conandata_patches'
I have tried Conan version 1.52 and 1.53 with no success so I went back to 1.51.3. This seems to happen with packages that many other packages depend on. I’m not a python expert and do not understand what it is trying to tell me (if anything). I checked in my ConanData directory for the failed packages and there is a conanfile.py in their respective export directories, so I do not undersand the error where it says Error loading conanfile at '/home/gary/Repo/ConanData/zlib/1.2.12/_/_/export/conanfile.py
.
This problem means I cannot rebuild older projects with different settings from before. It fails with my default profile (gcc-7) or the newer.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@gazzatav I recommend you using pyenv if possible. It’s very easy to install and much more flexible than using the native python offered by Ubuntu.
Also, to be sure about which python x conan you are using, you can try:
Passing a target module, instead calling
conan
directly, you guarantee which Python is related.@memsharded Thanks, yes, closing - just wanted to leave it open a while in case of any other useful comments.