win10 python2.7.17 cant install yara-python?

Open
#151 6 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, python
Domain
build-system

Research direction

Start by reproducing the Python 2.7 Windows installation failure and inspect setup.py, yara-python.c, and yara/libyara/ahocorasick.c. Compare the reported stdbool.h and compiler syntax errors with the supported build environment. Done means yara-python installs successfully on the reported Windows and Python 2.7 setup, with the relevant build checks passing.

Written by the indexing model from the issue text.

Description

Using legacy setup.py install for yara-python, since package 'wheel' is not installed.
Installing collected packages: yara-python
Running setup.py install for yara-python ... error
ERROR: Command errored out with exit status 1:
command: 'd:\programing\pythonstudy\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'
"'c:\users\26111\appdata\local\temp\pip-install-oae45q\yara-python\setup.py'"'"'; file='"'"'c:\users\26111
\appdata\local\temp\pip-install-oae45q\yara-python\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\26111\appdata\local\temp\pip-record-ls0pbn\install-record.txt' --single-version-externally-managed --
compile --install-headers 'd:\programing\pythonstudy\python27\Include\yara-python'
cwd: c:\users\26111\appdata\local\temp\pip-install-oae45q\yara-python
Complete output (21 lines):
running install
running build
running build_ext
building 'yara' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\yara
creating build\temp.win-amd64-2.7\Release\yara\libyara
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\demo
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\elf
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\math
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\pe
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\tests
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\time
creating build\temp.win-amd64-2.7\Release\yara\libyara\proc
C:\Users\26111\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -DUSE_WINDOWS_PROC=1 -D_CRT_SECURE_NO_WARNINGS=1 -Iyara/libyara/include -Iyara/libyara/ -I. -Id:\p
rograming\pythonstudy\python27\include -Id:\programing\pythonstudy\python27\PC /Tcyara-python.c /Fobuild\temp.win-amd64-
2.7\Release\yara-python.obj
yara-python.c
yara/libyara/include\yara/types.h(33) : fatal error C1083: Cannot open include file: 'stdbool.h': No such file or di
rectory
error: command 'C:\Users\26111\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: 'd:\programing\pythonstudy\python27\python.exe' -u -c 'import sys, setupt
ools, tokenize; sys.argv[0] = '"'"'c:\users\26111\appdata\local\temp\pip-install-oae45q\yara-python\setup.py'"'"
'; file='"'"'c:\users\26111\appdata\local\temp\pip-install-oae45q\yara-python\setup.py'"'"';f=getattr(tokeni
ze, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, f
ile
, '"'"'exec'"'"'))' install --record 'c:\users\26111\appdata\local\temp\pip-record-ls0pbn\install-record.txt' --sin
gle-version-externally-managed --compile --install-headers 'd:\programing\pythonstudy\python27\Include\yara-python' Chec
k the logs for full command output.


I tried to move the stdbool.h file to the wheel file of yara, it didn't work either and there were other problems

