Installing in a different python instance

Hi all,

I am trying to use wxPython with SAGE (Software for Algebra and
Geometry Experimentation).

I do think that the problem is in this output I get when running setup.py:
cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++

Anyway, here goes some details of the journey:

SAGE uses python. And I found out that sage users really install 3rd
party python packages and use them normally on sage. Standard modules
are available and, for example, if I go like:

sage: import sys
sage: sys.path
['', '/media/kubold/home/ref/Desktop/packages/sage',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python25.zip',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/plat-linux2',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/lib-tk',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/lib-dynload',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages']

I am using Ubuntu 7.04 and 6.10 (multiboot). The problems are exactly the same.

---- First try: Appending python's sys.path to sage's python's sys.path

$ python
Python 2.5.1 (r251:54863, May 2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import wx ##So wx is working, right?
import sys
sys.path

['', '/usr/lib/python25.zip', '/usr/lib/python2.5',
'/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk',
'/usr/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/lib/python2.5/site-packages',
'/var/lib/python-support/python2.5',
'/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode']

When I append these directories (or just
'/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode') to sage' path,
the output is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/__init__.py",
line 42, in <module>
    from wx._core import *
  File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py",
line 4, in <module>
    import _core_
ImportError: /usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core_.so:
undefined symbol: PyUnicodeUCS4_FromWideChar

Ok. This wxPython install is called from apt. It seem to be compiled
for UCS4-based Unicode support (as seems to be python's apt
compilation). And SAGE's python seems to use UCS2-based Unicode
support. Assuming that all this is right, I went though:

---- Second Try: building wxwidgets and wxpython from source with no
Unicode support, and installing it to sage's python.
I am using wxPython just to make a Panel with buttons and SpinCtrl.
Some sizers.. all in English (firstly in Portuguese.. but that's ok,
maybe next time), I should not need Unicode support. Dependencies
should be ok, because wxPython for gtk2.8 is installed with apt.

$ cd wxPython-src-2.8.4.0/
$ mkdir bld
$ cd bld
$ ../configure --prefix=/home/tatius/Desktop/packs/experimental

And I get this output on one of the last lines:

Should wxWidgets be compiled in Unicode mode? no

Great.

$ make
...
$ make install

Wonderful. /home/tatius/Desktop/packs/experimental is there and seems
to have wxwidgets installation.

Next:
sage -python calls sage's python. So:
/media/kubold/home/ref/Desktop/packages/sage/sage -python setup.py
build_ext --inplace
WX_CONFIG=/home/tatius/Desktop/packs/experimental/bin/wx-config
UNICODE=0

I received several error of the types:

warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++

and

warning: 'created2' may be used uninitialized in this function

and

error: expected primary-expression before ')' token
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2991: error: expected `;' before '__null'
contrib/glcanvas/gtk/glcanvas_wrap.cpp:3003: error: 'wxGLCanvas' was
not declared in this scope

and:

contrib/glcanvas/gtk/glcanvas_wrap.cpp:4505: error: 'WX_GL_MIN_BLUE'
was not declared in this scope

finally:
error: command 'gcc' failed with exit status 1
...

then:
$ .../sage -python
Python 2.5.1 (r251:54863, May 8 2007, 11:39:04)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information

sys.path.append('/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython')
import wx

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/__init__.py",
line 45, in <module>
    from wx._core import *
  File "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/_core.py",
line 4, in <module>
    import _core_
ImportError: libwx_gtk2_aui-2.8.so.0: cannot open shared object file:
No such file or directory

Ok. Is seems to have no access to my compiled wxwidgets libs.

I tryed:
$ export LD_LIBRARY_PATH=/home/tatius/Desktop/packs/experimental/lib

$ export PYTHONPATH=/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython

Even though I think it was not a good idea. No improvement.

An other try was using 'sage' not sage -python.
Very similar output and:
error: command 'gcc' failed with exit status 1

The same problem with using standard python to run setup.py .
...

2º Try, on 2º Try:

mkdir bld2
cd bld2
../configure --prefix=/home/tatius/Desktop/packs/exp2 --with-gtk

make (Ok)
make -C contrib/src/gizmos (ok)
make -C contrib/src/stc (ok)

make install (ok)
make -C contrib/src/gizmos install (ok)
make -C contrib/src/stc install (ok)

cd ../wxPython
/media/kubold/home/ref/Desktop/packages/sage/sage setup.py buld_ext
WX_CONFIG=/home/tatius/Desktop/packs/exp2/bin/wx-config UNICODE=0

..
error: command 'gcc' failed with exit status 1
sage: Error running setup.py using Python

3º Try on 2º Try:

mkdir bld3
cd bld3
../configure --prefix=/home/tatius/Desktop/packs/exp2 --with-gtk
--enable-display

archieve: rola.sh
#!/bin/bash
make $* \
    && make -C contrib/src/gizmos $* \
    && make -C contrib/src/stc $*
chmod -x rola.sh

./rola.sh (ok)

./rola.sh install (ok)

cd ../wxPython

/media/kubold/home/ref/Desktop/packages/sage/sage setup.py build_ext
--inplace WX_CONFIG=/home/tatius/Desktop/packs/exp2/bin/wx-config
UNICODE=0

cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++

Any help is appreciated, this is quite important for stuffs I am doing.
Thanks in advance,
gk

Ok,
Many tests. Now the problem is:

sage: import wx

···

---------------------------------------------------------------------------
<type 'exceptions.ImportError'> Traceback (most recent call last)

/media/kubold/home/ref/Desktop/packages/sage/<ipython console> in <module>()

/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/__init__.py
in <module>()
     43
     44 # Load the package namespace with the core classes and such
---> 45 from wx._core import *
     46 del wx
     47

/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-ansi/wx/_core.py
in <module>()
      2 # Don't modify this file, modify the SWIG interface instead.
      3
----> 4 import _core_
      5 import new
      6 new_instancemethod = new.instancemethod

<type 'exceptions.ImportError'>: No module named _core_

What is this? How can I solve this problem?
thanks,
gk

On 5/28/07, Green Kobold <greenkobold@gmail.com> wrote:

Hi all,

I am trying to use wxPython with SAGE (Software for Algebra and
Geometry Experimentation).

I do think that the problem is in this output I get when running setup.py:
cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++

Anyway, here goes some details of the journey:

SAGE uses python. And I found out that sage users really install 3rd
party python packages and use them normally on sage. Standard modules
are available and, for example, if I go like:

sage: import sys
sage: sys.path
['', '/media/kubold/home/ref/Desktop/packages/sage',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python25.zip',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/plat-linux2',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/lib-tk',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/lib-dynload',
'/media/kubold/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages']

I am using Ubuntu 7.04 and 6.10 (multiboot). The problems are exactly the same.

---- First try: Appending python's sys.path to sage's python's sys.path

$ python
Python 2.5.1 (r251:54863, May 2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx ##So wx is working, right?
>>> import sys
>>> sys.path
['', '/usr/lib/python25.zip', '/usr/lib/python2.5',
'/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk',
'/usr/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/lib/python2.5/site-packages',
'/var/lib/python-support/python2.5',
'/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode']

When I append these directories (or just
'/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode') to sage' path,
the output is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/__init__.py",
line 42, in <module>
    from wx._core import *
  File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py",
line 4, in <module>
    import _core_
ImportError: /usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core_.so:
undefined symbol: PyUnicodeUCS4_FromWideChar

Ok. This wxPython install is called from apt. It seem to be compiled
for UCS4-based Unicode support (as seems to be python's apt
compilation). And SAGE's python seems to use UCS2-based Unicode
support. Assuming that all this is right, I went though:

---- Second Try: building wxwidgets and wxpython from source with no
Unicode support, and installing it to sage's python.
I am using wxPython just to make a Panel with buttons and SpinCtrl.
Some sizers.. all in English (firstly in Portuguese.. but that's ok,
maybe next time), I should not need Unicode support. Dependencies
should be ok, because wxPython for gtk2.8 is installed with apt.

$ cd wxPython-src-2.8.4.0/
$ mkdir bld
$ cd bld
$ ../configure --prefix=/home/tatius/Desktop/packs/experimental

And I get this output on one of the last lines:

Should wxWidgets be compiled in Unicode mode? no

Great.

$ make
...
$ make install

Wonderful. /home/tatius/Desktop/packs/experimental is there and seems
to have wxwidgets installation.

Next:
sage -python calls sage's python. So:
/media/kubold/home/ref/Desktop/packages/sage/sage -python setup.py
build_ext --inplace
WX_CONFIG=/home/tatius/Desktop/packs/experimental/bin/wx-config
UNICODE=0

I received several error of the types:

warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++

and

warning: 'created2' may be used uninitialized in this function

and

error: expected primary-expression before ')' token
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2991: error: expected `;' before '__null'
contrib/glcanvas/gtk/glcanvas_wrap.cpp:3003: error: 'wxGLCanvas' was
not declared in this scope

and:

contrib/glcanvas/gtk/glcanvas_wrap.cpp:4505: error: 'WX_GL_MIN_BLUE'
was not declared in this scope

finally:
error: command 'gcc' failed with exit status 1
...

then:
$ .../sage -python
Python 2.5.1 (r251:54863, May 8 2007, 11:39:04)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information
>>> sys.path.append('/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython')
>>> import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/__init__.py",
line 45, in <module>
    from wx._core import *
  File "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/_core.py",
line 4, in <module>
    import _core_
ImportError: libwx_gtk2_aui-2.8.so.0: cannot open shared object file:
No such file or directory

Ok. Is seems to have no access to my compiled wxwidgets libs.

I tryed:
$ export LD_LIBRARY_PATH=/home/tatius/Desktop/packs/experimental/lib

$ export PYTHONPATH=/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython

Even though I think it was not a good idea. No improvement.

An other try was using 'sage' not sage -python.
Very similar output and:
error: command 'gcc' failed with exit status 1

The same problem with using standard python to run setup.py .
...

2º Try, on 2º Try:

mkdir bld2
cd bld2
../configure --prefix=/home/tatius/Desktop/packs/exp2 --with-gtk

make (Ok)
make -C contrib/src/gizmos (ok)
make -C contrib/src/stc (ok)

make install (ok)
make -C contrib/src/gizmos install (ok)
make -C contrib/src/stc install (ok)

cd ../wxPython
/media/kubold/home/ref/Desktop/packages/sage/sage setup.py buld_ext
WX_CONFIG=/home/tatius/Desktop/packs/exp2/bin/wx-config UNICODE=0

..
error: command 'gcc' failed with exit status 1
sage: Error running setup.py using Python

3º Try on 2º Try:

mkdir bld3
cd bld3
../configure --prefix=/home/tatius/Desktop/packs/exp2 --with-gtk
--enable-display

archieve: rola.sh
#!/bin/bash
make $* \
    && make -C contrib/src/gizmos $* \
    && make -C contrib/src/stc $*
chmod -x rola.sh

./rola.sh (ok)

./rola.sh install (ok)

cd ../wxPython

/media/kubold/home/ref/Desktop/packages/sage/sage setup.py build_ext
--inplace WX_CONFIG=/home/tatius/Desktop/packs/exp2/bin/wx-config
UNICODE=0

cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++

Any help is appreciated, this is quite important for stuffs I am doing.
Thanks in advance,
gk

Green Kobold wrote:

ImportError: /usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core_.so:
undefined symbol: PyUnicodeUCS4_FromWideChar

Ok. This wxPython install is called from apt. It seem to be compiled
for UCS4-based Unicode support (as seems to be python's apt
compilation). And SAGE's python seems to use UCS2-based Unicode
support. Assuming that all this is right, I went though:

---- Second Try: building wxwidgets and wxpython from source with no
Unicode support, and installing it to sage's python.
I am using wxPython just to make a Panel with buttons and SpinCtrl.
Some sizers.. all in English (firstly in Portuguese.. but that's ok,
maybe next time), I should not need Unicode support. Dependencies
should be ok, because wxPython for gtk2.8 is installed with apt.

You're on the right track but came to the wrong conclusion. An ansi build of wxPython will still use the Python Unicode API in order to translate unicode values to ansi to pass on to wxGTK. The root of the problem is which unicode option was used to build the Python that is used for the wxPython build. That needs to have the same unicode settings as the Python used for running wxPython. Since sage's Python is using ucs2 then the Python used for building wxPython also needs to use ucs2. So assuming that sage's Python has all the development bits installed too the answer is to just run wxPython's setup.py with sage's Python. wxGTK's and wxPython's unicode settings don't matter, they will always do the RightThing based on the mode Python was compiled in.

$ cd wxPython-src-2.8.4.0/
$ mkdir bld
$ cd bld
$ ../configure --prefix=/home/tatius/Desktop/packs/experimental

I think that you'll be better off to just use the wxGTK from the APT repository and then just build a custom wxPython for sage. Just be sure you have the libwx*-dev packages installed.

Next:
sage -python calls sage's python. So:
/media/kubold/home/ref/Desktop/packages/sage/sage -python setup.py
build_ext --inplace
WX_CONFIG=/home/tatius/Desktop/packs/experimental/bin/wx-config
UNICODE=0

contrib/glcanvas/gtk/glcanvas_wrap.cpp:3003: error: 'wxGLCanvas' was
not declared in this scope

You don't have the GL headers and/or -dev packages installed. You can bypass that part of the wxPython build by adding BUILD_GLCANVAS=0 on the setup.py command line.

$ .../sage -python
Python 2.5.1 (r251:54863, May 8 2007, 11:39:04)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information

sys.path.append('/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython')

import wx

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/__init__.py",
line 45, in <module>
   from wx._core import *
File "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/_core.py",
line 4, in <module>
   import _core_
ImportError: libwx_gtk2_aui-2.8.so.0: cannot open shared object file:
No such file or directory

Ok. Is seems to have no access to my compiled wxwidgets libs.

You didn't do the install. That would have put both the compiled extension modules and the .py files into sage's site-packages dir in the right places.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Green Kobold wrote:

> ImportError:
> /usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core_.so:
> undefined symbol: PyUnicodeUCS4_FromWideChar
>
> Ok. This wxPython install is called from apt. It seem to be compiled
> for UCS4-based Unicode support (as seems to be python's apt
> compilation). And SAGE's python seems to use UCS2-based Unicode
> support. Assuming that all this is right, I went though:
>
> ---- Second Try: building wxwidgets and wxpython from source with no
> Unicode support, and installing it to sage's python.
> I am using wxPython just to make a Panel with buttons and SpinCtrl.
> Some sizers.. all in English (firstly in Portuguese.. but that's ok,
> maybe next time), I should not need Unicode support. Dependencies
> should be ok, because wxPython for gtk2.8 is installed with apt.

You're on the right track but came to the wrong conclusion. An ansi
build of wxPython will still use the Python Unicode API in order to
translate unicode values to ansi to pass on to wxGTK. The root of the
problem is which unicode option was used to build the Python that is
used for the wxPython build. That needs to have the same unicode
settings as the Python used for running wxPython. Since sage's Python
is using ucs2 then the Python used for building wxPython also needs to
use ucs2. So assuming that sage's Python has all the development bits
installed too the answer is to just run wxPython's setup.py with sage's
Python. wxGTK's and wxPython's unicode settings don't matter, they will
always do the RightThing based on the mode Python was compiled in.

ok! thanks!

>
> $ cd wxPython-src-2.8.4.0/
> $ mkdir bld
> $ cd bld
> $ ../configure --prefix=/home/tatius/Desktop/packs/experimental

I think that you'll be better off to just use the wxGTK from the APT
repository and then just build a custom wxPython for sage. Just be sure
you have the libwx*-dev packages installed.

ok, but if I enter wxPython and run setup.py:
/home/ref/Desktop/packages/sage/sage setup.py build_ext --inplace

I got:

/wx-2.8-gtk2-unicode/wx/tools/XRCed/encode_bitmaps.py to encode_bitmaps.pyc
running install_headers
creating /usr/include/wx-2.8/wx/wxPython
error: could not create '/usr/include/wx-2.8/wx/wxPython': Permission denied
sage: Error running setup.py using Python

and sudo /home/ref/Desktop/packages/sage/sage setup.py build_ext --inplace

gave me the same error:

/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/__init__.py
in <module>()
     43
     44 # Load the package namespace with the core classes and such
---> 45 from wx._core import *
     46 del wx
     47

/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py
in <module>()
      2 # Don't modify this file, modify the SWIG interface instead.
      3
----> 4 import _core_
      5 import new
      6 new_instancemethod = new.instancemethod

<type 'exceptions.ImportError'>: No module named _core_

> Next:
> sage -python calls sage's python. So:
> /media/kubold/home/ref/Desktop/packages/sage/sage -python setup.py
> build_ext --inplace
> WX_CONFIG=/home/tatius/Desktop/packs/experimental/bin/wx-config
> UNICODE=0

> contrib/glcanvas/gtk/glcanvas_wrap.cpp:3003: error: 'wxGLCanvas' was
> not declared in this scope

You don't have the GL headers and/or -dev packages installed. You can
bypass that part of the wxPython build by adding BUILD_GLCANVAS=0 on the
setup.py command line.

I installed freeglut-dev and ok!

> $ .../sage -python
> Python 2.5.1 (r251:54863, May 8 2007, 11:39:04)
> [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
> Type "help", "copyright", "credits" or "license" for more information
>>>> sys.path.append('/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython')
>>>>
>>>> import wx
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/__init__.py",
> line 45, in <module>
> from wx._core import *
> File
> "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/_core.py",
> line 4, in <module>
> import _core_
> ImportError: libwx_gtk2_aui-2.8.so.0: cannot open shared object file:
> No such file or directory
>
> Ok. Is seems to have no access to my compiled wxwidgets libs.

You didn't do the install. That would have put both the compiled
extension modules and the .py files into sage's site-packages dir in the
right place.

Actually i have done the .../sage setup.py install. But the same error
is there still. More accurate, the output is:

sage: import wx

···

On 5/28/07, Robin Dunn <robin@alldunn.com> wrote:
---------------------------------------------------------------------------
<type 'exceptions.ImportError'> Traceback (most recent call last)

/home/ref/Desktop/packages/sage/<ipython console> in <module>()

/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/__init__.py
in <module>()
     43
     44 # Load the package namespace with the core classes and such
---> 45 from wx._core import *
     46 del wx
     47

/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py
in <module>()
      2 # Don't modify this file, modify the SWIG interface instead.
      3
----> 4 import _core_
      5 import new
      6 new_instancemethod = new.instancemethod

<type 'exceptions.ImportError'>: No module named _core_

I had to boot on an other linux install, so the wxwidgets installation
is now in /home/ref/exp2

I will continue on this, my work is stuck until I get this running.

Thanks for your help Robin. Any other ideas?

Hi,

Its done. With your explanation about usc2, usc4. I downloaded by apt
the required libs and then ran setup.py without those strange flags.
Thanks Robin, with your hints I could situate what I was doing in
relation to what had to be done. BTW. what whre these options doing:
"build_ext --inplace", and why was it keeping me from installing it to
my python?

cheers!
gk

···

On 5/28/07, Green Kobold <greenkobold@gmail.com> wrote:

On 5/28/07, Robin Dunn <robin@alldunn.com> wrote:
> Green Kobold wrote:
>
> > ImportError:
> > /usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core_.so:
> > undefined symbol: PyUnicodeUCS4_FromWideChar
> >
> > Ok. This wxPython install is called from apt. It seem to be compiled
> > for UCS4-based Unicode support (as seems to be python's apt
> > compilation). And SAGE's python seems to use UCS2-based Unicode
> > support. Assuming that all this is right, I went though:
> >
> > ---- Second Try: building wxwidgets and wxpython from source with no
> > Unicode support, and installing it to sage's python.
> > I am using wxPython just to make a Panel with buttons and SpinCtrl.
> > Some sizers.. all in English (firstly in Portuguese.. but that's ok,
> > maybe next time), I should not need Unicode support. Dependencies
> > should be ok, because wxPython for gtk2.8 is installed with apt.
>
> You're on the right track but came to the wrong conclusion. An ansi
> build of wxPython will still use the Python Unicode API in order to
> translate unicode values to ansi to pass on to wxGTK. The root of the
> problem is which unicode option was used to build the Python that is
> used for the wxPython build. That needs to have the same unicode
> settings as the Python used for running wxPython. Since sage's Python
> is using ucs2 then the Python used for building wxPython also needs to
> use ucs2. So assuming that sage's Python has all the development bits
> installed too the answer is to just run wxPython's setup.py with sage's
> Python. wxGTK's and wxPython's unicode settings don't matter, they will
> always do the RightThing based on the mode Python was compiled in.

ok! thanks!

>
> >
> > $ cd wxPython-src-2.8.4.0/
> > $ mkdir bld
> > $ cd bld
> > $ ../configure --prefix=/home/tatius/Desktop/packs/experimental
>
> I think that you'll be better off to just use the wxGTK from the APT
> repository and then just build a custom wxPython for sage. Just be sure
> you have the libwx*-dev packages installed.

ok, but if I enter wxPython and run setup.py:
/home/ref/Desktop/packages/sage/sage setup.py build_ext --inplace

I got:

/wx-2.8-gtk2-unicode/wx/tools/XRCed/encode_bitmaps.py to encode_bitmaps.pyc
running install_headers
creating /usr/include/wx-2.8/wx/wxPython
error: could not create '/usr/include/wx-2.8/wx/wxPython': Permission denied
sage: Error running setup.py using Python

and sudo /home/ref/Desktop/packages/sage/sage setup.py build_ext --inplace

gave me the same error:

/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/__init__.py
in <module>()
     43
     44 # Load the package namespace with the core classes and such
---> 45 from wx._core import *
     46 del wx
     47

/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py
in <module>()
      2 # Don't modify this file, modify the SWIG interface instead.
      3
----> 4 import _core_
      5 import new
      6 new_instancemethod = new.instancemethod

<type 'exceptions.ImportError'>: No module named _core_

>
> > Next:
> > sage -python calls sage's python. So:
> > /media/kubold/home/ref/Desktop/packages/sage/sage -python setup.py
> > build_ext --inplace
> > WX_CONFIG=/home/tatius/Desktop/packs/experimental/bin/wx-config
> > UNICODE=0
>
> > contrib/glcanvas/gtk/glcanvas_wrap.cpp:3003: error: 'wxGLCanvas' was
> > not declared in this scope
>
> You don't have the GL headers and/or -dev packages installed. You can
> bypass that part of the wxPython build by adding BUILD_GLCANVAS=0 on the
> setup.py command line.

I installed freeglut-dev and ok!

> > $ .../sage -python
> > Python 2.5.1 (r251:54863, May 8 2007, 11:39:04)
> > [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information
> >>>> sys.path.append('/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython')
> >>>>
> >>>> import wx
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > File
> > "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/__init__.py",
> > line 45, in <module>
> > from wx._core import *
> > File
> > "/home/tatius/Desktop/packs/wxPython-src-2.8.4.0/wxPython/wx/_core.py",
> > line 4, in <module>
> > import _core_
> > ImportError: libwx_gtk2_aui-2.8.so.0: cannot open shared object file:
> > No such file or directory
> >
> > Ok. Is seems to have no access to my compiled wxwidgets libs.
>
> You didn't do the install. That would have put both the compiled
> extension modules and the .py files into sage's site-packages dir in the
> right place.

Actually i have done the .../sage setup.py install. But the same error
is there still. More accurate, the output is:

sage: import wx
---------------------------------------------------------------------------
<type 'exceptions.ImportError'> Traceback (most recent call last)

/home/ref/Desktop/packages/sage/<ipython console> in <module>()

/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/__init__.py
in <module>()
     43
     44 # Load the package namespace with the core classes and such
---> 45 from wx._core import *
     46 del wx
     47

/home/ref/Desktop/packages/sage/local/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py
in <module>()
      2 # Don't modify this file, modify the SWIG interface instead.
      3
----> 4 import _core_
      5 import new
      6 new_instancemethod = new.instancemethod

<type 'exceptions.ImportError'>: No module named _core_

I had to boot on an other linux install, so the wxwidgets installation
is now in /home/ref/exp2

I will continue on this, my work is stuck until I get this running.

Thanks for your help Robin. Any other ideas?

Green Kobold wrote:

Hi,

Its done. With your explanation about usc2, usc4. I downloaded by apt
the required libs and then ran setup.py without those strange flags.
Thanks Robin, with your hints I could situate what I was doing in
relation to what had to be done. BTW. what whre these options doing:
"build_ext --inplace",

That would have put the extension modules into the wx dir in the source tree, which is one way to test without needing to install to site-packages, you just need to set PYTHONPATH correclty.

and why was it keeping me from installing it to
my python?

I'm not sure. It shouldn't have prevented the distutils install command from working.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Ok. Everything. But my SpinCtrl don't display initial texts as before.
For example:

wx.SpinCtrl(self,ID_SPIN,'numb of elements',(10,100), min=1, max=200)

was displaying 'numb of elements' before I set any value in it.

what can that be?

···

On 5/29/07, Robin Dunn <robin@alldunn.com> wrote:

Green Kobold wrote:
> Hi,
>
> Its done. With your explanation about usc2, usc4. I downloaded by apt
> the required libs and then ran setup.py without those strange flags.
> Thanks Robin, with your hints I could situate what I was doing in
> relation to what had to be done. BTW. what whre these options doing:
> "build_ext --inplace",

That would have put the extension modules into the wx dir in the source
tree, which is one way to test without needing to install to
site-packages, you just need to set PYTHONPATH correclty.

> and why was it keeping me from installing it to
> my python?

I'm not sure. It shouldn't have prevented the distutils install command
from working.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Green Kobold wrote:

Ok. Everything. But my SpinCtrl don't display initial texts as before.
For example:

wx.SpinCtrl(self,ID_SPIN,'numb of elements',(10,100), min=1, max=200)

was displaying 'numb of elements' before I set any value in it.

what can that be?

Which version were you using before? Does calling SetValue help?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Green Kobold wrote:
> Ok. Everything. But my SpinCtrl don't display initial texts as before.
> For example:
>
> wx.SpinCtrl(self,ID_SPIN,'numb of elements',(10,100), min=1, max=200)
>
> was displaying 'numb of elements' before I set any value in it.
>
> what can that be?

Which version were you using before? Does calling SetValue help?

I don't really recall and killed my previous install, but anyway,
wx.SpinCtrl(self,ID_SPIN,'numb of elements',(10,100), min=1, max=200)
Should be displaying the text 'numb of elements', or not? now I am
using wxwidgets2.8 apt packs and a wxpython build from a fresh
wxpython source.
SetValue only accepts integers here.

···

On 5/30/07, Robin Dunn <robin@alldunn.com> wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Green Kobold wrote:

···

On 5/30/07, Robin Dunn <robin@alldunn.com> wrote:

Green Kobold wrote:
> Ok. Everything. But my SpinCtrl don't display initial texts as before.
> For example:
>
> wx.SpinCtrl(self,ID_SPIN,'numb of elements',(10,100), min=1, max=200)
>
> was displaying 'numb of elements' before I set any value in it.
>
> what can that be?

Which version were you using before? Does calling SetValue help?

I don't really recall and killed my previous install, but anyway,
wx.SpinCtrl(self,ID_SPIN,'numb of elements',(10,100), min=1, max=200)
Should be displaying the text 'numb of elements', or not?

No, it looks like it is ensuring that the value displayed is within the range set for the control.

If you want to do something like that then you can use a textctrl and a spin button and then manage converting the spin events to changes in the textctrl.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!