首页 > 解决方案 > 无法在 PyCharm venv 中安装带有 pip 的 PyNaCl

问题描述

在 Windows 10 上使用 python3.8.1,安装最新版本:

pip install PyNaCl给我这个错误(最后 10 行):

    File "C:\Program Files (x86)\Python3\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Program Files (x86)\Python3\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "setup.py", line 161, in run
      raise Exception("ERROR: The 'make' utility is missing from PATH")
  Exception: ERROR: The 'make' utility is missing from PATH

  ----------------------------------------
  Failed building wheel for PyNaCl
  Running setup.py clean for PyNaCl
Failed to build PyNaCl
Could not build wheels for PyNaCl which use PEP 517 and cannot be installed directly

它似乎与车轮有关,所以我尝试用 安装它no-binary,但也失败了:

      File "C:\Program Files (x86)\Python3\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\Administrator\AppData\Local\Temp\pip-install-q0db5s_n\PyNaCl\setup.py", line 161, in run
        raise Exception("ERROR: The 'make' utility is missing from PATH")
    Exception: ERROR: The 'make' utility is missing from PATH

    ----------------------------------------
Command "C:\Users\Administrator\Documents\DiscordBot\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-q0db5s_n\\PyNaCl\\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\Administrator\AppData\Local\Temp\pip-record-s27dvlrv\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Administrator\Documents\DiscordBot\venv\include\site\python3.8\PyNaCl" failed with error code 1 in C:\Users\Administrator\AppData\Local\Temp\pip-install-q0db5s_n\PyNaCl\

编辑:这似乎只是我的 venv (由 Pycharm 制造)中的一个问题 - 我不知道问题是什么,setuptools 和 wheel 都已安装。

标签: pythonpippython-wheel

解决方案


我最终通过使用解决了它python -m pip install --no-use-pep517 pynacl


推荐阅读