首页 > 解决方案 > CMake 不显示版本

问题描述

$cmake --version
Traceback (most recent call last):
  File "/home/pranto/.local/bin/cmake", line 7, in <module>
    from cmake import cmake
ImportError: cannot import name 'cmake'

Ubuntu 18.04,Python = 3.6。

我最近将我的 python 版本从 2.7 升级到 3.6,然后开始看到这个错误。我该如何解决这个问题?

标签: pythoncmakeubuntu-18.04

解决方案


要记录 OP 的解决方案:

您必须在新的 Python 环境(3.6)中重新安装CMake:

pip3 install cmake

推荐阅读