ph4r05 / py-cryptonight

Python Cryptonight binding / extension. Monero hash function, proof-of-work, cn_slow_hash()
MIT License
22 stars 16 forks source link

Error installing on Windows 10 #8

Closed malwaredllc closed 2 years ago

malwaredllc commented 4 years ago

Thanks for this great project! It is working for me on macOS, however, I am struggling to get it working on Windows. Here is what I have tried so far:

1) First error was fatal error: cannot include 'stdint.h' - no such file or directory. I did a bit of research and think I fixed this by downloading stdint.h from here https://github.com/chemeris/msinttypes/blob/master/stdint.h and putting it in C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\.

2) Next error was fatal error: cannot include 'stdbool.h' - no such file or directory. I applied the same kind of fix for this (i.e. downloading stdbool.h and putting it in the C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\ directory.

3) Now that I'm not getting the errors above, I am getting a long stream of syntax errors that eventually exceeds 100 and crashes - see output below:

Installing collected packages: py-cryptonight Running setup.py install for py-cryptonight ... error ERROR: Command errored out with exit status 1: command: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\setup.py'"'"'; file='"'"'c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\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\malwaredllc\appdata\local\temp\pip-record-bobd5h\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python27\Include\py-cryptonight' cwd: c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\ Complete output (141 lines): running install running build running build_py creating build creating build\lib.win-amd64-2.7 creating build\lib.win-amd64-2.7\pycryptonight copying pycryptonight__init__.py -> build\lib.win-amd64-2.7\pycryptonight creating build\lib.win-amd64-2.7\pycryptonight\tests copying pycryptonight\tests\test.py -> build\lib.win-amd64-2.7\pycryptonight\tests copying pycryptonight\tests__init__.py -> build\lib.win-amd64-2.7\pycryptonight\tests running egg_info writing requirements to py_cryptonight.egg-info\requires.txt writing py_cryptonight.egg-info\PKG-INFO writing top-level names to py_cryptonight.egg-info\top_level.txt writing dependency_links to py_cryptonight.egg-info\dependency_links.txt reading manifest file 'py_cryptonight.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'py_cryptonight.egg-info\SOURCES.txt' creating build\lib.win-amd64-2.7\pycryptonight\tests\data copying pycryptonight\tests\data\tests-fast.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data copying pycryptonight\tests\data\tests-slow-1.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data copying pycryptonight\tests\data\tests-slow-2.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data copying pycryptonight\tests\data\tests-slow-4.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data copying pycryptonight\tests\data\tests-slow.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data running build_ext building '_pycryptonight' extension creating build\temp.win-amd64-2.7 creating build\temp.win-amd64-2.7\Release creating build\temp.win-amd64-2.7\Release\src creating build\temp.win-amd64-2.7\Release\src\cryptonight C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNO_AES=1 -DNO_JIT=1 -I. -Isrc/ -Isrc/misc -Isrc/cryptonight -Ic:\python27\include -Ic:\python27\PC /Tcsrc/cryptonight/aesb.c /Fobuild\temp.win-amd64-2.7\Release\src/cryptonight/aesb.obj aesb.c C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNO_AES=1 -DNO_JIT=1 -I. -Isrc/ -Isrc/misc -Isrc/cryptonight -Ic:\python27\include -Ic:\python27\PC /Tcsrc/cryptonight/blake256.c /Fobuild\temp.win-amd64-2.7\Release\src/cryptonight/blake256.obj blake256.c src/cryptonight/blake256.c(180) : warning C4244: '=' : conversion from 'uint64_t' to 'int', possible loss of data C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNO_AES=1 -DNO_JIT=1 -I. -Isrc/ -Isrc/misc -Isrc/cryptonight -Ic:\python27\include -Ic:\python27\PC /Tcsrc/cryptonight/CryptonightR_JIT.c /Fobuild\temp.win-amd64-2.7\Release\src/cryptonight/CryptonightR_JIT.obj CryptonightR_JIT.c c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(53) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(53) : error C2085: 'rol32' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(53) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(58) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(58) : error C2085: 'rol64' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(58) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(74) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(74) : error C2085: 'hi_dword' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(74) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(78) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(78) : error C2085: 'lo_dword' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(78) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(82) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(82) : error C2085: 'mul128' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(82) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(108) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(108) : error C2085: 'div_with_reminder' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(108) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(115) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(115) : error C2085: 'div128_32' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(115) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(148) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(148) : error C2085: 'ident32' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(148) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(149) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(149) : error C2085: 'ident64' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(149) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(155) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(155) : error C2085: 'swap32' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(155) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(163) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(163) : error C2085: 'swap64' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(163) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(176) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(176) : error C2085: 'mem_inplace_ident' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(176) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(179) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(179) : error C2085: 'mem_inplace_swap32' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(179) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(185) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(185) : error C2085: 'mem_inplace_swap64' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(185) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(192) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(192) : error C2085: 'memcpy_ident32' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(192) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(195) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(195) : error C2085: 'memcpy_ident64' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(195) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(199) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(199) : error C2085: 'memcpy_swap32' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(199) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(205) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(205) : error C2085: 'memcpy_swap64' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(205) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(43) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(43) : error C2085: 'padd' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(43) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(47) : error C2143: syntax error : missing '{' before 'const' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(53) : error C2143: syntax error : missing ')' before 'sizeof' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(53) : error C2143: syntax error : missing '{' before 'sizeof' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(53) : error C2059: syntax error : 'sizeof' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(54) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(54) : error C2085: 'place_length' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(54) : error C2143: syntax error : missing ';' before '{' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(69) : error C2143: syntax error : missing ')' before 'sizeof' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(69) : error C2143: syntax error : missing '{' before 'sizeof' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(69) : error C2059: syntax error : 'sizeof' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\variant4_random_math.h(182) : error C2054: expected '(' to follow 'inline' c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\variant4_random_math.h(183) : error C2085: 'v4_random_math_init' : not in formal parameter list c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\variant4_random_math.h(183) : error C2143: syntax error : missing ';' before '{' src/cryptonight/CryptonightR_JIT.c(174) : error C2143: syntax error : missing ';' before 'type' src/cryptonight/CryptonightR_JIT.c(176) : error C2143: syntax error : missing ';' before 'type' src/cryptonight/CryptonightR_JIT.c(176) : error C2143: syntax error : missing ';' before 'type' src/cryptonight/CryptonightR_JIT.c(176) : error C2143: syntax error : missing ')' before 'type' src/cryptonight/CryptonightR_JIT.c(176) : error C2143: syntax error : missing ';' before 'type' src/cryptonight/CryptonightR_JIT.c(176) : error C2059: syntax error : ')' src/cryptonight/CryptonightR_JIT.c(177) : error C2065: 'i' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(177) : error C2143: syntax error : missing ';' before '{' src/cryptonight/CryptonightR_JIT.c(178) : error C2065: 'i' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(180) : error C2043: illegal break src/cryptonight/CryptonightR_JIT.c(182) : error C2143: syntax error : missing ';' before 'type' src/cryptonight/CryptonightR_JIT.c(184) : error C2143: syntax error : missing ';' before 'const' src/cryptonight/CryptonightR_JIT.c(185) : error C2143: syntax error : missing ';' before 'const' src/cryptonight/CryptonightR_JIT.c(186) : error C2143: syntax error : missing ';' before 'const' src/cryptonight/CryptonightR_JIT.c(192) : error C2065: 'b' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(192) : error C2065: 'prev_rot_src' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(194) : error C2065: 'prev_rot_src' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(194) : error C2065: 'b' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(202) : error C2143: syntax error : missing ';' before 'const' src/cryptonight/CryptonightR_JIT.c(203) : error C2143: syntax error : missing ';' before 'const' src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p2' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p2' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(206) : warning C4022: 'memcpy' : pointer mismatch for actual parameter 2 src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p2' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p2' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(211) : error C2065: 'a' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(211) : error C2065: 'prev_rot_src' : undeclared identifier src/cryptonight/CryptonightR_JIT.c(211) : fatal error C1003: error count exceeds 100; stopping compilation error: command 'C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2

ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\setup.py'"'"'; file='"'"'c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\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\malwaredllc\appdata\local\temp\pip-record-bobd5h\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python27\Include\py-cryptonight' Check the logs for full command output.

Zubby99 commented 4 years ago

i am experiencing this exact same issue with @malwaredllc when trying to install py-cryptonight on both windows 10 and windows 7 with python -V 2.7.18. please help

ph4r05 commented 4 years ago

@Zubby99 I have no access to Win10 so there has to be somebody with that access and do the pull request.

Did you also try Python 3.7?

BrunnoBombino commented 2 years ago

Install the library with GIT. I succeeded on Python 3.7 Windows 10

ph4r05 commented 2 years ago

pls try again with 0.3.5. Closing, reopen if problem still persists, thanks!