【问题标题】:How to diagnose conan install issue如何诊断柯南安装问题
【发布时间】:2019-08-01 06:53:30
【问题描述】:

我有一些关于柯南的安装问题

在我的 Ubuntu 18.04 告诉“找不到命令‘柯南’”之后,我猜到了 Python 版本错误。所以我尝试用结果升级

$ sudo apt-get install python
python is already the newest version (2.7.15~rc1-1)

然而

$ locate python
/var/lib/binfmts/python2.7
/var/lib/binfmts/python3.6

在这种状态下我尝试安装柯南

$ pip install conan
Collecting conan
...
Successfully installed Jinja2-2.10.1 MarkupSafe-1.1.1 PyJWT-1.7.1 PyYAML-5.1.2 astroid-1.6.6 attrs-19.1.0 backports.functools-lru-cache-1.5 bottle-0.12.17 certifi-2019.6.16 chardet-3.0.4 colorama-0.4.1 conan-1.18.0 configparser-3.7.4 deprecation-2.0.6 distro-1.1.0 enum34-1.1.6 fasteners-0.15 future-0.16.0 futures-3.3.0 idna-2.8 isort-4.3.21 lazy-object-proxy-1.4.1 mccabe-0.6.1 monotonic-1.5 node-semver-0.6.1 packaging-19.1 patch-1.16 pluginbase-0.7 pygments-2.4.2 pylint-1.9.5 pyparsing-2.4.2 python-dateutil-2.8.0 requests-2.22.0 singledispatch-3.4.0.3 six-1.12.0 tqdm-4.32.2 urllib3-1.25.3 wrapt-1.11.2

然后“柯南”被列为正在安装,但是

$ conan

Command 'conan' not found, did you mean:

即没有错误消息或警告,只是不安装。 我发现我的 PATH 中没有列出该路径,所以我添加了“~.local/bin”。现在故事继续,出现错误消息

CMake Error at CMakeLists.txt:90 (include):
  include could not find load file:

    Conan

我发现 https://docs.conan.io/en/latest/howtos/cmake_launch.html。 好的,我在我的 CMakeLists.txt 文件行中插入了

# Download automatically, you can also just copy the conan.cmake file

if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
   message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
   file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
                  "${CMAKE_BINARY_DIR}/conan.cmake")
endif()

include(${CMAKE_BINARY_DIR}/conan.cmake)

conan_cmake_run(REQUIRES Catch2/2.6.0@catchorg/stable
                BASIC_SETUP)

我也被告知,

  Please specify in command line CMAKE_BUILD_TYPE
  (-DCMAKE_BUILD_TYPE=Release)

所以我用

cmake .. -DCMAKE_BUILD_TYPE=Release

而不是

cmake ..

我还是收到了

ERROR: compiler not defined for compiler.libcxx
Please define compiler value first too
FATAL_ERROR;conan install command failed.
STATUS;Conan: Compiler GCC>=5, checking major version 7
STATUS;Conan: Checking correct version: 7

大约两周前,我可以在另一个系统上完美地安装相同的项目。我能以某种方式回到那个状态吗?我希望柯南是稳定的,而不是 alpha。

编辑 2: 我发了

 conan profile new default --detect --force

回复是

Found gcc 7
gcc>=5, using the major as version

************************* WARNING: GCC OLD ABI COMPATIBILITY ***********************

Conan detected a GCC version > 5 but has adjusted the 'compiler.libcxx' setting to
'libstdc++' for backwards compatibility.
Your compiler is likely using the new CXX11 ABI by default (libstdc++11).

(我真的不知道为什么在一个新项目的情况下我需要向后兼容)然后,

cmake ..

似乎终于奏效了。由于编译器标准,恐怕我会遇到更多问题。例如,SystemC 默认为 '98,但其他一些库使用需要 '14 的功能,现在柯南强制使用 '11。有没有办法集中处理所有这些,特定于我的系统?

关于两个python版本:我没有手动安装,只有其他一些安装程序这样做了。我真的不知道为什么以及哪个安装脚本会导致这种翻倍。顺便说一句:Ubuntu 说 V2.7 是最新版本,尽管 V3.x 也存在。我对这些版本号有点困惑。 我只是做了一个新的安装,并没有特别在python的第二个版本出现的时候。我个人连python都不用,只有一些安装脚本可以安装。

我的系统是否是特定的:我不这么认为。我刚刚安装了 Ubuntu 18.04.2,我的主要目标是安装这个 SystemC 相关的东西。我真的只安装了被声明为丢失的东西。 (加上livetex、git等)

与此同时,'cmake ..' 终止了。显然,柯南的安装终止了。但是,在配置我的项目时,会给出类似

的消息
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SCV_INCLUDE_DIRS

丢失的文件也是由柯南安装的,使用

[requires]
SystemC/2.3.3@minres/stable
SystemCVerification/2.0.1@minres/stable
doxygen_installer/1.8.15@bincrafters/stable
qt/5.12.0@bincrafters/stable
gtest/1.8.1@bincrafters/stable
flex/2.6.4@bincrafters/stable

我使用的是完全相同的文件(我的旧磁盘连接到总线或新磁盘,使用相同的电缆)。大约一个月前进行的安装运行良好,新的安装与描述的一样。

看来安装和使用柯南对我来说太复杂了。我想简化安装而不是让它复杂化。

【问题讨论】:

    标签: python installation conan


    【解决方案1】:

    这里列出了一堆与安装相关的案例:
    https://docs.conan.io/en/latest/installation.html#known-installation-issues-with-pip

    我会说柯南已安装但未在您的 PATH 中列出。你可以在你的 Python 包文件夹中找到柯南并用柯南路径更新你的 PATH:

    python -m site # list your package folder
    find <package folder> -name conan
    echo PATH=${PATH}:<package folder> >> ~/.bashrc
    source ~/.bashrc
    

    【讨论】:

    • 谢谢,我会试试的。我没想到会这样。几天前我之前的安装很顺利。
    • 是的,这就是问题所在。我将 ':MyHome/.local/bin' 添加到我的 PATH 中,现在柯南可见。顺便说一句:'find ~ -name conan' 有点短
    • a cmake .. 导致 Please define compiler value first too FATAL_ERROR;conan install 命令失败。 cmake/Conan.cmake:44 (include) 处的 CMake 错误:include 找不到加载文件:/home/jvegh/DEVEL/SCQtSimulation/build/conanbuildinfo.cmake
    • 柯南会生成一个 cmake 文件来在你的 cmake 上下文中注入所有依赖项,它工作正常,但是,柯南无法检测到你的编译器,这很奇怪。让我们再次尝试识别您的个人资料:conan profile new default --detect --force。该命令通过 CC、CXX 环境变量或运行诸如 cc、cpp 之类的命令,甚至运行 gcc --version 和 clang --version 来搜索您的默认编译器。我会说你的系统环境不好,柯南和编译器都没有检测到。
    • 顺便说一句,我会推荐 python3 作为默认值,因为有很多改进。由于您的系统中同时安装了 python2.7 和 3,您需要创建一个别名来设置默认版本:echo "alias python=python3" &gt;&gt; ~/.bashrcalias pip=pip3" &gt;&gt; ~/.bashrc
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-15
    • 2023-02-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-01
    相关资源
    最近更新 更多