Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Error on building wheel for pyethash #900

Open
ilovemycat666 opened this issue Feb 15, 2021 · 3 comments
Open

Error on building wheel for pyethash #900

ilovemycat666 opened this issue Feb 15, 2021 · 3 comments

Comments

@ilovemycat666
Copy link

I have seen other issues here like the one linked below and they haven't solved my problem yet...
ethereum/web3.py#1803

I think my issue is with Visual Studio, but it may be with this line here,
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'

This is where the errors start when I run 'pip install web3[tester]:

Building wheels for collected packages: pyethash
Building wheel for pyethash (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\ed\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Ed\AppData\Local\Temp\pip-install-oyil1qtj\pyethash_c2276ae40d3947a1a1d3d4c1cb0f11b7\setup.py'"'"'; file='"'"'C:\Users\Ed\AppData\Local\Temp\pip-install-oyil1qtj\pyethash_c2276ae40d3947a1a1d3d4c1cb0f11b7\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Ed\AppData\Local\Temp\pip-wheel-5cc7ez91'
cwd: C:\Users\Ed\AppData\Local\Temp\pip-install-oyil1qtj\pyethash_c2276ae40d3947a1a1d3d4c1cb0f11b7
Complete output (25 lines):
running bdist_wheel
running build
running build_ext
building 'pyethash' extension
creating build
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
creating build\temp.win-amd64-3.9\Release\src\libethash
creating build\temp.win-amd64-3.9\Release\src\python
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\ed\appdata\local\programs\python\python39\include -Ic:\users\ed\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/internal.c /Fobuild\temp.win-amd64-3.9\Release\src/libethash/internal.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
internal.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): warning C4710: 'int sprintf_s(char *const ,const size_t,const char *const ,...)': function not inlined
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): note: see declaration of 'sprintf_s'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\ed\appdata\local\programs\python\python39\include -Ic:\users\ed\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/io.c /Fobuild\temp.win-amd64-3.9\Release\src/libethash/io.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
io.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): warning C4710: 'int sprintf_s(char *const ,const size_t,const char *const ,...)': function not inlined
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): note: see declaration of 'sprintf_s'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\ed\appdata\local\programs\python\python39\include -Ic:\users\ed\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/io_win32.c /Fobuild\temp.win-amd64-3.9\Release\src/libethash/io_win32.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
io_win32.c
c1: fatal error C1083: Cannot open source file: 'src/libethash/io_win32.c': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe' failed with exit code 2

ERROR: Failed building wheel for pyethash
Running setup.py clean for pyethash
Failed to build pyethash
Installing collected packages: pyethash, py-ecc, eth-bloom, blake2b-py, py-evm, py-geth
Running setup.py install for pyethash ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\ed\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Ed\AppData\Local\Temp\pip-install-oyil1qtj\pyethash_c2276ae40d3947a1a1d3d4c1cb0f11b7\setup.py'"'"'; file='"'"'C:\Users\Ed\AppData\Local\Temp\pip-install-oyil1qtj\pyethash_c2276ae40d3947a1a1d3d4c1cb0f11b7\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\Ed\AppData\Local\Temp\pip-record-ruz_fc8o\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\ed\appdata\local\programs\python\python39\Include\pyethash'
cwd: C:\Users\Ed\AppData\Local\Temp\pip-install-oyil1qtj\pyethash_c2276ae40d3947a1a1d3d4c1cb0f11b7
Complete output (25 lines):
running install
running build
running build_ext
building 'pyethash' extension
creating build
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
creating build\temp.win-amd64-3.9\Release\src\libethash
creating build\temp.win-amd64-3.9\Release\src\python
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\ed\appdata\local\programs\python\python39\include -Ic:\users\ed\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/internal.c /Fobuild\temp.win-amd64-3.9\Release\src/libethash/internal.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
internal.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): warning C4710: 'int sprintf_s(char *const ,const size_t,const char *const ,...)': function not inlined
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): note: see declaration of 'sprintf_s'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\ed\appdata\local\programs\python\python39\include -Ic:\users\ed\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/io.c /Fobuild\temp.win-amd64-3.9\Release\src/libethash/io.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
io.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): warning C4710: 'int sprintf_s(char *const ,const size_t,const char *const ,...)': function not inlined
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): note: see declaration of 'sprintf_s'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\ed\appdata\local\programs\python\python39\include -Ic:\users\ed\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/io_win32.c /Fobuild\temp.win-amd64-3.9\Release\src/libethash/io_win32.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
io_win32.c
c1: fatal error C1083: Cannot open source file: 'src/libethash/io_win32.c': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\ed\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Ed\AppData\Local\Temp\pip-install-oyil1qtj\pyethash_c2276ae40d3947a1a1d3d4c1cb0f11b7\setup.py'"'"'; file='"'"'C:\Users\Ed\AppData\Local\Temp\pip-install-oyil1qtj\pyethash_c2276ae40d3947a1a1d3d4c1cb0f11b7\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\Ed\AppData\Local\Temp\pip-record-ruz_fc8o\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\ed\appdata\local\programs\python\python39\Include\pyethash' Check the logs for full command output.

Thanks, any help would be appreciated!!

@SoftDeveloper-NL
Copy link

Hello.
How do you do!
I have got the same problem as above.
Can you tell me the solution if you solved the above error?

@Davdru
Copy link

Davdru commented Mar 13, 2022

Hi,

I fixed this issue by first following the steps posted here (ethereum/ethash#104 (comment)) Much credit to them!
They were as following + edit;

  1. Clone the project from github

  2. The version you get when cloning the project from the git is 1.23 and the latest version is 1.27.
    I fixed this by adding all the files from the latest update manually.
    http://archive.linux.duke.edu/pypi/simple/pyethash/
    This solved the problem you both are experiencing for me.

  3. Open \src\libethash\mmap_win32.c for editing

  4. Add the following after the last #include statement
    #pragma comment(lib, "Shell32.lib")

  5. Open \src\python\core.c

  6. Replace:
    #include <alloca.h>
    with:
    #if defined(_WIN32) || defined(WIN32)
    #include <malloc.h>
    #else
    #include <alloca.h>
    #endif

  7. Run the following in the source code main folder
    setup.py install
    or python setup.py install

Hope this helps.

@johntovor
Copy link

This really works.
Thanks a lot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants