pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.07k stars 232 forks source link

build pynacl failed in python 3.8 #662

Closed alexbprofit closed 3 years ago

alexbprofit commented 3 years ago
**(untitled) E:\Download\python\untitled>make
make: *** No targets specified and no makefile found.  Stop.**

(untitled) E:\Download\python\untitled>pip install --use-pep517 pynacl
Collecting pynacl
  Using cached https://files.pythonhosted.org/packages/cf/5a/25aeb636baeceab15c8e57e66b8aa930c
011ec1c035f284170cacb05025e/PyNaCl-1.4.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: six in e:\download\python\untitled\lib\site-packages (from pyna
cl) (1.15.0)
Collecting cffi>=1.4.1 (from pynacl)
  Using cached https://files.pythonhosted.org/packages/a8/20/025f59f929bbcaa579704f443a4381359
18484fffaacfaddba776b374563/cffi-1.14.5.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting pycparser (from cffi>=1.4.1->pynacl)
  Using cached https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36ef
adfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl
Building wheels for collected packages: pynacl, cffi
  Building wheel for pynacl (PEP 517) ... error
  Complete output from command E:\Download\python\untitled\Scripts\python.exe E:\Download\pyth
on\untitled\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\pep517\_in_process.py build_whe
el C:\Users\Alex_PC\AppData\Local\Temp\tmpcy3oa6fw:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\nacl
  copying src\nacl\encoding.py -> build\lib.win-amd64-3.8\nacl
  copying src\nacl\exceptions.py -> build\lib.win-amd64-3.8\nacl
  copying src\nacl\hash.py -> build\lib.win-amd64-3.8\nacl
  copying src\nacl\hashlib.py -> build\lib.win-amd64-3.8\nacl
  copying src\nacl\public.py -> build\lib.win-amd64-3.8\nacl
  copying src\nacl\secret.py -> build\lib.win-amd64-3.8\nacl
  copying src\nacl\signing.py -> build\lib.win-amd64-3.8\nacl
  copying src\nacl\utils.py -> build\lib.win-amd64-3.8\nacl
  copying src\nacl\__init__.py -> build\lib.win-amd64-3.8\nacl
  creating build\lib.win-amd64-3.8\nacl\pwhash
  copying src\nacl\pwhash\argon2i.py -> build\lib.win-amd64-3.8\nacl\pwhash
  copying src\nacl\pwhash\argon2id.py -> build\lib.win-amd64-3.8\nacl\pwhash
  copying src\nacl\pwhash\scrypt.py -> build\lib.win-amd64-3.8\nacl\pwhash
  copying src\nacl\pwhash\_argon2.py -> build\lib.win-amd64-3.8\nacl\pwhash
  copying src\nacl\pwhash\__init__.py -> build\lib.win-amd64-3.8\nacl\pwhash
  creating build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_aead.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_box.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_core.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_generichash.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_hash.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_kx.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_pwhash.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_scalarmult.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_secretbox.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_secretstream.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_shorthash.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\crypto_sign.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\randombytes.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\sodium_core.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\utils.py -> build\lib.win-amd64-3.8\nacl\bindings
  copying src\nacl\bindings\__init__.py -> build\lib.win-amd64-3.8\nacl\bindings
  running build_clib
  Traceback (most recent call last):
    File "E:\Download\python\untitled\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\pep51
7\_in_process.py", line 207, in <module>
      main()
    File "E:\Download\python\untitled\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\pep51
7\_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "E:\Download\python\untitled\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\pep51
7\_in_process.py", line 140, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "C:\Users\Alex_PC\AppData\Local\Temp\pip-build-env-9vnh5q8b\overlay\Lib\site-packages
\setuptools\build_meta.py", line 221, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "C:\Users\Alex_PC\AppData\Local\Temp\pip-build-env-9vnh5q8b\overlay\Lib\site-packages
\setuptools\build_meta.py", line 207, in _build_with_temp_dir
      self.run_setup()
    File "C:\Users\Alex_PC\AppData\Local\Temp\pip-build-env-9vnh5q8b\overlay\Lib\site-packages
\setuptools\build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 216, in <module>
      setup(
    File "C:\Users\Alex_PC\AppData\Local\Temp\pip-build-env-9vnh5q8b\overlay\Lib\site-packages
\setuptools\__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\Alex_PC\AppData\Local\Programs\Python\Python38\lib\distutils\core.py", line
 148, in setup
      dist.run_commands()
    File "C:\Users\Alex_PC\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line
 966, in run_commands
      self.run_command(cmd)
    File "C:\Users\Alex_PC\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line
 985, in run_command
      cmd_obj.run()
    File "C:\Users\Alex_PC\AppData\Local\Temp\pip-build-env-9vnh5q8b\overlay\Lib\site-packages
\wheel\bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "C:\Users\Alex_PC\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line
313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Alex_PC\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line
 985, in run_command
      cmd_obj.run()
    File "C:\Users\Alex_PC\AppData\Local\Programs\Python\Python38\lib\distutils\command\build.
py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Users\Alex_PC\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line
313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Alex_PC\AppData\Local\Programs\Python\Python38\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
  Building wheel for cffi (PEP 517) ... done
  Stored in directory: C:\Users\Alex_PC\AppData\Local\pip\Cache\wheels\cf\14\00\656047b7f0b1ad
d314a90c6832a5d9ae86479c8974ff2c3262
Successfully built cffi
Failed to build pynacl
Could not build wheels for pynacl which use PEP 517 and cannot be installed directly

Environment: Windows 10 x64 MSVC 14.28.29910 pip 21.0.1 python 3.8.1 make 3.75

alexbprofit commented 3 years ago

Make installed into PATH: image image

jjanczyszyn commented 3 years ago

I had a similar problem on Python 3.9.4 and forcing a higher version of cffi (cffi>=1.14.0) solved the issue for me.

mayrdhs commented 3 years ago

I have the same problem. I tried it with different python versions on Windows but it always says "the 'make' utility is missing from PATH". I installed make with chocolatey and I can use it everywhere in the command prompt, it is registered as a system variable... Forcing a higher version of cffi didn't solve the issue.

reaperhulk commented 3 years ago

I can't speak to why PATH isn't propagating to Python, but we build 32-bit and 64-bit Windows wheels that will work for pretty much any Windows user. If you're seeing this problem try the following:

1) Create a new virtual environment 2) Upgrade pip to the latest version

Then install in that virtual environment and it should work. For Python 3.9+ you need a very recent pip because we started shipping abi3 wheels that work in multiple versions of Python, but only the latest pip understands that tag.