无法在 python 中安装 owa-epanet

无法在 python 中安装 owa-epanet

我是 python 新手。我需要在我的计算机上安装 owa-epanet,所以我使用了代码pip install owa-epanet。但它返回了如下所示的错误:

C:\Users\Ziyuan>pip install owa-epanet
Collecting owa-epanet
  Using cached owa-epanet-2.2.3.tar.gz (800 kB)
Building wheels for collected packages: owa-epanet
  Building wheel for owa-epanet (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\ziyuan\appdata\local\programs\python\python37\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ziyuan\\AppData\\Local\\Temp\\pip-install-q6ub27xj\\owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ziyuan\\AppData\\Local\\Temp\\pip-install-q6ub27xj\\owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Ziyuan\AppData\Local\Temp\pip-wheel-g59ckj0l'
       cwd: C:\Users\Ziyuan\AppData\Local\Temp\pip-install-q6ub27xj\owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2\
  Complete output (153 lines):


  --------------------------------------------------------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 Win64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/Ziyuan/AppData/Local/Temp/pip-install-q6ub27xj/owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 Win64 v141)" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "Visual Studio 15 2017 Win64 v141" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 15 2017 Win64

    could not find any instance of Visual Studio.



  -- Configuring incomplete, errors occurred!
  See also "C:/Users/Ziyuan/AppData/Local/Temp/pip-install-q6ub27xj/owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Visual Studio 15 2017 Win64 v141" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles (Visual Studio 15 2017 Win64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  -- The C compiler identification is unknown
  CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
    The CMAKE_C_COMPILER:

      cl

    is not a full path and was not found in the PATH.

    To use the NMake generator with Visual C++, cmake must be run from a shell
    that can use the compiler cl from the command line.  This environment is
    unable to invoke the cl compiler.  To fix this problem, run cmake from the
    Visual Studio Command Prompt (vcvarsall.bat).

    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/Ziyuan/AppData/Local/Temp/pip-install-q6ub27xj/owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  See also "C:/Users/Ziyuan/AppData/Local/Temp/pip-install-q6ub27xj/owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles (Visual Studio 15 2017 Win64 v141)" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles JOM (Visual Studio 15 2017 Win64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  -- The C compiler identification is unknown
  CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
    The CMAKE_C_COMPILER:

      cl

    is not a full path and was not found in the PATH.

    To use the JOM generator with Visual C++, cmake must be run from a shell
    that can use the compiler cl from the command line.  This environment is
    unable to invoke the cl compiler.  To fix this problem, run cmake from the
    Visual Studio Command Prompt (vcvarsall.bat).

    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/Ziyuan/AppData/Local/Temp/pip-install-q6ub27xj/owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  See also "C:/Users/Ziyuan/AppData/Local/Temp/pip-install-q6ub27xj/owa-epanet_dc5c9205daa9406797dfe7c2d9957cd2/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles JOM (Visual Studio 15 2017 Win64 v141)" generator - failure
  --------------------------------------------------------------------------------

  ********************************************************************************
  scikit-build could not get a working generator for your system. Aborting build.

  Building windows wheels for Python 3.7 requires Microsoft Visual Studio 2017.
  Get it with "Visual Studio 2017":

    https://visualstudio.microsoft.com/vs/

  ********************************************************************************
  ----------------------------------------
  ERROR: Failed building wheel for owa-epanet

您能给我一些建议,告诉我下一步该怎么做吗?非常感谢!

答案1

您能给我一些建议吗,下一步我应该做什么?

由于 CMake 明确表示找不到 Windows 的命令行版本视觉工作室cl.exe为了构建可用的版本,请在您的路径中添加编译器( ) owa-epanet,最简单的操作过程可能是:

  • 确保 Visual Studio(或至少其工具集)已正确安装。

  • 确保cl.exe可以从命令行正确检测到。


请注意,如果你想确保最大兼容性,你可以获取旧版本的 Visual Studio这里

相关内容