[bug] [1.52] conan error "ImportError: cannot import name '_get_component_name' from 'conan.tools.gnu.pkgconfigdeps'"
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: ubuntu 20.04
- Compiler+version: none
- Conan version: 1.52
- Python version: 3.8
Steps to reproduce (Include if Applicable)
pip3 install conan==1.52
conan --version
Logs (Executed commands with output) (Include/Attach if Applicable)
conan --version
Traceback (most recent call last):
  File "/home/dash/.local/bin/conan", line 7, in <module>
    from conans.conan import run
  File "/home/dash/.local/lib/python3.8/site-packages/conans/conan.py", line 7, in <module>
    from conans.client.command import main
  File "/home/dash/.local/lib/python3.8/site-packages/conans/client/command.py", line 14, in <module>
    from conans.client.conan_api import Conan, default_manifest_folder, _make_abs_path, ProfileData
  File "/home/dash/.local/lib/python3.8/site-packages/conans/client/conan_api.py", line 13, in <module>
    from conans.client.cmd.create import create
  File "/home/dash/.local/lib/python3.8/site-packages/conans/client/cmd/create.py", line 3, in <module>
    from conans.client.cmd.test import install_build_and_test
  File "/home/dash/.local/lib/python3.8/site-packages/conans/client/cmd/test.py", line 6, in <module>
    from conans.client.manager import deps_install
  File "/home/dash/.local/lib/python3.8/site-packages/conans/client/manager.py", line 7, in <module>
    from conans.client.installer import BinaryInstaller, call_system_requirements
  File "/home/dash/.local/lib/python3.8/site-packages/conans/client/installer.py", line 11, in <module>
    from conans.client.generators import TXTGenerator, write_toolchain
  File "/home/dash/.local/lib/python3.8/site-packages/conans/client/generators/__init__.py", line 23, in <module>
    from .markdown import MarkdownGenerator
  File "/home/dash/.local/lib/python3.8/site-packages/conans/client/generators/markdown.py", line 12, in <module>
    from conan.tools.gnu.pkgconfigdeps import (
ImportError: cannot import name '_get_component_name' from 'conan.tools.gnu.pkgconfigdeps' (/home/dash/.local/lib/python3.8/site-packages/conan/tools/gnu/pkgconfigdeps/__init__.py)
Issue Analytics
- State:
- Created a year ago
- Comments:13 (7 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
Unable to install conan through cmake - Stack Overflow
On installing cmake and conan in a build file this is the out put ... import run ImportError: No module named conans.conan CMake...
Read more >Changelog — conan 1.56.0 documentation
Bugfix: Fixed error with cased directory names in Windows. BugFix: Modified confusing warning message in the SCM tool when the remote couldn't be...
Read more >conanio/conan - Gitter
looking at the conanfile.py I see various package managers, and at the bottom: "package_manager.Pkg(self) ..." I assume this is what conan defaults to...
Read more >conan Changelog - pyup.io
Feature: Add `stdcpp_library` to `conan.tools.build` to get name of C++ standard library to ... import error (https://github.com/conan-io/conan/pull/12446)
Read more >cannot import name 'file_hash' from 'pooch.utils' - YouTube
How to resolve ImportError : cannot import name 'file_hash' from 'pooch.utils'
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

Hi @SergeyKrivohatskiy
It seems that some updates to 1.52 are not completely cleaning the previous stuff and something breaks. Can you please try installing a fresh Conan in a clean Python virtualenv (or maybe trying pipx), and see if the problem still reproduces?
Hi @Zvicii - thank you for reporting this issue. There was an issue with the
waylandrecipe inconan-center-indexwhere a private Conan API was used, and it changed internally across Conan versions. We are tracking this here https://github.com/conan-io/conan-center-index/issues/12722 as an issue related to the recipe - which needs to be fixed.