First time here? Check out the FAQ!
1

WingIDE on Fedora 26 cant find libSDL-1.2.so.0

fedora 26 workstation, wingpro 6.0.7-1 (rev 47fe5b0dd72b) using Fedora 26 python 3.6.2 wxPyton 4.0.0b2

'import wx' works fine but"import wx.dataview as dv"  causes an error:

File "/usr/lib64/python3.6/site-packages/wx/dataview.py", line 12, in <module>  from ._dataview import *builtins.ImportError: libSDL-1.2.so.0: cannot open shared object file: No such file or directory

so in the terminal i did:

sudo yum import libSDL-1.2.so.0
Last metadata expiration check: 0:19:04 ago on Mon 25 Sep 2017 09:59:11 AM -03.
Package SDL-1.2.15-24.fc26.i686 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

so it IS installed. so where is wingIDE looking for it?

ravenboy's avatar
11
ravenboy
asked 2017-09-25 09:38:00 -0500
Wingware Support's avatar
4.1k
Wingware Support
updated 2019-03-13 10:13:39 -0500
edit flag offensive 0 remove flag close merge delete

Comments

thanks so much  for the speedy reply

when in the terminal i did your steps and the last step:

>>> os.environ['LD_LIBRARY_PATH']
Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "/usr/lib64/python3.6/os.py", line 669, in __getitem__ raise KeyError(key) from None
KeyError: 'LD_LIBRARY_PATH'and:
>>> import wx.dataview as dv
Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "/usr/lib64/python3.6/site-packages/wx/dataview.py", line 12, in <module> from ._dataview import *ImportError: libSDL-1.2.so.0: cannot open shared object file: No such file or directory

so same results as when in WIngIDEI should point out this is the Fedora 26 default 3.6.2, i havent built it myself

i assume that 'LD_LIBRARY_PATH is an environment variable. i searched, and the file exists in /usr/lib. i will try just making an environment variable

ravenboy's avatar ravenboy (2017-09-25 10:00:00 -0500) edit

Where is libSDL-1.2.so.0 located?  You could add that directory to the env LD_LIBRARY_PATH so wx can find it.  So add LD_LIBRARY_PATH=/path/to/the/lib to Environment in Wing's Project Properties.  However, this seems more like a general package installation issue that maybe should be solved rather than worked around with manual configuration.  On Linux if you have all the packages, then the environment should really be set up correctly.  But assuming you also installled Python and wx from official packages then I'm not sure where to look to solve that.

Stepping back a bit... if 'import wx' works, does it work to then access wx.dataview directly?  If so, I would just do that.  It's also conceivable this is a bug in the wx 4 beta, depending on what they do to load .so modules.

Wingware Support's avatar Wingware Support (2017-09-25 10:08:00 -0500) edit

this is a brand new installation of fedora  26 in vmware running as virtual machine on a mac, not that i think that mattersmy installation of fedora 26 doesnt HAVE a LD_LIBRARY_PATH environment variable. so now i am trying by adding to wings preferences same code works (osx and windows)  on other platforms so i doubt its wxpython issue

ravenboy's avatar ravenboy (2017-09-25 10:15:00 -0500) edit

Are the working cases the same fedora and/or same exact wxpython version?  That may help narrow down whether it's a fedora package issue or problem in the wx beta.And yes, there often is no LD_LIBRARY_PATH env by default but it's a way to tell the library loader where to look for libraries it's not finding.

Wingware Support's avatar Wingware Support (2017-09-25 10:19:00 -0500) edit

ok. i am kinda new to unix, python and wings all at the same time. things went VERY sommothly on winows and OSx. and now i added tha path to the bash.rc file, and now i get and now i have e=the env var when checking it in terminal using your earlier instructionsand a new error: 

import wx.dataview as dv File "/usr/lib64/python3.6/site-packages/wx/dataview.py", line 12, in <module> from ._dataview import *builtins.ImportError: libSDL-1.2.so.0: wrong ELF class: ELFCLASS32

that ending 32 scares me. this is a 64 bit intsall and I'd have to guess thats an ELFCLASS32 should be ELFCLASS64

ravenboy's avatar ravenboy (2017-09-25 10:35:00 -0500) edit
add a comment see more comments

2 Answers

1

Yes, you have 32-bit libSDL and 64-bit Python, which can't import that.  You need to install 64-bit libSDL instead.  My guess is once that's done then you don't need to modify LD_LIBRARY_PATH at all.

Wingware Support's avatar
4.1k
Wingware Support
answered 2017-09-25 10:43:00 -0500
Wingware Admin's avatar
231
Wingware Admin
updated 2019-03-07 07:36:26 -0500
edit flag offensive 0 remove flag delete link

Comments

dnf install libSDL-1.2.so.0 installs 32 bit SDL  dnf install SDL installs 64 bit SDL

go figure

its ALWAYS something.... working on wingIDE and usiong Python3 at least means i dont have to write my app three different ways for three OS

thanks so much for your speedy help --- now i am doing real work. launched my app it failed another way, but this tome due to OSx serial ports being different than linux ports as to how you open them. (using pyserial) and THIS i totally expected.....

ravenboy's avatar ravenboy (2017-09-25 10:45:00 -0500) edit

you were right, the envirnment var is set in the 64 bit version, 

ravenboy's avatar ravenboy (2017-09-25 10:51:00 -0500) edit
add a comment see more comments
0

Assuming it works outside of Wing, then the problem is that Wing is not using the right env.  One simple solution is to start Wing from the command line environment in which the imports do work.  That may help if Wing picks up the right Python to use.

Or try comparing the following inside Wing and outside:

import sys, os
sys.executable
sys.path
os.environ['LD_LIBRARY_PATH']

These can be set/modified using Python Executable, Python Path, and Environment in Wing's Project Properties.

On Linux it may also be that you have say 32-bit libSDL and Python is running 64-bit, though this seems less likely.

Wingware Support's avatar
4.1k
Wingware Support
answered 2017-09-25 09:45:00 -0500
Wingware Admin's avatar
231
Wingware Admin
updated 2019-03-07 07:36:11 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer