今天pip裝一個(gè)python包死活裝不上,報(bào)的錯(cuò)也奇奇怪怪:
CMake Error at CMakeLists.txt:8 (cmake_minimum_required):
CMake 3.18...3.27 or higher is required. You are running version 3.10.2
從來(lái)沒(méi)見(jiàn)過(guò)的錯(cuò)誤邪驮,sudo apt install cmake
cmake is already the newest version (3.10.2-1ubuntu2.18.04.2).
于是升級(jí)一下GPU docker的cmake
- 下載
wget https://cmake.org/files/v3.22/cmake-3.22.1.tar.gz
- 解壓:
tar -xvzf cmake-3.22.1.tar.gz
- 進(jìn)入解壓目錄连躏,配置成功之后顯示:CMake has bootstrapped. Now run make.
chmod 777 ./configure
./configure
- 配置完成后石景,編譯:
make
- 編譯完成后,安裝:
sudo make install
- 最后使用新安裝的cmake替換舊版本畦幢,其中/usr/local/bin/cmake為新安裝的cmake目錄坎吻。
# 新cmake
/usr/local/bin/cmake --version
# 老cmake
/usr/bin/cmake --version
# 替換
sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
- 最后測(cè)試cmake版本:
cmake --version
# cmake version 3.22.1
# CMake suite maintained and supported by Kitware (kitware.com/cmake).