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

tell me what is this and how can i resolve this. #16152

Open
1 task done
Rajan251 opened this issue Apr 26, 2024 · 8 comments
Open
1 task done

tell me what is this and how can i resolve this. #16152

Rajan251 opened this issue Apr 26, 2024 · 8 comments
Assignees
Labels
staled The issue has been inactive for a while and will be closed soon type: question

Comments

@Rajan251
Copy link

What is your question?

ERROR: Error loading conanfile at '/home/opentdf/client-cpp/src/conanfile.py': Unable to load conanfile in /home/opentdf/client-cpp/src/conanfile.py
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/opentdf/client-cpp/src/conanfile.py", line 1, in
from conans import ConanFile, CMake
ImportError: cannot import name 'ConanFile' from 'conans' (/root/conan-io/conans/init.py)

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@czoido czoido self-assigned this Apr 26, 2024
@czoido
Copy link
Contributor

czoido commented Apr 26, 2024

Hi @Rajan251,
Thanks for the question.
It seems that the recipe you are using is written for Conan 1.X but not compatible for Conan 2.
I see that this is related to the opentdf client, and we have a recipe compatible with Conan 2 in Conan Center, maybe you can use that one, check the ones available doing:

➜  conan search opentdf-client
Found 27 pkg/version recipes matching opentdf-client in conancenter
conancenter
  opentdf-client
    ...
    opentdf-client/1.5.0
    opentdf-client/1.5.3
    opentdf-client/1.5.4
    opentdf-client/1.5.6

Hope this helps.

@memsharded
Copy link
Member

Any feedback here @Rajan251? Is the question solved, can we close the ticket?

@memsharded memsharded added the staled The issue has been inactive for a while and will be closed soon label May 2, 2024
@Rajan251
Copy link
Author

Rajan251 commented May 3, 2024

Thanks for reverting @czoido, I am using this version :

root@open:/home/opentdf/client-cpp/src# conan --version
Conan version 2.3.0-dev

Issue: Running the script build-all.sh results in an error.
Error Message:

ERROR: Error loading conanfile at '/home/opentdf/client-cpp/src/conanfile.py': Unable to load conanfile in /home/opentdf/client-cpp/src/conanfile.py
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/opentdf/client-cpp/src/conanfile.py", line 1, in <module>"
  from conans import ConanFile, CMake
ImportError: cannot import name 'ConanFile' from 'conans' (/home/opentdf/conan-io/conans/__init__.py)

Context: This error occurs specifically in the line conan install .. --build=missing within the build-all.sh script.

can you please provide updatated documention for installation process.

@memsharded
Copy link
Member

If you want to use Conan 1, you should be installing Conan 1.
With pip it will be something like pip install conan==1.64.0. If you are downloading the installer you have all versions in Github: https://github.com/conan-io/conan/releases.

In any case, Conan 1 is legacy now, it is strongly recommended to update to Conan 2, which was released more than 1 year ago now.

@Rajan251
Copy link
Author

Rajan251 commented May 3, 2024

Hi memsharded,

refer the issue raised, while checking the version , this is showing

root@open:/home/opentdf/client-cpp/src# conan --version
Conan version 2.3.0-dev

do you mean we should use Conan version 1 and not 2 ?

@memsharded
Copy link
Member

You should try to use Conan 2, because it is now the mainstream, supported and recommended version.

But you are trying to load an old recipe that works only with Conan 1.X, so you cannot use Conan 2 for it, and you must install Conan 1.X if you want to use this recipe without modernizing it.

@Rajan251
Copy link
Author

Rajan251 commented May 4, 2024

Thankyou @memsharded.
please guide how to get modernized recipe based on Conan 2 was trying to find the same all this while.

@memsharded
Copy link
Member

This is the guide to update recipes to Conan 2: https://docs.conan.io/1/conan_v2.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staled The issue has been inactive for a while and will be closed soon type: question
Projects
None yet
Development

No branches or pull requests

3 participants