Solved

wxPython build:  "parse error before" during Python setup

Posted on 2004-10-12
5
347 Views
Last Modified: 2013-12-27
Hey Guys,

I am in the process of installing wxPython on Solaris 9.  I was able to do a good configure and a successful make...however, the last step is to run a python setup, to integrate the wxPython tools with the Python install.  This is where I am having difficulty.  Here are the steps so far...

#PREFIXDIR=/opt/sfw/lib/python2.2/site-packages/wxWidgets

#./configure --prefix=$PREFIXDIR \
             --with-gtk \
             --enable-debug_flag \
             --enable-geometry \
             --enable-sound --with-sdl \
             --enable-display \
             --enable-optimize \
             --enable-rpath=$PREFIXDIR/lib \
             --enable-permissive \
             --disable-gtk2

...resulted in the output of ...

Configured wxWindows 2.5.1 for `sparc-sun-solaris2.9'

  Which GUI toolkit should wxWindows use?                 gtk
  Should wxWindows be compiled into single library?       no
  Should wxWindows be compiled in debug mode?             no
  Should wxWindows be linked as a shared library?         yes
  Should wxWindows be compiled in Unicode mode?           no
  What level of wxWindows compatibility should be enabled?
                                       wxWindows 2.2      no
                                       wxWindows 2.4      yes
  Which libraries should wxWindows use?
                                       jpeg               builtin
                                       png                builtin
                                       regex              sys
                                       tiff               builtin
                                       zlib               builtin
                                       odbc               no
                                       expat              builtin
                                       libmspack          no
                                       sdl                yes
... I then ran the following "make" script ...

make $* \
    && make -C contrib/src/gizmos $* \
    && make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" $* \
    && make -C contrib/src/stc $* \
    && make -C contrib/src/xrc $*
 
...with apparently successful output ...

HOWEVER, the final command to integrate Python with wxPython is giving the following problems (output truncated to last few lines...)

#python2.3 setup.py BUILD_GLCANVAS=0 BUILD_OGL=0 BUILD_STC=0
.
.
.
   _wrap_Display_ChangeMode(PyObject*, PyObject*, PyObject*)':
src/gtk/misc_wrap.cpp:27947: parse error before `)' token
src/gtk/misc_wrap.cpp: In function `PyObject*
   _wrap_Display_ResetMode(PyObject*, PyObject*, PyObject*)':
src/gtk/misc_wrap.cpp:27987: parse error before `)' token
error: command '/opt/sfw/gcc-3.2/bin/gcc' failed with exit status 1

Any suggesstions!?
Thanks!
M
0
Comment
Question by:Mike R.
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 12295347
I think it is easy to just download the binary package from:
http://sunfreeware.com/

Now get back to your problem, it could be the problem with your gcc complier, or some
of the lib path (LD_LIBRARY_PATH) missing.

The last time I built python was 2 years+ ago. I used gcc2.95.x (I have trouble with gcc3.0.x
for building mysql/php etc).  I have not use gcc-3.2.x, don't know how good it is. I have used
gcc 3.3.2 to built a webserver early this year, not much trouble.

You might want to check the Makefile (created by configure) to make sure things are ok,
eg Link flags etc. I normaly use gcc + glib + libgcc +zlib + autoconfig (GNU), not sure
if you have all of them installed in your system.

0
 
LVL 38

Expert Comment

by:yuzh
ID: 12295522
Hi rightmirem,

"SOLARIS NOTE: The --enable-rpath option may cause problems when using wxGTK on Solaris when compiling wxPython as described below. The woraround is to not use --enable-rpath flag for configure, but in that case all wxPython applications must have the LD_LIBRARY_PATH set to include $WXPREF/lib, or you can use the 'crle' program to modify the runtime linking environment. If this is the only installation of wxGTK on the system then you can use a system library path for prefix and not have to worry about it at all"

see : http://www.wxpython.org/INSTALL.html
0
 
LVL 3

Author Comment

by:Mike R.
ID: 12300095
Hey Yuzh,

Thanks again for all the help.  I actually tried configuring both with and without the enable-rpath (was thinking the same thing) and still ended up with the same errors.  I also tried the "disable-gtk2" flag just in case, but to no avail.

As an aside...I went to sunfreeware and was able to find the Pythin binary...but no the wxPython binaries.  I am wondering if I just looked in the wrong spot.  You don't happen to have the full link do you?  Or is the wx stuff included in the main Python install from that download?

I THINK all the pathiong and links are correct in the make file.  I am using gcc, g++, but I am not sure regarding the details of their installation as I inherited this system.

As far as adding items to the path...the configure is only identifying gtk1.2 as being on the system...and I am not sure if there is a difference between gtk1.2 and wxGtk.  What should I be looking for reagrding GTK installations (files with a find...for example?)

Thanks!
m
0
 
LVL 38

Accepted Solution

by:
yuzh earned 500 total points
ID: 12305357
wxGtk = wxWindows with GTK+, requires the GTK+ library to be installed on your system.

See "wxWindows 2.5 for GTK installation":
http://programming.ccp14.ac.uk/ftp-mirror/programming/wxwindows/pub/2.5.0p1/install-gtk-2.5.0.txt

Download:
http://www.wxwindows.org/
0
 
LVL 3

Author Comment

by:Mike R.
ID: 12309988
Hey Yuzh,

We do have GTK1.2.3 installed...but I discovered it was a different issue.

Simply put, the installation of wxPython runs TWO "makes".  First you run a standard configure, and a standard make/make install.  This compiles and creates all the necessary files and libs...just like every other install on the face of the (UNIX) earth.

HOWEVER...once the wxPython files are created...you then have to run the "python3.2 setup.py install" command to install these files INTO the existing Python install.  Seems simple enough...

The PROBLEM was that...when compiling I was using the "--prefix=<wherever>" switch to try and install the libs into a preferred sub directory...which was a DIFFERENT sub-dir than where Python3.2 was installed.  The standard (first) configure/make worked fine...BUT when running the "setup.py" stuff, Python was attempting to "install" these files where IT wanted them (in its own lib) and the contradiction between where I told the config/make to install them, and where Python wanted to install them, was causing the error.

Once I set the "--prefix=<existing python install>" during the configuration and make, everything functioned fine.  So we are good to go.  You still get points for the efforts though :-)

And may i say I hope I never have to deal with Python again (well, at least for another couple of weeks...at least :-)
M
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question