You are not logged in.
That's my question. I manually downloaded and installed libxml2 and libxslt and they are both now available on my account. I somehow managed to install lxml using easy_install but now I've reached a dead end.
Error was: /home/yohan/lib/python2.5/lxml/etree.so: undefined symbol: PyUnicodeUCS4_FromEncodedObject
So has anyone installed lxml on WebFaction before? Could anyone try it and help me out?
The installation instructions are available at: http://codespeak.net/lxml/installation.html
Offline
I found another thread which deals with this problem: http://forum.webfaction.com/viewtopic.php?id=2037
However, it's quite cumbersome and I'd really like WebFaction to install lxml globally so that we don't have to go through all this trouble to do something which should be so simple.
Offline
I did that and got no errors, but I still get the same error. It seems that I need to use a custom Python build with --enable-unicode=ucs2, which I have done, but I can't figure out how to make mod_python use that Python executable. The Django debug page always says that it's Python version 2.5.2!
So what is the right way to make mod_python use my own Python build?
Offline
skorpan wrote:
I did that and got no errors, but I still get the same error. It seems that I need to use a custom Python build with --enable-unicode=ucs2, which I have done, but I can't figure out how to make mod_python use that Python executable. The Django debug page always says that it's Python version 2.5.2!
How exactly can I reproduce the "undefined symbol: PyUnicodeUCS4_FromEncodedObject" error?
skorpan wrote:
So what is the right way to make mod_python use my own Python build?
If you want mod_python to use your own Python, then you'll need to build your own Apache from source, then build your own mod_python from source, against your custom Apache and Python installations. The steps will be very similar to those shown at http://forum.webfaction.com/viewtopic.php?id=2316 - the exceptions being a) you're building mod_python instead of mod_wsgi and b) the --with-python argument needs to point to your custom Python.
Offline
Currently, there is no way to reproduce the UCS4 problem, because I've fiddled around with the configuration a lot since then.
I tried building my own Apache, according to the instructions, but got compiler errors:
http://pastebin.com/m403db860
Offline
Since my last post I've been able to compile my custom Apache, Python 2.6.1 and mod_python 3.3.1. I'm currently writing a little HOWTO on this subject, as it's far from easy.
Offline
skorpan wrote:
Since my last post I've been able to compile my custom Apache, Python 2.6.1 and mod_python 3.3.1. I'm currently writing a little HOWTO on this subject, as it's far from easy.
If that has solved your issue, then great ![]()
If possible, I'd still like to know how to reproduce your original error "Error was: /home/yohan/lib/python2.5/lxml/etree.so: undefined symbol: PyUnicodeUCS4_FromEncodedObject".
For what it's worth, I noticed that when following the instructions I gave earlier for installing lxml, the path to etree.so is different, eg 'lib/python2.5/lxml-2.2-py2.5-linux-i686.egg/lxml/etree.so'. Since you said you had the same error after following my instructions, perhaps you needed to remove the original lxml library first.
Offline
I'm almost up and running now. I'm trying to figure out the right way to serve static files, e.g. CSS and JavaScript and such. When I'm done, if I feel like being completely generous, I'll throw together a little shell script to do exactly what I did. Then I'll write a little bit about how I configured Apache and what my file structure is.
Offline
The *best* way to serve static files is to create static-only applications in our control panel and map those apps to whatever URL paths on your website record. That way, your static files will be served by the front-end nginx server, which means less work (and less memory usage) for your private Apache instance ![]()
Offline
Yep, that works. Is there any way to make the nginx server handle the static files without having to copy my media files from my directory to the other application's directory?
Offline
skorpan wrote:
Yep, that works. Is there any way to make the nginx server handle the static files without having to copy my media files from my directory to the other application's directory?
yes - use a 'symbolic link to static-only' application, with the full path to your static file directory in the 'extra info' field.
Offline
I also have to face the same problem while downloading libxml2. I hope I can fix this problem. I want to know more about "symbolic link to static-only" application. Thanks.
Offline
Hi, you can use this process for installing the bindings:
You can install libxml2 and the lxml python bindings into your home directory with the following commands. Hope this helps! ################# mkdir -p $HOME/bin $HOME/src $HOME/lib $HOME/include $HOME/share cd $HOME/src mkdir -p $HOME/lib/$PYTHON $HOME/src/tmp cat > $HOME/.pydistutils.cfg << EOF [build_ext] include_dirs=$HOME/include library_dirs=$HOME/lib EOF export PATH=$HOME/bin:$PATH export TEMP=$HOME/src/tmp export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH export LD_INCLUDE_PATH=$HOME/include/:$HOME/include/libxml2:$HOME/include/libxml2/libxml cd $HOME/src wget ftp://xmlsoft.org/libxml2/libxml2-2.7.7.tar.gz tar -xzf libxml2-2.7.7.tar.gz cd libxml2-2.7.7 ./configure --prefix=$HOME make && make install cd $HOME/src wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz tar -xzf libxslt-1.1.26.tar.gz cd libxslt-1.1.26 ./configure --prefix=$HOME --with-libxml-prefix=$HOME make && make install easy_install-$PYTHONVER http://pypi.python.org/packages/source/l/lxml/lxml-2.2.6.tar.gz rm -rf $HOME/src/libxml2-2.7.7 rm $HOME/src/libxml2-2.7.7.tar.gz rm -rf $HOME/src/libxslt-1.1.26 rm $HOME/src/libxslt-1.1.26.tar.gz rmdir $HOME/src/tmp
What more info do you want about the "symbolic link to static-only" application?
Offline