Having issues setting up Phoenix

Hello,

I am on Lubuntu 12.04 and I’ve installed Python 3.2 via Synaptic Package Manager. Now I’ve downloaded the snapshot build of wxPython Phoenix for Python 3.2 and un-extracted the tarball and put the “wx” folder (that one besides the README file) to /home/username. Then I typed in the console this two things:

export PYTHONPATH="/home/username"

and

export LD_LIBRARY_PATH=“home/username/wx”

So now I have the “wx” folder in /home/username and all the neccessary system variables set. Now I type “python3.2” in the console which fires up Python 3.2. I then type “import wx” and I get this error:

Traceback (most recent call last):

File “”, line 1, in

File “wx/init.py”, line 17, in

from wx.core import *

File “wx/core.py”, line 6, in

from ._core import *

ImportError: No module named _core

Also, when I restart the console, the PYTHONPATH and LD_LIBRARY_PATH system variables disappear. How can I make Phoenix work for me and how to make those two mentioned system variables stay exported? Thanks. :wink:

Bo�tjan Mejak wrote:

Hello,

I am on Lubuntu 12.04 and I've installed Python 3.2 via Synaptic Package
Manager. Now I've downloaded the snapshot build of wxPython Phoenix for
Python 3.2 and un-extracted the tarball and put the "wx" folder (that
one besides the README file) to /home/username.

That's a pretty neat trick considering that there are no Phoenix snapshot builds for any platform other than Windows and OSX. (IOW, you will need to build it yourself on Linux, at least for now.)

Also, when I restart the console, the PYTHONPATH and LD_LIBRARY_PATH
system variables disappear. How can I make Phoenix work for me and how
to make those two mentioned system variables stay exported? Thanks. :wink:

Add code to your ~/.bash_profile or ~/.bashrc file.

···

--
Robin Dunn
Software Craftsman

Thanks for the reply. I just found out that there is source code of Phoenix on Github. May I ask you whether I need wxWidget’s source as well to build Phoenix? If yes, where to put that source of wxWidgets? Should I put it in the Phoenix source code folder or perhaps Phoenix source code folder to wxWidget’s source code folder? Also, what command should I need to type in the console to build Phoenix? My processor is 32-bit.

Bo�tjan Mejak wrote:

Thanks for the reply. I just found out that there is source code of
Phoenix on Github.

There is now also a daily snapshot of the source being copied to the server. Index of /Phoenix/snapshot-builds

May I ask you whether I need wxWidget's source as
well to build Phoenix? If yes, where to put that source of wxWidgets?

Yes. They should be siblings (located in the same parent folder.)

Should I put it in the Phoenix source code folder or perhaps Phoenix
source code folder to wxWidget's source code folder? Also, what command
should I need to type in the console to build Phoenix? My processor is
32-bit.

python build.py 3.2 dox etg --nodoc sip build

The "3.2" specifies the Python you are building for. Verify in the first few lines of the output that it is indeed using the python executable that you want it to use. If you use the daily snapshot tarball then you won't need the "dox etg --nodoc sip" commands as all the source generated by those commands will already be in the tarball. (At least I think so, I haven't actually tested it yet.)

After that has finished building then you should have a usable wx package in the Phoenix/wx subfolder that you can use in-place by setting the appropriate environment variables. The build.py script also has options for doing installs too, but it is not well tested (almost none at all!) and I fully expect it to have some bugs. I plan on working on that soon. In the mean time just use the built wx package from the source tree.

···

--
Robin Dunn
Software Craftsman

Robin, I have downloaded the source code of wxWidgets and Phoenix from Github and un-extracted both to a folder named Downloads. Then I renamed the source code folders of “Phoenix-master” to just “Phoenix” and “wxWidgets-master” to “wxWidgets”.

I opened the console and navigated to ~/Downloads/Phoenix and then executed the following command:

python build.py 3.3 dox etg --nodoc sip build

and got the following errors:

Found python3.3 at /usr/local/bin/python3.3

3.3.0 (default, Feb 24 2013, 23:10:07)

[GCC 4.6.3]

Python’s architecture is 32bit

Running command: dox

Checking for /home/zvezda/Downloads/Phoenix/bin/doxygen-1.8.2-linux…

./regen.sh xml

./regen.sh: line 116: /home/zvezda/Downloads/Phoenix/bin/doxygen-1.8.2-linux: cannot execute binary file

Finished command: dox (0.108s)

Running command: etg

Traceback (most recent call last):

File “build.py”, line 1418, in

main(sys.argv[1:])

File “build.py”, line 159, in main

function(options, args)

File “build.py”, line 620, in etg

