簡體   English   中英

無法在 PyCharm venv 中安裝帶有 pip 的 PyNaCl

[英]Cant install PyNaCl with pip inside a PyCharm venv

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

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 都已安裝。

我最終通過使用python -m pip install --no-use-pep517 pynacl解決了它

在 venv 中升級 pip 對我有用:

.\env\Scripts\activate
pip install -U pip
pip install -r requirements.txt
deactivate

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM