Re: [spyder] Spyder can't locate shared objects... LD_LIBRARY_PATH?

1,285 views
Skip to first unread message

Carlos Córdoba

unread,
Feb 4, 2013, 7:12:42 PM2/4/13
to spyd...@googlegroups.com
You can insert env variables by going to the external console plugin, then selecting its options menu (the second button from right to left) and finally selecting the option "Environment variables".

This will open a new window. To define a new variable, make left click on it, then select "Edit" and lastly add the variable's name and value.

Hope it helps,
Carlos

El 04/02/13 12:13, Jeff Webster escribió:
The dev environment is Ubuntu 12.04 (if it matters, it is running virtualized in a Mac OS X 10.8 host).  If I run a Python module from the command line (after exporting LD_LIBRARY_PATH=/opt/xapi/lib, the location of the SO in question), everything operates as expected.  However, running the same module from within Spyder fails: 

OSError: libxapi.so: cannot open shared object file: No such file or directory 

Where does Spyder pick up the appropriate environment variables?  I've tried adding to PYTHONPATH manager from within the IDE, but that doesn't help.  

Thanks for the help...
JW 
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeff Webster

unread,
Feb 5, 2013, 8:36:14 AM2/5/13
to spyd...@googlegroups.com
Carlos,

Thanks for the reply.  Unfortunately, I don't think that worked... though I was able to add the variable manually, it doesn't seem to help the interpreter locate the shared object as I get the same error.  Also, once the interpreter is closed, it looses that manual entry... so I would seemingly have to do that every time I created a new instance of an interpreter?

I found another work-around: instead of launching Spyder from the desktop using the default path to the binary (/usr/bin/spyder), I created a shell script in my home folder:

#!/bin/bash

export LD_LIBRARY_PATH=/opt/xapi/lib:$LD_LIBRARY_PATH
/usr/bin/spyder

That works, and is permanent across all instances of the interpreter within the IDE.

I'm surprised the problem isn't more common... I wasn't able to find much about this issue (certainly not specifically wrt Spyder)... but it seems this is a common issue regarding any binaries launched from the desktop within Ubuntu where path nuances are important.

JW 

Agnieszka Dzielendziak

unread,
Dec 7, 2015, 6:47:16 PM12/7/15
to spyder
Hi All,

I realise this is a very old post but I came across the same problem today when trying to run Paraview scripts from Spyder. I set the following in my .bashrc:

export LD_LIBRARY_PATH=/opt/paraviewopenfoam44/lib/paraview-4.4:$LD_LIBRARY_PATH:.
PYTHONPATH=/opt/paraviewopenfoam44/lib/paraview-4.4/site-packages:/opt/paraviewopenfoam44/lib/paraview-4.4:/opt/paraviewopenfoam44/lib/paraview-4.4/site-packages/vtk:.
export PYTHONPATH

and everything worked great from a python session launched from the terminal but in Spyder I could not load the shared objects. After a while of digging around I found the solution to be adding the library path to /etc/ld.so.conf:

/opt/paraviewopenfoam44/lib/paraview-4.4

and then updating it via sudo ldconfig.

Maybe someone will find this to be of use.

A

Sridhar Thiagarajan

unread,
Jun 24, 2018, 4:14:04 PM6/24/18
to spyder
How do you add the library path exactly?
Reply all
Reply to author
Forward
0 new messages