You are not logged in.

#1 2010-12-06 08:27:52

wan
Member
Registered: 2010-11-19
Posts: 5

[SOLVED]Install Scribes after Archlinux's python3 update from october

I would like to install scribes with the latest updates, but since Archlinux switched to Python3 by default (in october), I am unable to do so.

Before the update, i ran without problem:

bzr branch lp:scribes
cd scribes
sh autogen.sh
make
sudo make install

But now I can't pass autogen.sh :

...
checking what language compliance flags to pass to the C++ compiler... 
checking for a Python interpreter with version >= 2.5... python
checking for python... /usr/bin/python
checking for python version... 3.1
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python3.1/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.1/site-packages
configure: error: Error: Dependency check failed

In conf.log there is:

...
configure:6227: ./conftest
  File "depcheck.py", line 10
    print "Checking for D-Bus (Python Bindings)... yes"
                                                      ^
SyntaxError: invalid syntax
....

So I run 2to3 on the depcheck.py file in the folder:

2to3 -w depcheck.py 

And I get:

...
checking for a Python interpreter with version >= 2.5... python
checking for python... /usr/bin/python
checking for python version... 3.1
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python3.1/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.1/site-packages
Error: Python bindings for D-Bus was not found.
configure: error: Error: Dependency check failed

In depcheck.py, the error is launched when:

        # Check for D-Bus Python Bindings.
        try:
            import dbus
            if dbus.version < (0, 70, 0): raise AssertionError
            print("Checking for D-Bus (Python Bindings)... yes")
        except ImportError:
            print("Error: Python bindings for D-Bus was not found.")
            raise SystemExit
        except AssertionError:
            print("Error: Version 0.70 or better of dbus-python needed.")
            raise SystemExit

It turns out I can't access dbus module from python3:

$ python
Python 3.1.3 (r313:86834, Dec  1 2010, 12:35:23) 
[GCC 4.5.1 20101125 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named dbus
>>> 
$ python2
Python 2.7.1 (r271:86832, Dec  2 2010, 03:10:07) 
[GCC 4.5.1 20101125 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus
>>> 

But anyway, scribes is written with python2 syntax in mind, so let's use it :

$ export PYTHONPATH=/usr/lib/python2.7

I now re-run ./autogen.sh :

...
checking what language compliance flags to pass to the C++ compiler... 
checking for a Python interpreter with version >= 2.5... ./configure: line 6015: 17533 Aborted                 ( $am_cv_pathless_PYTHON -c "$prog" ) 1>&5 2>&5
python2
checking for python2... /usr/bin/python2
checking for python2 version... 2.7
checking for python2 platform... linux2
checking for python2 script directory... ${prefix}/lib/python2.7/site-packages
checking for python2 extension module directory... ${exec_prefix}/lib/python2.7/site-packages
configure: error: Error: Dependency check failed

In conf.log, there is now:

...
configure:6191: result: ${exec_prefix}/lib/python2.7/site-packages
configure:6227: gcc -o conftest -g -O2   conftest.c  >&5
configure:6227: $? = 0
configure:6227: ./conftest
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/usr/lib/python2.7/encodings/utf_8.py", line 9, in <module>
configure:6227: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "scribes"
...

But with the PYTHONPATH set, I can't even start the python interpreter (python2 still works fine):

$ python
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/usr/lib/python2.7/encodings/utf_8.py", line 9, in <module>
Aborted

I can still start scribes without compiling it, but then on the console, the same error appears:

$ python2 scribes.in 
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/usr/lib/python2.7/encodings/utf_8.py", line 9, in <module>
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/usr/lib/python2.7/encodings/utf_8.py", line 9, in <module>

Without PYTHONPATH set, I can also run scribes (with python2), but it gives me an error in the console. I also tried o run 2to3 on every python file in the project and correcting the syntax to be conform to http://diveintopython3.org/porting-code … -2to3.html (but that's not really what I'm supposed to do, is it?), and I got the same error as the one below ("No module named gobject") when trying to build with autogen.sh:

$ export PYTHONPATH=
$ python2 scribes.in 
Traceback (most recent call last):
  File "/home/wan/scribes_d/scribes_721/SCRIBES/SaveSystem/ExternalProcess/ScribesSaveProcess.py", line 7, in <module>
    from gobject import MainLoop, threads_init
ImportError: No module named gobject

I am out of ideas to try to correct the problem. Can anyone help me please?

Last edited by wan (2010-12-09 01:26:14)

Offline

#2 2010-12-06 08:43:12

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,395
Website

Re: [SOLVED]Install Scribes after Archlinux's python3 update from october

Follow the PKGBUILD used for the scribes package in [community].

Offline

#3 2010-12-06 10:08:11

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]Install Scribes after Archlinux's python3 update from october

And when you have done so, you can (optionally) submit your working PKGBUILD to the AUR as scribes-bzr.

Offline

#4 2010-12-09 01:25:52

wan
Member
Registered: 2010-11-19
Posts: 5

Re: [SOLVED]Install Scribes after Archlinux's python3 update from october

I knew there was an old (and not up-to-date) package in community, but I didn't know that I could get the PKGBUILD.
That teached me the -G argument for yaourt!

To solve the problem, the previous script helped a lot:

$ sed -i 's/python depcheck.py/python2 depcheck.py/' configure.ac
... on some other files as well.

I submitted the now up-to-date PKGBUILD to the AUR here: http://aur.archlinux.org/packages.php?ID=44275

Thanks for your suggestions!

Offline

Board footer

Powered by FluxBB