ns = loadETG(script)

File “/home/zvezda/Downloads/Phoenix/buildtools/config.py”, line 594, in loadETG

myExecfile(name, ns.nsdict())

File “/home/zvezda/Downloads/Phoenix/buildtools/config.py”, line 805, in myExecfile

execfile(filename, ns)

File “etg/_html.py”, line 10, in

import etgtools

File “/home/zvezda/Downloads/Phoenix/etgtools/init.py”, line 29, in

assert os.path.exists(XMLSRC), "Unable to locate Doxygen XML files at " + XMLSRC

AssertionError: Unable to locate Doxygen XML files at /home/zvezda/Downloads/wxWidgets/docs/doxygen/out/xml

Finished command: etg (0.82s)

···

What am I doing wrong?

Also, please tell me how to build Phoenix by using the snapshot build. There’s no build.py in the folder of the snapshot build. I am very new to building things from source, so please be gentle. :wink:

Bo�tjan Mejak wrote:

Robin, I have downloaded the source code of wxWidgets and Phoenix from
Github and un-extracted both to a folder named Downloads. Then I renamed
the source code folders of "Phoenix-master" to just "Phoenix" and
"wxWidgets-master" to "wxWidgets".

I opened the console and navigated to ~/Downloads/Phoenix and then
executed the following command:

python build.py 3.3 dox etg --nodoc sip build

and got the following errors:

Found python3.3 at /usr/local/bin/python3.3
3.3.0 (default, Feb 24 2013, 23:10:07)
[GCC 4.6.3]
Python's architecture is 32bit

Running command: dox
Checking for /home/zvezda/Downloads/Phoenix/bin/doxygen-1.8.2-linux...
./regen.sh xml
./regen.sh: line 116:
/home/zvezda/Downloads/Phoenix/bin/doxygen-1.8.2-linux: cannot execute
binary file
Finished command: dox (0.108s)
Running command: etg
Traceback (most recent call last):
   File "build.py", line 1418, in <module>
     main(sys.argv[1:])
   File "build.py", line 159, in main
     function(options, args)
   File "build.py", line 620, in etg
     ns = loadETG(script)
   File "/home/zvezda/Downloads/Phoenix/buildtools/config.py", line 594,
in loadETG
     myExecfile(name, ns.nsdict())
   File "/home/zvezda/Downloads/Phoenix/buildtools/config.py", line 805,
in myExecfile
     execfile(filename, ns)
   File "etg/_html.py", line 10, in <module>
     import etgtools
   File "/home/zvezda/Downloads/Phoenix/etgtools/__init__.py", line 29,
in <module>
     assert os.path.exists(XMLSRC), "Unable to locate Doxygen XML files
at " + XMLSRC
AssertionError: Unable to locate Doxygen XML files at
/home/zvezda/Downloads/wxWidgets/docs/doxygen/out/xml
Finished command: etg (0.82s)

--------------------------------------------
What am I doing wrong?

The doxygen executable that was downloaded was probably not compatible with your computer's architecture, or something like that. You can install doxygen yourself from the package repositories and tell build.py to use it instead by setting the DOXYGEN environment variable to the full path to that executable. Try to get version 1.8.2 if you can so it matches what is normally used by Phoenix.

Also, please tell me how to build Phoenix by using the snapshot build.
There's no build.py in the folder of the snapshot build. I am very new
to building things from source, so please be gentle. :wink:

