-
Notifications
You must be signed in to change notification settings - Fork 980
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
Cannot import from conan.tools.layout #10260
Comments
Hi @LokiNinja, this is really unexpected, I have no idea what could be happening. I would try a couple of things:
|
I'm having a similar issue - the latest Manjaro update updated python to 3.10.1, plus I installed conan from AUR.
|
@LokiNinja using AUR too? The AUR package maintainer is @tivek Also @crucio55, is this something that only happens with latest Conan 1.44, or also previous versions? Did those previous versions used to work in Manjaro, and they broke with the Manjaro update? |
I suspect I updated python and conan around the same time, but before that, as of a few days ago, python 3.9 + previous conan versions worked perfectly |
Just for reference: I have checked locally Python 3.10 here in Windows, everything looking good. Could be something specific to the AUR package |
Hi @memsharded, |
Thanks for telling. Indeed super weird issue, please let me know your findings when you test with an earlier Python version (but apparently Python 3.10 was not an issue in my Windows 10 machin) |
One other weird thing is in visual studio code I can ctrl click on the cmake_layout function and it navigates just fine to the actual file, so vscode at least knows where its at. Ill keep investigating and let you know my findings. |
Switched python to 3.9.1 but seeing same error. Even tried switching to python 3.9.1-32 for 32 bit but no luck. Very odd issue as this definitely exists and conan imports resolve fine. When I have time later I will try installing and running in VM. |
One idea to check: some weird interaction with AV software. This is very unlikely, to affect only this file, but it wouldn't be the first time an AV in Windows mess with my files causing hours of debugging. Checking the AV logs might be worth. I would also try playing a bit directly with the package:
|
I'm a Manjaro user, I also have python 3.10.1 and Conan 1.44 installed, but everything works fine for me. I use only pip to install Conan, which is the recommended way. My guess is that you environment mixed the installed packaged x python versions available, so I suggest enforcing only the current python version on your commands (just for testing): /usr/bin/python3.10 -m pip install -U conan
/usr/bin/python3.10 -m conans.conan new hello/0.1 --template=cmake_lib
/usr/bin/python3.10 -m conans.conan create . user/testing Use only absolute path and with version as suffix, also enforce the module name. Also, you can show where Conan is installed on your system:
And check where Python is installing their packages:
Conan must be listed for both commands. As Manjaro always try to run the latest version of every package, sometimes, we get something bugged, including python. |
Removing the AUR version and installing from pip indeed made conan work again! |
Sorry for the late reply. When upgrading Arch Linux system Python package from one major version to another, one needs to rebuild and reinstall all local or AUR-sourced Python-dependent packages. So, after going between Python 3.9 and 3.10 Conan and its dependencies from AUR need to be reinstalled. Hope this helps. |
Great, thanks @tivek Then, it seems the Manjaro/AUR issue is addressed, and only the Windows failure by @LokiNinja is pending to resolve. |
@GrantMoyer reported https://github.com/conan-io/conan/pulls/10320 is fixing this. (released 1.44.1). |
Hi. Thanks. I'll give it a shot now. Any details on what the issue was?
…On Fri, Jan 28, 2022, 12:45 AM James ***@***.***> wrote:
@GrantMoyer <https://github.com/GrantMoyer> reported
https://github.com/conan-io/conan/pulls/10320 is fixing this. (released
1.44.1).
Can you please try and report? Otherwise this will be closed. Thanks!
—
Reply to this email directly, view it on GitHub
<#10260 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABO5ALNQW2ZBYHOE5YGFSE3UYJJTHANCNFSM5LEWROWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@LokiNinja oh, I see that probably not related to your case, and it might keep failing. The #10320 was fixing issues with the |
No activity from a while, no more reports from other users either, so closing it atm, please let us know if this is still an issue. |
Same here, but with |
I was going through this tutorial in the documentation: https://docs.conan.io/en/latest/creating_packages/getting_started.html
Upon trying to run 'conan create . demo/testing' it fails with the following error:
ERROR: Error loading conanfile at 'hellopkg\conanfile.py': Unable to load conanfile in hellopkg\conanfile.py
File , line 684, in _load
File , line 665, in _load_unlocked
File , line 678, in exec_module
File , line 219, in _call_with_frames_removed
File "hellopkg\conanfile.py", line 3, in
from conan.tools.layout import cmake_layout
ModuleNotFoundError: No module named 'conan.tools.layout'
The versions I am running are:
Python 3.10.0
Conan version 1.44.0
I have verified that the function does exist in \site-packages\conan\tools\layout but it is not found for some reason
The text was updated successfully, but these errors were encountered: