question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR: <some package> Cannot load recipe. . . ImportError: cannot import name 'export_conandata_patches'

See original GitHub issue

Environment 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:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
uilianriescommented, Oct 26, 2022

@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:

python3 -m conans.conan install -r conanio bzip2/1.0.6@

Passing a target module, instead calling conan directly, you guarantee which Python is related.

0reactions
gazzatavcommented, Oct 31, 2022

@memsharded Thanks, yes, closing - just wanted to leave it open a while in case of any other useful comments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[question] Pipeline failures due to changes in packages
ERROR : hiredis/1.0.2: Cannot load recipe. ... get, rmdir ImportError: cannot import name 'export_conandata_patches' from 'conan.tools.files' ...
Read more >
Conan import error in gitlab pipeline - Cannot load recipe
The export_conandata_patches is available since Conan 1.52.0. You need to update your Conan client version: pip install -U conan.
Read more >
1784088 – Import of smb module not working, fleet- ...
Hi Samba-Package Team, Description of problem: ImportError: cannot import name 'smb' from 'samba' ...
Read more >
Changelog — conan 1.56.0 documentation
Fix: Fixed failure with the alias packages when the name of the package (excluded the version) was different from the aliased package. Now...
Read more >
conda-forge/conda-forge.github.io - Gitter
Based on this, can you see which package is python38-incompatible? ... ImportError: cannot import name '_dukpy' from partially initialized module 'dukpy' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found