unable to install pyethash
Running setup.py install for pyethash ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\mohsin\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Mohsin\AppData\Local\Temp\pip-install-yfm6_fjc\pyethash_25ac1e12a7a742309e1303ec7f4164a4\setup.py'"'"'; file='"'"'C:\Users\Mohsin\AppData\Local\Temp\pip-install-yfm6_fjc\pyethash_25ac1e12a7a742309e1303ec7f4164a4\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Mohsin\AppData\Local\Temp\pip-record-cgsqj6of\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\mohsin\appdata\local\programs\python\python39\Include\pyethash'
cwd: C:\Users\Mohsin\AppData\Local\Temp\pip-install-yfm6_fjc\pyethash_25ac1e12a7a742309e1303ec7f4164a4
Complete output (27 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\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\mohsin\appdata\local\programs\python\python39\include -Ic:\users\mohsin\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.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.17763.0\ucrt\corecrt.h(212): warning C4668: '__cplusplus' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.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.17763.0\ucrt\stdio.h(1833): note: see declaration of 'sprintf_s'
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\mohsin\appdata\local\programs\python\python39\include -Ic:\users\mohsin\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.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.17763.0\ucrt\corecrt.h(212): warning C4668: '__cplusplus' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.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.17763.0\ucrt\stdio.h(1833): note: see declaration of 'sprintf_s'
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\mohsin\appdata\local\programs\python\python39\include -Ic:\users\mohsin\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.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\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\mohsin\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Mohsin\AppData\Local\Temp\pip-install-yfm6_fjc\pyethash_25ac1e12a7a742309e1303ec7f4164a4\setup.py'"'"'; file='"'"'C:\Users\Mohsin\AppData\Local\Temp\pip-install-yfm6_fjc\pyethash_25ac1e12a7a742309e1303ec7f4164a4\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Mohsin\AppData\Local\Temp\pip-record-cgsqj6of\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\mohsin\appdata\local\programs\python\python39\Include\pyethash' Check the logs for full command output.
Yeah, I also got that error message..plz someone help to fix this problem.
Me too. Anyone have any luck yet?
I'm having the same problem and hoping someone can help. I'm not that great at exceptions, but believe that the issue has something to do with that when the package installer gets to the "io_win32.c" file it fails because it looks for the file in the root directory "Program Files (x86)" and not x64.
Hopefully somebody can help clean that explanation up.
I think it is x86 / x64 compability error.
I've used python 3.9.0 and these steps worked for me (with py-evm project on python https://github.com/ethereum/py-evm):
-
Download pyethash 0.1.27: https://pypi.org/project/pyethash/0.1.27/#files and unpack archive in lib folder in your project. I've unpacked at
/virtualenv/Lib/site-packages/pyethash-0.1.27folder -
Download ethash from git: https://github.com/ethereum/ethash
-
Copy all files form ethash folder to
/virtualenv/Lib/site-packages/pyethash-0.1.27 -
Change
/pyethash-0.1.27/src/libethash/mmap.hadd this code to the end of file:
#pragma comment(lib, "Shell32.lib")
- Change
pyethash-0.1.27\src\python\core.cfile - replace#include <alloca.h>by the code:
#if defined(_WIN32) || defined(WIN32)
#include <malloc.h>
#else
#include <alloca.h>
#endif
-
Zip
/virtualenv/Lib/site-packages/pyethash-0.1.27folder and remove that folder (zip archive will stay). -
Run pip install for new created zip
/virtualenv/Lib/site-packages/pyethash-0.1.27.zip -
It can conflict with versions: ethash have 0.1.23 version instead of 0.1.27, i just changed my requerements to 0.1.23 and it worked for me. You can try to copy not all files (from ethhash to pyethhash), just files one by one that breaks the compilation.
I think it is x86 / x64 compability error.
I've used python 3.9.0 and these steps worked for me (with py-evm project on python https://github.com/ethereum/py-evm):
- Download pyethash 0.1.27: https://pypi.org/project/pyethash/0.1.27/#files and unpack archive in lib folder in your project. I've unpacked at
/virtualenv/Lib/site-packages/pyethash-0.1.27folder- Download ethash from git: https://github.com/ethereum/ethash
- Copy all files form ethash folder to
/virtualenv/Lib/site-packages/pyethash-0.1.27- Change
/pyethash-0.1.27/src/libethash/mmap.hadd this code to the end of file:#pragma comment(lib, "Shell32.lib")
- Change
pyethash-0.1.27\src\python\core.cfile - replace#include <alloca.h>by the code:#if defined(_WIN32) || defined(WIN32) #include <malloc.h> #else #include <alloca.h> #endif
- Zip
/virtualenv/Lib/site-packages/pyethash-0.1.27folder and remove that folder (zip archive will stay).- Run pip install for new created zip
/virtualenv/Lib/site-packages/pyethash-0.1.27.zip- It can conflict with versions: ethash have 0.1.23 version instead of 0.1.27, i just changed my requerements to 0.1.23 and it worked for me. You can try to copy not all files (from ethhash to pyethhash), just files one by one that breaks the compilation.
for step 8, you could simply modify version to 0.1.27 in the setup.py file within the pyethash-0.1.27 folder
....
setup(
name='pyethash',
author="Matthew Wampler-Doty",
author_email="[email protected]",
license='GPL',
version='0.1.27',
url='https://github.com/ethereum/ethash',
download_url='https://github.com/ethereum/ethash/tarball/v23',
description=('Python wrappers for ethash, the ethereum proof of work'
'hashing function'),
ext_modules=[pyethash],
)
I think it is x86 / x64 compability error. I've used python 3.9.0 and these steps worked for me (with py-evm project on python https://github.com/ethereum/py-evm):
- Download pyethash 0.1.27: https://pypi.org/project/pyethash/0.1.27/#files and unpack archive in lib folder in your project. I've unpacked at
/virtualenv/Lib/site-packages/pyethash-0.1.27folder- Download ethash from git: https://github.com/ethereum/ethash
- Copy all files form ethash folder to
/virtualenv/Lib/site-packages/pyethash-0.1.27- Change
/pyethash-0.1.27/src/libethash/mmap.hadd this code to the end of file:#pragma comment(lib, "Shell32.lib")
- Change
pyethash-0.1.27\src\python\core.cfile - replace#include <alloca.h>by the code:#if defined(_WIN32) || defined(WIN32) #include <malloc.h> #else #include <alloca.h> #endif
- Zip
/virtualenv/Lib/site-packages/pyethash-0.1.27folder and remove that folder (zip archive will stay).- Run pip install for new created zip
/virtualenv/Lib/site-packages/pyethash-0.1.27.zip- It can conflict with versions: ethash have 0.1.23 version instead of 0.1.27, i just changed my requerements to 0.1.23 and it worked for me. You can try to copy not all files (from ethhash to pyethhash), just files one by one that breaks the compilation.
for step 8, you could simply modify
versionto0.1.27in thesetup.pyfile within thepyethash-0.1.27folder.... setup( name='pyethash', author="Matthew Wampler-Doty", author_email="[email protected]", license='GPL', version='0.1.27', url='https://github.com/ethereum/ethash', download_url='https://github.com/ethereum/ethash/tarball/v23', description=('Python wrappers for ethash, the ethereum proof of work' 'hashing function'), ext_modules=[pyethash], )
Worked fine. Simpler entering the folder and executing python setup.py install ...
Works for me, too. (python 3.9.7, win11) Thanks for solutions!
For people coming here after years and suffering. I used Python 3.11 and made the .egg 522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 *pyethash-0.1.27-py3.11-win-amd64.egg
https://www.virustotal.com/gui/file/522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6
pyethash-0.1.27-py3.11-win-amd64.egg.zip
(can't upload .egg directly, check the sha256 hash of the .egg file not the zip for confirmation)
Still don't know why anybody didn't upload it somewhere up until now
Thanks a lot, worked for me (python 3.10, win11)
For people coming here after years and suffering. I used Python 3.11 and made the .egg
522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 *pyethash-0.1.27-py3.11-win-amd64.egghttps://www.virustotal.com/gui/file/522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 pyethash-0.1.27-py3.11-win-amd64.egg.zip (can't upload .egg directly, check the sha256 hash of the .egg file not the zip for confirmation) Still don't know why anybody didn't upload it somewhere up until now
I am having the same problem I have Python 3.10. and Windows 11, how do I install the file with the egg extension?
For people coming here after years and suffering. I used Python 3.11 and made the .egg
522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 *pyethash-0.1.27-py3.11-win-amd64.egghttps://www.virustotal.com/gui/file/522abb85a345d4751b43418fd4bc36ee15e6d6c0311ddd8f7f0b7d64cb8681f6 pyethash-0.1.27-py3.11-win-amd64.egg.zip (can't upload .egg directly, check the sha256 hash of the .egg file not the zip for confirmation) Still don't know why anybody didn't upload it somewhere up until nowI am having the same problem I have Python 3.10. and Windows 11, how do I install the file with the egg extension?
Not sure if this will work with windows 11 - but this is py 3.10 built on windows 10 - it's the zip file as per @thedogrex's instructions, so you can start at step 7
https://www.virustotal.com/gui/file/b774c679e808251785b870b38c19bbee3edebca94396efb6083edfb66e4d7dd8?nocache=1
An even simpler option is to use a prepared fork with all of the above changes:
pip install https://codeload.github.com/Nov1kov/ethash/zip/refs/heads/master
Uma opção ainda mais simples é usar um garfo preparado com todas as alterações acima:
pip install https://codeload.github.com/Nov1kov/ethash/zip/refs/heads/master
Thanks, perfect