The build.py script is in the Phoenix subdir of the src tarball, just like if you had fetched both source trees from svn or git. Did you not download one of the "src" files? (Such as http://wxpython.org/Phoenix/snapshot-builds/wxPython-Phoenix-r73568-src.tar.gz)

BTW, I just did a test build using just the src tarball and not generating any new code, and it looks like there is still one place that is looking for the doxygen XML files that doesn't need to. So if you want to use the current src tarball then you will want to comment out the line starting with "assert os.path.exists(XMLSRC)" in Phoenix/etgtools/__init__.py

···

--
Robin Dunn
Software Craftsman

Robin, thank you very much (again!) for your very instructional reply. However, I only want to know 2 more things.

I have downloaded the snapshot build of Phoenix by downloading http://wxpython.org/Phoenix/snapshot-builds/wxPython-Phoenix-r73568-win32-py3.3.tar.gz so please tell me how to get this particular build working for me.

Also, I need to know what path should I set for the LD_LIBRARY_PATH system variable. It should point to what?

export LD_LIBRARY_PATH=???

Please ignore my previous post. I have successfuly build wxWidgets from source. What I did was that I downloaded http://wxpython.org/Phoenix/snapshot-builds/wxPython-Phoenix-r73568-src.tar.gz and unextracted the containing folder and then in the console navigated to the Phoenix subfolder and executed the following command:

python build.py 3.3 build

After 36 minutes of building wxWidgets from source I got this:

Running command: build_py

Running command: waf_py

Checking for /home/zvezda/src/Phoenix/bin/waf-1.7.9…

Not found. Attempting to download…

Connection successful…

Data downloaded…

Checking for /home/zvezda/src/Phoenix/bin/waf-1.7.9…

/usr/local/bin/python3.3 /home/zvezda/src/Phoenix/bin/waf-1.7.9 --wx_config=/home/zvezda/src/Phoenix/bld/wx-config --python=/usr/local/bin/python3.3 --out=build_waf/3.3 configure build

Setting top to : /home/zvezda/src/Phoenix

Setting out to : /home/zvezda/src/Phoenix/build_waf/3.3

Checking for ‘gcc’ (c compiler) : /usr/bin/gcc

Checking for ‘g++’ (c++ compiler) : /usr/bin/g++

Checking for program python : /usr/local/bin/python3.3

Checking for python version : (3, 3, 0, ‘final’, 0)

Checking for library python3.3 in LIBDIR : not found

Checking for library python3.3 in python_LIBPL : not found

Checking for library python3.3 in $prefix/libs : not found

Checking for library python33 in LIBDIR : not found

Checking for library python33 in python_LIBPL : not found

Checking for library python33 in $prefix/libs : not found

Checking for program /usr/local/bin/python3.3-config,python3.3-config,python-config-3.3,python3.3m-config : /usr/local/bin/python3.3-config

Checking for header Python.h : :frowning:

Asking python-config for the flags (pyembed) : yes

Getting pyembed flags from python-config : Could not build a python embedded interpreter

The configuration failed

(complete log in /home/zvezda/src/Phoenix/build_waf/3.3/config.log)

Command '/usr/local/bin/python3.3 /home/zvezda/src/Phoenix/bin/waf-1.7.9 --wx_config=/home/zvezda/src/Phoenix/bld/wx-config --python=/usr/local/bin/python3.3 --out=build_waf/3.3 configure build ’ failed with exit code 1.

Finished command: waf_py (9.512s)

Finished command: build_py (9.520s)

Finished command: build (36m53.925s)

···

What should I do?

Let me give you the config.log file as well. It’s in the attachment.

config.log (28.1 KB)

I fixed my issue with waf not being built.

Before executing python build.py 3.3 build_py I edited the file

{source folder of wxWidgets and Phoenix}/Phoenix/bin/.waf3-1.7.9-16e1644c17ba46b94844133bac6e2a8c/waflib/Tools/python.py
in line 173

from this:

for name in (‘python’ + env[‘PYTHON_VERSION’], ‘python’ + env[‘PYTHON_VERSION’].replace(’.’,’’))

to this:

for name in (‘python’ + env[‘PYTHON_VERSION’], ‘python’ + env[‘PYTHON_VERSION’] + ‘m’, ‘python’+env[‘PYTHON_VERSION’].replace(’.’,’’))

Note that I added an ‘m’ there because waf expects python3.3m-config

I hope someone could fix waf to have the aforementioned python.py file fixed on line 173 with the added

  • env[‘PYTHON_VERSION’] + ‘m’

Thanks. :wink:

Even though I built wxWidgets and Phoenix successfuly from source, I still have an error importing wx by using Python 3.3.

Here’s the error:

import wx

Traceback (most recent call last):

File “”, line 1, in

File “/home/zvezda/src/Phoenix/wx/init.py”, line 17, in

from wx.core import *

ImportError: No module named ‘wx.core’

Why am I still having this error???

Bo�tjan Mejak wrote:

Even though I built wxWidgets and Phoenix successfuly from source, I
still have an error importing wx by using Python 3.3.

Here's the error:

>>> import wx
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/home/zvezda/src/Phoenix/wx/__init__.py", line 17, in <module>
     from wx.core import *
ImportError: No module named 'wx.core'

Why am I still having this error???

It looks like there are some more missing files from the source distribution. I'll get that fixed for the next build.

···

--
Robin Dunn
Software Craftsman

Bo�tjan Mejak wrote:

I fixed my issue with waf not being built.

Before executing python build.py 3.3 build_py I edited the file
{source folder of wxWidgets and
Phoenix}/Phoenix/bin/.waf3-1.7.9-16e1644c17ba46b94844133bac6e2a8c/waflib/Tools/python.py
in line 173

from this:
for name in ('python' + env['PYTHON_VERSION'], 'python' +
env['PYTHON_VERSION'].replace('.',''))

to this:
for name in ('python' + env['PYTHON_VERSION'], 'python' +
env['PYTHON_VERSION'] + 'm', 'python'+env['PYTHON_VERSION'].replace('.',''))

Note that I added an 'm' there because waf expects python3.3m-config

I hope someone could fix waf to have the aforementioned python.py file
fixed on line 173 with the added

+ env['PYTHON_VERSION'] + 'm'

Thanks. :wink:

I'm pretty sure that I remember it checking for the 'm' version before, but maybe that was dropped in 1.7. I do see on my linux system that I have links for both python3.2-config and python3.3-config without any 'd', 'm', or 'u', so perhaps there has been a standard packaging change that waf was accommodating...

In either case you should probably submit a bug report at https://code.google.com/p/waf/ and see what they say about it.

···

--
Robin Dunn
Software Craftsman

Robin, I have submitted a bug report with my patch. I hope that waf developers will take the time and apply my patch to the trunk. Here’s the bug report: https://code.google.com/p/waf/issues/detail?id=1261

Robin, I have wxWidgets and Phoenix built and if I execute the command python setup.py install in the console in the Phoenix subdir, I get this:

ERROR: WX_CONFIG not specified and wx-config not found on the $PATH

What’s your suggestion I should do?

Bo�tjan Mejak wrote:

Robin, I have wxWidgets and Phoenix built and if I execute the command
  python setup.py install in the console in the Phoenix subdir, I get
this:
ERROR: WX_CONFIG not specified and wx-config not found on the $PATH

What's your suggestion I should do?

As I mentioned a couple days ago I recommended just running it from the build folder for now. The install command is still being worked on.

···

--
Robin Dunn
Software Craftsman

Jason Giangrande wrote:

I'm built wxPython-Phoenix-r73588-src.tar.gz on Linux (x86_64) and while
it builds fine I'm getting the same error as wxGeek when I import the
module.

>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/home/jason/tmp/wxpython/wxPython-Phoenix-r73588-src/Phoenix/wx/__init__.py",
line 17, in <module>
from wx.core import *
ImportError: No module named 'wx.core'

I'm running it out of the build directory as you suggest and I have both
variables set as the post build comments suggest. Any idea what the
problem might be?

What build.py commands did you use? Phoenix/wx/core.py is in that tarball, but if you've done a "clean" command then it will have wiped it out.

···

--
Robin Dunn
Software Craftsman

It finally works! I put the “wx” folder from the “Phoenix” source folder (after the build of course) to Python 3.3’s “site-packages” folder and then copied the core.py file from the original “Phoenix” folder (the one before the build was done). I don’t even need to set the PYTHONPATH and LD_LIBRARY_PATH system variables. Cool, huh? :slight_smile:

But tell me this, Robin… Why was the core.py file wiped out? I didn’t use the “clean” command for the build.

What build.py commands did you use? Phoenix/wx/core.py is in that
tarball, but if you’ve done a “clean” command then it will have wiped it
out.

I may have run a clean at some point. I’ll extract the source again and rebuild. To do the actual build I’m running ./build.py 3.3 build

Also, I get an error when building for Python 3.3 in one of the wxWidgets build scripts (wxWidgets/build/tools/builder.py).

Traceback (most recent call last):

File “./build.py”, line 941, in build_wx

wxbuild.main(wxscript, build_options)

File “/home/jason/tmp/wxpython/wxPython-Phoenix-r73588-src/wxWidgets/build/tools/build-wxwidgets.py”, line 362, in main

exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),

File “/home/jason/tmp/wxpython/wxPython-Phoenix-r73588-src/wxWidgets/build/tools/builder.py”, line 182, in configure

optionsStr = string.join(options, " ") if options else “”

AttributeError: ‘module’ object has no attribute ‘join’

The string module no longer exists in in Python 3.3 so I replaced…

string.join(options, " ")

With…

" ".join(options)

Just a heads up. Thanks for your help.

Bo�tjan Mejak wrote:

It finally works! I put the "wx" folder from the "Phoenix" source folder
(after the build of course) to Python 3.3's "site-packages" folder and
then copied the core.py file from the original "Phoenix" folder (the one
before the build was done). I don't even need to set the PYTHONPATH and
LD_LIBRARY_PATH system variables. Cool, huh? :slight_smile:

But tell me this, Robin... Why was the core.py file wiped out? I didn't
use the "clean" command for the build.

Are you sure that you used a newer source tarball that was made after I started added those files? (They were not being included until after this change was made.

http://trac.wxwidgets.org/changeset/73584/wxPython/Phoenix/trunk

···

--
Robin Dunn
Software Craftsman