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

[feature] conan download (version>2.x) shows an import error message when downloading a conan 1.x recipe #14260

Closed
1 task done
davidsanfal opened this issue Jul 10, 2023 · 0 comments · Fixed by #14261
Closed
1 task done
Assignees
Milestone

Comments

@davidsanfal
Copy link
Contributor

What is your suggestion?

conan download (version>2.x) shows an import error message when downloading a conan 1.x recipe.

The error message should be omitted or clarified because it seems that the command has failed, although the recipe has been downloaded.

Current output:

conan download --only-recipe tinydir/1.2.4 -r conancenter
Downloading recipe 'tinydir/1.2.4#cc72af24237f34698122f8b87eea32e9'
ERROR: Error loading conanfile at '/Users/anonymous/.conan2/p/tinyddab41e98996fb/e/conanfile.py': Unable to load conanfile in /Users/anonymous/.conan2/p/tinyddab41e98996fb/e/conanfile.py
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/anonymous/.conan2/p/tinyddab41e98996fb/e/conanfile.py", line 2, in <module>
    from conans import ConanFile, tools
ImportError: cannot import name 'ConanFile' from 'conans' (/Users/anonymous/venv/lib/python3.9/site-packages/conans/__init__.py)

Suggested output.

Show that conan has downloaded the recipe successfully but it seems that it is not compatible with the installed conan client.

conan download --only-recipe tinydir/1.2.4 -r conancenter
Downloading recipe 'tinydir/1.2.4#cc72af24237f34698122f8b87eea32e9'

The recipe has been downloaded successfully but it seems that it is not compatible with the installed conan client:

ERROR: Error loading conanfile at '/Users/anonymous/.conan2/p/tinyddab41e98996fb/e/conanfile.py': Unable to load conanfile in /Users/anonymous/.conan2/p/tinyddab41e98996fb/e/conanfile.py
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/anonymous/.conan2/p/tinyddab41e98996fb/e/conanfile.py", line 2, in <module>
    from conans import ConanFile, tools
ImportError: cannot import name 'ConanFile' from 'conans' (/Users/anonymous/venv/lib/python3.9/site-packages/conans/__init__.py)

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants