Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Problems running PySFML with Python3.0  (Read 12789 times)

0 Members and 1 Guest are viewing this topic.

nonexistent

  • Newbie
  • *
  • Posts: 14
    • View Profile
Problems running PySFML with Python3.0
« on: August 03, 2009, 12:41:47 am »
Hello, I'm having some problems running PySFML programs.  My system is 32-bit Arch Linux.  I have python3.0 installed, and installed the full PySFML 1.5 SDK.  If I try to run a simple hello world SFML program:

Code: [Select]
from PySFML import sf

window = sf.RenderWindow(sf.VideoMode(800, 600), "Floating")
text = sf.String("Hello SFML")

running = True
while running:
    event = sf.Event()
    while window.GetEvent(event):
        if event.Type == sf.Event.Closed:
            running = False

    window.Clear(sf.Color.Black)
    window.Draw(text)
    window.Display()


I get the error:

Traceback (most recent call last):
  File "ex1.py", line 2, in <module>
    from PySFML import sf
ImportError: /usr/local/lib/python3.0/site-packages/PySFML/sf.so: undefined symbol: _ZNK2sf5Sound20IsRelativeToListenerEv

I tried editing the python setup.py installer as specified in http://www.sfml-dev.org/wiki/en/tutorials/installpysfml and reinstalling, but it made no difference.

Does anyone know what the problem is?

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Problems running PySFML with Python3.0
« Reply #1 on: August 03, 2009, 03:38:41 pm »
Make sure you have well installed the sfml librairies, with the good version.

nonexistent

  • Newbie
  • *
  • Posts: 14
    • View Profile
Problems running PySFML with Python3.0
« Reply #2 on: August 04, 2009, 03:22:37 am »
Quote from: "remi.k2620"
Make sure you have well installed the sfml librairies, with the good version.


I am quite sure this is the case unless something is wrong with the following:

I downloaded SFML-1.5-sdk-linux-32.tar.gz and SFML-1.5-python-sdk.zip from the SFML downloads page.  After extracting both I built and installed from the python folder from SFML-1.5-python-sdk.zip with "python3.0 setup.py build; sudo python3.0 setup.py install".

Still looking for a solution.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Problems running PySFML with Python3.0
« Reply #3 on: August 04, 2009, 07:50:49 am »
Remi, did you bind sf::Sound::SetRelativeToListener? It is a new function (maybe even the only one!) in SFML 1.5.
Laurent Gomila - SFML developer

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Problems running PySFML with Python3.0
« Reply #4 on: August 04, 2009, 05:15:50 pm »
Quote from: "Laurent"
Remi, did you bind sf::Sound::SetRelativeToListener? It is a new function (maybe even the only one!) in SFML 1.5.


Yes, and there is also sf::Sound::IsRelativeToListener, see http://sfml.svn.sourceforge.net/viewvc/sfml/tags/1.5/python/src/Sound.cpp?r1=1056&r2=1064
So nonexistent you probably have an older version of sfml installed somewhere.

nonexistent

  • Newbie
  • *
  • Posts: 14
    • View Profile
Problems running PySFML with Python3.0
« Reply #5 on: August 05, 2009, 10:17:59 am »
Quote from: "remi.k2620"
Quote from: "Laurent"
Remi, did you bind sf::Sound::SetRelativeToListener? It is a new function (maybe even the only one!) in SFML 1.5.


Yes, and there is also sf::Sound::IsRelativeToListener, see http://sfml.svn.sourceforge.net/viewvc/sfml/tags/1.5/python/src/Sound.cpp?r1=1056&r2=1064
So nonexistent you probably have an older version of sfml installed somewhere.


I have PySFML 1.4 installed for Python 2.6, but I do not think this would affect Python 3.0.  Just to be safe, I removed the 1.4 files from site-packages for Python 2.6.

If I remove PySFML 1.5 from site-packages in Python 3.0 and try to run a PySFML program, I will get the error:

Traceback (most recent call last):
  File "ex1.py", line 2, in <module>
    from PySFML import sf
ImportError: No module named PySFML

If I then go back and rebuild and reinstall PySFML 1.5 from source as specified in my previous post, I still get this "undefined symbol: _ZNK2sf5Sound20IsRelativeToListenerEv" error.

So unless I am overlooking something I definitely do not have a conflict with an older PySFML.

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Problems running PySFML with Python3.0
« Reply #6 on: August 05, 2009, 11:32:26 am »
Quote from: "nonexistent"
So unless I am overlooking something I definitely do not have a conflict with an older PySFML.

I suggested a conflict with an older sfml, not an older pysfml. What does ls /usr/lib/libsfml* output ?

nonexistent

  • Newbie
  • *
  • Posts: 14
    • View Profile
Problems running PySFML with Python3.0
« Reply #7 on: August 06, 2009, 05:55:54 am »
Quote from: "remi.k2620"
Quote from: "nonexistent"
So unless I am overlooking something I definitely do not have a conflict with an older PySFML.

I suggested a conflict with an older sfml, not an older pysfml. What does ls /usr/lib/libsfml* output ?


Whoops... I've been parsing your posts with "sfml" automatically as "PySFML".  You were right from the start, I had an old SFML 1.4 in my /usr/lib.  I should probably read things more carefully...  :oops:   Anyway thanks, things are working now.

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Problems running PySFML with Python3.0
« Reply #8 on: August 06, 2009, 10:58:09 am »
Quote from: "nonexistent"
Anyway thanks, things are working now.

Great :)