【问题标题】:Error when installing cmake for python windows为 python windows 安装 cmake 时出错
【发布时间】:2017-04-17 13:12:07
【问题描述】:

我有 Windows 10 和新的 Python 3.6.1。 我试图安装包 Cmake 0.6.0(需要另一个包,atari-py)使用

pip install cmake

但我遇到了一个错误。

我安装了以下软件包:pip、scikit-build、setuptools、wheel、pybdist。 我的帐户名中确实有一个外国符号(经验教训),但在安装其他软件包时它工作正常。我不是熟练的 Windows 管理员。

Collecting cmake
  Using cached cmake-0.6.0.tar.gz
Building wheels for collected packages: cmake
  Running setup.py bdist_wheel for cmake: started
  Running setup.py bdist_wheel for cmake: finished with status 'error'
  Complete output from command C:\Python\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Čejkis\\AppData\\Local\\Temp\\pycharm-packaging1\\cmake\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\EJKIS~1\AppData\Local\Temp\tmp3br7eri7pip-wheel- --python-tag cp36:
  Traceback (most recent call last):
    File "C:\Python\Python36-32\lib\site-packages\skbuild\setuptools_wrap.py", line 405, in setup
      cmkr = cmaker.CMaker()
    File "C:\Python\Python36-32\lib\site-packages\skbuild\cmaker.py", line 67, in __init__
      "Problem with the CMake installation, aborting build.")

  Problem with the CMake installation, aborting build.

  ----------------------------------------
  Running setup.py clean for cmake
Failed to build cmake
Installing collected packages: cmake
  Running setup.py install for cmake: started
    Running setup.py install for cmake: finished with status 'error'
    Complete output from command C:\Python\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Čejkis\\AppData\\Local\\Temp\\pycharm-packaging1\\cmake\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\EJKIS~1\AppData\Local\Temp\pip-5ql_x35g-record\install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):
      File "C:\Python\Python36-32\lib\site-packages\skbuild\setuptools_wrap.py", line 405, in setup
        cmkr = cmaker.CMaker()
      File "C:\Python\Python36-32\lib\site-packages\skbuild\cmaker.py", line 67, in __init__
        "Problem with the CMake installation, aborting build.")

    Problem with the CMake installation, aborting build.

    ----------------------------------------

  Failed building wheel for cmake
Command "C:\Python\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Čejkis\\AppData\\Local\\Temp\\pycharm-packaging1\\cmake\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\EJKIS~1\AppData\Local\Temp\pip-5ql_x35g-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Čejkis\AppData\Local\Temp\pycharm-packaging1\cmake\

【问题讨论】:

    标签: python cmake pip


    【解决方案1】:

    如果上述 pip3 或 pip install cmake 的答案不起作用,请尝试

    sudo apt-get install cmake

    【讨论】:

      【解决方案2】:

      python -m pip install --upgrade pip

      然后你就可以运行了

      pip3 install cmake

      这适用于 Pyhton 3.8

      【讨论】:

        【解决方案3】:

        截至今天,python 3.6 的 CMake 轮子可用,pip install cmake 预计可以工作。

        背景

        在您发表第一篇文章时,python 3.6 还没有轮子,pip 正试图使用​​源代码分发来构建轮子。

        考虑到:

        • 允许生成 CMake 轮子的项目本身依赖于 scikit-buildcmake

        • 我们只需将现有的二进制文件重新打包到 windows 轮子中

        ...您收到一般错误消息Problem with the CMake installation, aborting build

        参考资料:

        在 windows 上安装 atari-py

        查看对应项目的文档和open pull requests,好像不支持windows。见https://github.com/openai/atari-py

        如果您想帮助该项目并改进他们的 Windows 支持,请告诉我,我可以尝试为您提供一些指导来创建拉取请求并简化他们的构建系统。

        【讨论】:

          【解决方案4】:

          最终我从他们网页的二进制文件中安装了 cmake 0.8。 我最初想安装需要 cmake 的包 atari-py。我从 git 下载了它,并在 cmd 中运行了管理员权限

          python install setup.py
          

          哪个有效。

          python setup.py install
          

          还是不行。不幸的是,我无法给出任何进一步的解释。

          【讨论】:

            【解决方案5】:

            我刚刚下载了带有 C++ 库的 VS Code,并且成功了,我能够安装 CMake。 (顺便说一句,我在 Windows 10 上)

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 2016-08-15
              • 2021-12-18
              • 2018-09-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2020-05-29
              • 1970-01-01
              相关资源
              最近更新 更多