Page 1 of 1

Installing pybullet

Posted: Sun Nov 05, 2017 4:03 pm
by wexler
Hello everyone,

I'm trying to install pybullet on Windows 10, Python 2.7.10. I've downloaded ver. 2.87 from the bulletphysics.org, and built all the C examples using Visual Studio 2015. Then when I try to install pybullet using setup.py in the root directory ("setup.py install") I get errors when compiling pybullet.c. The command line that the script is issuing is

Code: Select all

C:\Users\markw\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\lib\site-packages\numpy\core\include -Isrc -Iexamples/ThirdPartyLibs -Iexamples/ThirdPartyLibs/Glew -Iexamples/ThirdPartyLibs/enet/include -Iexamples/ThirdPartyLibs/clsocket/src -IC:\Python27\include -IC:\Python27\PC /Tcexamples/pybullet/pybullet.c /Fobuild\temp.win32-2.7\Release\examples/pybullet/pybullet.obj -DGWEN_COMPILE_STATIC -DBT_USE_DOUBLE_PRECISION -DBT_ENABLE_ENET -DBT_ENABLE_CLSOCKET -DB3_DUMP_PYTHON_VERSION -DPYBULLET_USE_NUMPY -DWIN32 -DGLEW_STATIC
(so it's using the Visual C++ compiler for Python 2.7). The first few errors that I get are:

Code: Select all

examples/pybullet/pybullet.c(5748) : error C2143: syntax error : missing ';' before 'type'
examples/pybullet/pybullet.c(5750) : error C2275: 'npy_intp' : illegal use of this type as an expression
        c:\python27\lib\site-packages\numpy\core\include\numpy\npy_common.h(164) : see declaration of 'npy_intp'
examples/pybullet/pybullet.c(5750) : error C2146: syntax error : missing ';' before identifier 'rgb_dims'
examples/pybullet/pybullet.c(5750) : error C2065: 'rgb_dims' : undeclared identifier
examples/pybullet/pybullet.c(5750) : error C2109: subscript requires array or pointer type
examples/pybullet/pybullet.c(5750) : error C2059: syntax error : '{'
I've also tried using "pip install pybullet", and I get the same errors but with different line numbers (the first line number is 5992 instead of 5748).

Can anyone help? Thank you very much.

Mark

Re: Installing pybullet

Posted: Wed Nov 08, 2017 5:01 am
by Erwin Coumans
It was some C99 issue, variable declarations need to go first.

Can you try to run an update and let us know if that works for you (either github pull or pip install -U pybullet)