Appears to install correctly but will throw ImportError

Bug #1171704 reported by jozzas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pybullet
Won't Fix
Undecided
Unassigned

Bug Description

I'm having some trouble getting pybullet to run correctly after installing. I still believe it's a simple path problem and I'm being stupid, but maybe I've missed an installation step or something obvious that wasn't documented.

My configuration:

Ubuntu 10.04
Python 2.6.5
Bullet 2.8.1
PyBullet trunk (r54)
numpy 1.6.0

I have built and installed bullet, and can successfully run the demos that come with it.

I have successfully built and installed pybullet, but when trying to run any of the demos, I get the following error:

>> python helloworld.py
Traceback (most recent call last):
  File "helloworld.py", line 4, in <module>
    from bullet.bullet import (
ImportError: libBulletSoftBody.so.0: cannot open shared object file: No such file or directory

When running test_bullet.py from /usr/local/lib/python2.6/dist-packages/bullet, I get the following output (not sure if relevant):

>> python test_bullet.py
test_bullet.py:13: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility
  from bullet import (
test_bullet.py:13: RuntimeWarning: numpy.flatiter size changed, may indicate binary incompatibility
  from bullet import (

I have confirmed that:

/usr/local/lib (the location of the .so and .so.0 files for bullet) is in my .bashrc, and is definitely in my python path:

import sys
sys.path

(Output contains /usr/local/lib)

I have tried copying the bullet .so and .so.0 files directly to various other locations: the pybullet dist-packages folder, the dist-packages folder itself, to no avail.

How can I get pybullet to see my valid install of bullet?

Cheers!

Revision history for this message
jozzas (jozzas) wrote :

I should probably mention the build command that I issue and the result:

python setup.py build_ext --include-dirs /home/path-to-bullet/bullet-2.81-rev2613/src/ --library-dirs /usr/local/lib
running build_ext
skipping 'bullet/bullet.cpp' Cython extension (up-to-date)
building 'bullet.bullet' extension
creating build/temp.linux-x86_64-2.6
creating build/temp.linux-x86_64-2.6/bullet
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/lyonj/Downloads/bullet-2.81-rev2613/src/ -I/usr/include/python2.6 -c bullet/bullet.cpp -o build/temp.linux-x86_64-2.6/bullet/bullet.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
bullet/bullet.cpp: In function ‘PHY_ScalarType __pyx_f_6bullet_6bullet_11IndexedMesh__dtypeToScalarType(__pyx_obj_6bullet_6bullet_IndexedMesh*, PyArrayObject*)’:
bullet/bullet.cpp:4756: warning: ‘__pyx_r’ may be used uninitialized in this function
/usr/include/python2.6/numpy/__multiarray_api.h: At global scope:
/usr/include/python2.6/numpy/__multiarray_api.h:968: warning: ‘int _import_array()’ defined but not used
/usr/include/python2.6/numpy/__ufunc_api.h:182: warning: ‘int _import_umath()’ defined but not used
creating build/lib.linux-x86_64-2.6
creating build/lib.linux-x86_64-2.6/bullet
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/bullet/bullet.o -L/usr/local/lib -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -o build/lib.linux-x86_64-2.6/bullet/bullet.so

Seems to build and link okay, but maybe the linking isn't working?

Revision history for this message
jozzas (jozzas) wrote :

I copied the .so and .so.0 files from bullet to /usr/lib, re-ran the linking command manually (last bit above) and it's now working! Sorry for clogging up the bugs section, I'm sure I did something wrong in providing the library path to setup.py.

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

For the record, if your libraries are in /usr/local/lib then you probably also need to set LD_LIBRARY_PATH to include that directory at runtime in order for them to be found.

Changed in pybullet:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.