WebFaction
Community site: login faq

I've read the other questions here about problems installing lxml, but the solutions aren't working for me. The problem is that I can't import etree: [

tiarno@web49 work]$ python
Python 2.7.5 (default, May 16 2013, 21:14:13)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/tiarno/lib/python2.7/lxml-3.4.0-py2.7-linux-i686.egg/lxml/etree.so: undefined symbol: clock_gettime

Here is what I did.

export TEMP=/home/tiarno/work
CFLAGS="$CFLAGS -lgcrypt -fPIC" STATIC_DEPS=true easy_install-2.7 lxml

The install of the libxml2 and libxslt seemed to go fine. All the installation did -- there were no errors reported anyway. Any ideas on what I need to do?

thanks, --Tim

asked 21 Sep '14, 17:34

tiarno
1113
accept rate: 0%


Did you build the latest versions? Did you build stable or trunk versions?

The error is related to how the code is written, this is shown in a stack overflow article which explains how to fix it, if it is happening in code you did not write you should check with the developers to see why or if there is a version which does not have the issue.

permanent link

answered 21 Sep '14, 21:46

johns
5.4k312
accept rate: 23%

hi, thanks. I installed the latest stable version (lxml-3.4.0.tar.gz). I have already tried adding -lrt to my CFLAGS, but that had no effect; maybe I need to edit the Makefile to get it the correct position (according to the StackOverflow answer). I will try that and then try a lower version of lxml.

However, lxml is extensively tested, and it looks like other users on webfaction (using a different host) have had no problems since the libxml2 and libxslt libraries were already installed. Mine is web49.

thanks, --Tim

(21 Sep '14, 21:55) tiarno

manually adding -lrt inside the makefile results in much the same but not identical results. The build goes fine, no errors, but

[tiarno@web49 lxml-3.4.0]$ python
Python 2.7.5 (default, May 16 2013, 21:14:13)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/tiarno/lib/python2.7/lxml-3.4.0-py2.7-linux-i686.egg/lxml/etree.so:  undefined symbol: gcry_check_version

so the error is different. I'm thinking this is a problem with the machine's installed libs. Should this be a ticket instead of a thread here?

(21 Sep '14, 22:27) tiarno

I did get this to work finally. And then realized I needed to install it so my web app can use it. So after I got it working the first time, I uninstalled from my root lib, and gave the following command in my app root directory.

CFLAGS="$CFLAGS -lgcrypt -fPIC -lrt" TEMP=/home/tiarno/work STATIC_DEPS=true pip install --install-option="--install-scripts=$PWD/bin" --install-option="--install-lib=$PWD/lib/python2.7" lxml
permanent link

answered 04 Oct '14, 19:47

tiarno
1113
accept rate: 0%

Hi, can you please provide more details on how you got this to work?

I tried running CFLAGS="$CFLAGS -lgcrypt -fPIC -lrt" TEMP=/home/magicrebirth/tmp STATIC_DEPS=true easy_install-2.7 lxml but now get another error on importing etree:

ImportError: /home/magicrebirth/lib/python2.7/lxml-3.4.2-py2.7-linux-i686.egg/lxml/etree.so: undefined symbol: libiconv

(28 Feb '15, 11:56) mike

Hi Mike, Sorry I do not know anything other than what worked for me, but I do see this question and answer which is almost the same as yours: https://community.webfaction.com/questions/3859/problem-installing-lxml-etree

--Tim

permanent link

answered 28 Feb '15, 19:00

tiarno
1113
accept rate: 0%

Thanks anyways.

(01 Mar '15, 11:46) mike
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×9

question asked: 21 Sep '14, 17:34

question was seen: 4,612 times

last updated: 01 Mar '15, 11:46

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM