bjornedstrom / python-sha3

Python implementation of FIPS SHA3 and SHAKE
Other
44 stars 20 forks source link

sha3 build error [Windows10] #10

Open yupnano opened 6 years ago

yupnano commented 6 years ago

Hi, I have encountered an build error when running pip install sha3 on Windows10, the error is sha3.c(33): error C2016: C requires that a struct or union has at least one member in sha3.c(33)

Does anyone know how resolve this problem?

And here is the error message:

>pip install sha3
Collecting sha3
  Using cached https://files.pythonhosted.org/packages/b3/b4/d23c8e8843226dcf54c6c533a6717d34d50358f74496cfa77e6e8c7e146a/sha3-0.2.1.tar.gz
Installing collected packages: sha3
  Running setup.py install for sha3 ... error
    Complete output from command c:\users\yupna\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='d:\\Temp\\pip-build-r_s0v2k3\\sha3\\setup.py';f=getattr(tokenize, '
open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record d:\Temp\pip-3_ffm8vz-record\install-record.txt --single-version-externally-managed --
compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\sha3
    copying sha3\__init__.py -> build\lib.win-amd64-3.6\sha3
    running build_ext
    building '_sha3' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\src
    creating build\temp.win-amd64-3.6\Release\src\64
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc/ -Isrc/64 -Ic:\users\yupna\appdata\local\programs\python\python36\include -Ic:\users\yup
na\appdata\local\programs\python\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86
)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcsha3.c /Fobuild\temp.win-amd64-3.6\Release\sha3.obj
    sha3.c
    d:\temp\pip-build-r_s0v2k3\sha3\src\KeccakSponge.h: warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
    d:\temp\pip-build-r_s0v2k3\sha3\src\SnP-Relaned.h: warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
    sha3.c(33): error C2016: C requires that a struct or union has at least one member
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\users\yupna\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='d:\\Temp\\pip-build-r_s0v2k3\\sha3\\setup.py';f=getattr(tokenize, 'open', open)(__file__);c
ode=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record d:\Temp\pip-3_ffm8vz-record\install-record.txt --single-version-externally-managed --compile" failed with err
or code 1 in d:\Temp\pip-build-r_s0v2k3\sha3\
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
0golovatyi commented 5 years ago

I have the same error trying to install the package with pip 19.0.1 on Win 10 x64, Python 3.6.8.

garretlaxton commented 5 years ago

Try running pip install pysha3

pysha3 docs: https://pypi.org/project/pysha3/

Syasya20 commented 3 months ago

Помилка так і залишається (.venv) PS C:\Python\pythonProject> pip install sha3 Collecting sha3 Using cached sha3-0.2.1.tar.gz (616 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: sha3 Building wheel for sha3 (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [4 lines of output] sha3.c sha3.c(33): error C2016: C requires that a struct or union have at least one member sha3.c(326): error C2106: '=': left operand must be l-value error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for sha3 Running setup.py clean for sha3 Failed to build sha3 ERROR: Could not build wheels for sha3, which is required to install pyproject.toml-based projects

win11x64