Using legacy setup.py install for yara-python, since package 'wheel' is not installed.
Installing collected packages: yara-python
Running setup.py install for yara-python ... error
ERROR: Command errored out with exit status 1:
command: 'd:\programing\pythonstudy\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'
"'c:\users\26111\appdata\local\temp\pip-req-build-uh94lm\setup.py'"'"'; file='"'"'c:\users\26111\appdata\
local\temp\pip-req-build-uh94lm\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().repla
ce('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'c:\users\261
11\appdata\local\temp\pip-record-tvb8xq\install-record.txt' --single-version-externally-managed --compile --install-head
ers 'd:\programing\pythonstudy\python27\Include\yara-python'
cwd: c:\users\26111\appdata\local\temp\pip-req-build-uh94lm
Complete output (126 lines):
running install
running build
running build_ext
building 'yara' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\yara
creating build\temp.win-amd64-2.7\Release\yara\libyara
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\demo
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\elf
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\math
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\pe
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\tests
creating build\temp.win-amd64-2.7\Release\yara\libyara\modules\time
creating build\temp.win-amd64-2.7\Release\yara\libyara\proc
C:\Users\26111\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -DUSE_WINDOWS_PROC=1 -D_CRT_SECURE_NO_WARNINGS=1 -Iyara/libyara/include -Iyara/libyara/ -I. -Id:\p
rograming\pythonstudy\python27\include -Id:\programing\pythonstudy\python27\PC /Tcyara-python.c /Fobuild\temp.win-amd64-
2.7\Release\yara-python.obj
yara-python.c
C:\Users\26111\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -DUSE_WINDOWS_PROC=1 -D_CRT_SECURE_NO_WARNINGS=1 -Iyara/libyara/include -Iyara/libyara/ -I. -Id:\p
rograming\pythonstudy\python27\include -Id:\programing\pythonstudy\python27\PC /Tcyara\libyara\ahocorasick.c /Fobuild\te
mp.win-amd64-2.7\Release\yara\libyara\ahocorasick.obj
ahocorasick.c
yara\libyara\ahocorasick.c(219) : error C2059: syntax error : '{'
yara\libyara\ahocorasick.c(340) : error C2059: syntax error : '{'
yara\libyara\ahocorasick.c(360) : error C2181: illegal else without matching if
yara\libyara\ahocorasick.c(376) : error C2059: syntax error : 'return'
yara\libyara\ahocorasick.c(377) : error C2059: syntax error : '}'
yara\libyara\ahocorasick.c(449) : warning C4013: '_yr_ac_transitions_subset' undefined; assuming extern returning in
t
yara\libyara\ahocorasick.c(535) : error C2275: 'size_t' : illegal use of this type as an expression
yara\libyara\ahocorasick.c : see declaration of 'size_t'
yara\libyara\ahocorasick.c(535) : error C2146: syntax error : missing ';' before identifier 'bm_len'
yara\libyara\ahocorasick.c(535) : error C2065: 'bm_len' : undeclared identifier
yara\libyara\ahocorasick.c(538) : error C2275: 'size_t' : illegal use of this type as an expression
yara\libyara\ahocorasick.c : see declaration of 'size_t'
yara\libyara\ahocorasick.c(538) : error C2146: syntax error : missing ';' before identifier 'bm_len_incr'
yara\libyara\ahocorasick.c(538) : error C2065: 'bm_len_incr' : undeclared identifier
yara\libyara\ahocorasick.c(540) : error C2065: 'bm_len' : undeclared identifier
yara\libyara\ahocorasick.c(540) : error C2065: 'bm_len_incr' : undeclared identifier
yara\libyara\ahocorasick.c(545) : error C2065: 'bm_len' : undeclared identifier
yara\libyara\ahocorasick.c(545) : error C2065: 'bm_len_incr' : undeclared identifier
yara\libyara\ahocorasick.c(664) : error C2059: syntax error : '{'
yara\libyara\ahocorasick.c(713) : error C2059: syntax error : '{'
yara\libyara\ahocorasick.c(715) : error C2181: illegal else without matching if
yara\libyara\ahocorasick.c(761) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(761) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(761) : error C2143: syntax error : missing ')' before 'type'
yara\libyara\ahocorasick.c(761) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(761) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(761) : warning C4552: '<' : operator has no effect; expected operator with side-effect
yara\libyara\ahocorasick.c(761) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(761) : error C2059: syntax error : ')'
yara\libyara\ahocorasick.c(762) : error C2146: syntax error : missing ';' before identifier 'printf'
yara\libyara\ahocorasick.c(782) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(782) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(782) : error C2143: syntax error : missing ')' before 'type'
yara\libyara\ahocorasick.c(782) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(782) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(782) : warning C4552: '<' : operator has no effect; expected operator with side-effect
yara\libyara\ahocorasick.c(782) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(782) : error C2059: syntax error : ')'
yara\libyara\ahocorasick.c(783) : error C2146: syntax error : missing ';' before identifier 'printf'
yara\libyara\ahocorasick.c(791) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(791) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(791) : error C2143: syntax error : missing ')' before 'type'
yara\libyara\ahocorasick.c(791) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(791) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(791) : warning C4552: '<' : operator has no effect; expected operator with side-effect
yara\libyara\ahocorasick.c(791) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(791) : error C2059: syntax error : ')'
yara\libyara\ahocorasick.c(792) : error C2146: syntax error : missing ';' before identifier 'printf'
yara\libyara\ahocorasick.c(792) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(800) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(800) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(800) : error C2143: syntax error : missing ')' before 'type'
yara\libyara\ahocorasick.c(800) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(800) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(800) : warning C4552: '<' : operator has no effect; expected operator with side-effect
yara\libyara\ahocorasick.c(800) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(800) : error C2059: syntax error : ')'
yara\libyara\ahocorasick.c(801) : error C2146: syntax error : missing ';' before identifier 'printf'
yara\libyara\ahocorasick.c(801) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(808) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(808) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(808) : error C2143: syntax error : missing ')' before 'type'
yara\libyara\ahocorasick.c(808) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(808) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(808) : warning C4552: '<' : operator has no effect; expected operator with side-effect
yara\libyara\ahocorasick.c(808) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(808) : error C2059: syntax error : ')'
yara\libyara\ahocorasick.c(809) : error C2146: syntax error : missing ';' before identifier 'printf'
yara\libyara\ahocorasick.c(809) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(856) : error C2059: syntax error : '{'
yara\libyara\ahocorasick.c(913) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(913) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(913) : error C2143: syntax error : missing ')' before 'type'
yara\libyara\ahocorasick.c(913) : error C2143: syntax error : missing ';' before 'type'
yara\libyara\ahocorasick.c(913) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(913) : warning C4552: '<' : operator has no effect; expected operator with side-effect
yara\libyara\ahocorasick.c(913) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(913) : error C2059: syntax error : ')'
yara\libyara\ahocorasick.c(914) : error C2143: syntax error : missing ';' before '{'
yara\libyara\ahocorasick.c(915) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(919) : error C2065: 'i' : undeclared identifier
yara\libyara\ahocorasick.c(928) : error C2275: 'YR_ARENA_REF' : illegal use of this type as an expression
yara/libyara/include\yara/arena.h(52) : see declaration of 'YR_ARENA_REF'
yara\libyara\ahocorasick.c(928) : error C2146: syntax error : missing ';' before identifier 'new_match_ref'
yara\libyara\ahocorasick.c(928) : error C2065: 'new_match_ref' : undeclared identifier
yara\libyara\ahocorasick.c(939) : error C2065: 'new_match_ref' : undeclared identifier
yara\libyara\ahocorasick.c(939) : warning C4133: 'function' : incompatible types - from 'int *' to 'YR_ARENA_REF *'
yara\libyara\ahocorasick.c(941) : error C2275: 'YR_AC_MATCH' : illegal use of this type as an expression
yara/libyara/include\yara/types.h(202) : see declaration of 'YR_AC_MATCH'
yara\libyara\ahocorasick.c(941) : error C2065: 'new_match' : undeclared identifier
yara\libyara\ahocorasick.c(941) : error C2065: 'new_match_ref' : undeclared identifier
yara\libyara\ahocorasick.c(941) : warning C4133: 'function' : incompatible types - from 'int *' to 'YR_ARENA_REF *'
yara\libyara\ahocorasick.c(943) : error C2065: 'new_match' : undeclared identifier
yara\libyara\ahocorasick.c(943) : error C2223: left of '->backtrack' must point to struct/union
yara\libyara\ahocorasick.c(944) : error C2065: 'new_match' : undeclared identifier
yara\libyara\ahocorasick.c(944) : error C2223: left of '->string' must point to struct/union
yara\libyara\ahocorasick.c(947) : error C2065: 'new_match' : undeclared identifier
yara\libyara\ahocorasick.c(947) : error C2223: left of '->forward_code' must point to struct/union
yara\libyara\ahocorasick.c(950) : error C2065: 'new_match' : undeclared identifier
yara\libyara\ahocorasick.c(950) : error C2223: left of '->backward_code' must point to struct/union
yara\libyara\ahocorasick.c(954) : error C2065: 'new_match' : undeclared identifier
yara\libyara\ahocorasick.c(954) : error C2223: left of '->next' must point to struct/union
yara\libyara\ahocorasick.c(955) : error C2065: 'new_match_ref' : undeclared identifier
yara\libyara\ahocorasick.c(955) : error C2440: '=' : cannot convert from 'int' to 'YR_ARENA_REF'
error: command 'C:\Users\26111\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: 'd:\programing\pythonstudy\python27\python.exe' -u -c 'import sys, setupt
ools, tokenize; sys.argv[0] = '"'"'c:\users\26111\appdata\local\temp\pip-req-build-uh94lm\setup.py'"'"'; file
='"'"'c:\users\26111\appdata\local\temp\pip-req-build-uh94lm\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', op
en)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"')
)' install --record 'c:\users\26111\appdata\local\temp\pip-record-tvb8xq\install-record.txt' --single-version-externally
-managed --compile --install-headers 'd:\programing\pythonstudy\python27\Include\yara-python' Check the logs for full co
mmand output.

Dominant language
C
Stars
754
Forks
190
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from VirusTotal/yara-python

All issues in VirusTotal/yara-python

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.