This forum is now just an archive. Use the new Q&A website
It is currently Wed Apr 23, 2014 6:56 pm

All times are UTC + 2 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 39 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 08, 2012 8:13 am 
Offline

Joined: Mon Feb 06, 2012 4:37 pm
Posts: 19
Location: Iasi Romania
I use the instruction from the link above topic22108.html

./openererver.py -s --stop-after-init -c /home/openerp/openerp-server.cfg


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 08, 2012 10:55 am 
Offline

Joined: Tue Oct 18, 2011 8:52 am
Posts: 19
Location: Algiers
That's not the right way to start it. If you followed the installation procedure you mentionned, you should have copied an init script in /etc/init.d/. You should start it using one of (as root) :

Code:
service openerp-server


or

Code:
/etc/init.d/openerp-server start


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 08, 2012 1:31 pm 
Offline

Joined: Mon Feb 06, 2012 4:37 pm
Posts: 19
Location: Iasi Romania
I allreay tried that

Code:
service openerp-server start                                  Starting openerp-server: failed.



I guess this is because of the error


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 08, 2012 4:35 pm 
Offline

Joined: Tue Oct 18, 2011 8:52 am
Posts: 19
Location: Algiers
There's something broken in your installation. As I said earlier, you must locate where lxml has been installed (python2.5, python2.6, python2.7 ?) and launch openerp with that version of python.

For example, of you think that lxml has been installed for python2.5, and that python2.5 is in your PATH, try to launch the server this way :

Code:
python2.5 openererver.py -c /home/openerp/openerp-server.cfg


If that doesen't work, locate where lxml is installed. For example, try one of :

Code:
find /usr/lib/ -name "*lxml*"

Code:
find /usr/local/lib/ -name "*lxml*"

Code:
find /opt/ -name "*lxml*"


If you installed it via a virtual environement (via vitrualenv), you should look inside your virtualenvironement, maybe somewhere in /home/openerp/

Code:
find /home/openerp/ -name "*lxml*"


It is also possible that the python version you are using is also installed in the virutalenv,

Code:
find /home/openerp/ -name "python*"


Good luck !


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Fri Feb 10, 2012 10:12 am 
Offline

Joined: Mon Feb 06, 2012 4:37 pm
Posts: 19
Location: Iasi Romania
Thanks.

I did a

Code:
pip freeze


and no packages where installed on virtualenv

so I check that folder and put

Code:
ln -s /opt/python-2.6/lib/python2.6 /home/openerp/virtualenv/python2.6/lib/python2.6


and no more LXML error


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Sun Feb 12, 2012 8:19 am 
Offline

Joined: Sat Feb 11, 2012 11:41 am
Posts: 1
Location: Egypt
zipicip wrote:
I use the instruction from the link above topic22108.html

./openererver.py -s --stop-after-init -c /home/openerp/openerp-server.cfg


me too but I still have the problem .. and I read all the post but to be honest the more I read the more I get confused
-----------------------------------------------
My Egypt News Blog


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Sun Feb 12, 2012 10:38 am 
Offline

Joined: Tue Oct 18, 2011 8:52 am
Posts: 19
Location: Algiers
Hello Muhammad,

Do you have an error on lxml or on something else ?

Can you paste the error ? (the whole traceback so that we can figure out what directories are involved).


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 29, 2012 4:25 pm 
Offline

Joined: Wed Feb 29, 2012 4:20 pm
Posts: 20
Location: Maroc
PLZ can sombody help me, I have the same problem

[openerp@localhost init.d]$ openerp-server start
Traceback (most recent call last):
File "./openerp-server.py", line 58, in <module>
import netsvc
File "/usr/lib/python2.6/site-packages/openerp-server/netsvc.py", line 292, in <module>
import tools
File "/usr/lib/python2.6/site-packages/openerp-server/tools/__init__.py", line 25, in <module>
from misc import *
File "/usr/lib/python2.6/site-packages/openerp-server/tools/misc.py", line 47, in <module>
from lxml import etree
ImportError: No module named lxml


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 29, 2012 4:46 pm 
Offline

Joined: Tue Oct 18, 2011 8:52 am
Posts: 19
Location: Algiers
Hello Khalidoss,

Did you install lxml on your system ? if the answer is yes, how did you install it : python setup.py install, easy_install/pip, your distribution's package (preferred way), or another method ?

Do you have python 2.7 on your system ? if the answer is yes, then it could be that if you installed lxml it went to the python 2.7 installation folder, not python 2.6.

You can try the following to know where lxml was installed :

run the python2.7 interpreter and type

Code:
>>> import lxml


at the python prompt. If you have no errors, lxml is installed for python2.7. If not, it's not installed for this version of python.

run the python2.6 interpreter and type

Code:
>>> import lxml


If you have no errors, then lxml is installed for python2.6. If not, then it's not installed for this version of python.

Do you have a virtualenvironement ? maybe lxml is installed there.


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 29, 2012 5:09 pm 
Offline

Joined: Wed Feb 29, 2012 4:20 pm
Posts: 20
Location: Maroc
# Install lxml:

yum install libxml2
yum install libxml2-devel

wget ftp://xmlsoft.org/libxml2/libxml2-sources-2.7.8.tar.gz
Thank you
I use this method for installing lxm

tar xvf libxml2-sources-2.7.8.tar.gz
cd ... to the created directory
./configure --with-python=/usr/bin/python26
make
make install

wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
tar xvf ...
cd ...
./configure --with-python=/usr/bin/python26
make
make install

wget http://pypi.python.org/packages/source/ ... 2.8.tar.gz

Do the same unpacking etc. for libxml2-devel if needs be.

I do import lxml
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named lxml

Finnaly I use Centos in VMware


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 29, 2012 5:35 pm 
Offline

Joined: Wed Feb 29, 2012 4:20 pm
Posts: 20
Location: Maroc
Hi
Thank you

# Install lxml:

yum install libxml2
yum install libxml2-devel

wget ftp://xmlsoft.org/libxml2/libxml2-sources-2.7.8.tar.gz
Thank you
I use this method for installing lxm

tar xvf libxml2-sources-2.7.8.tar.gz
cd ... to the created directory
./configure --with-python=/usr/bin/python26
make
make install

wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
tar xvf ...
cd ...
./configure --with-python=/usr/bin/python26
make
make install

wget http://pypi.python.org/packages/source/ ... 2.8.tar.gz

Do the same unpacking etc. for libxml2-devel if needs be.

I do import lxml
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named lxml

Finnaly I use Centos in VMware


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 29, 2012 6:09 pm 
Offline

Joined: Tue Oct 18, 2011 8:52 am
Posts: 19
Location: Algiers
You installed it in so many different ways ! I'm not sure this is the best thing to do :). You ought to choose between one of those methods instead.

Code:
yum install python-lxml


Should have done the trick.

Please try it (as root), and then check if lxml is present in /usr/lib/python2.6/site-packages/

If not, see if it have instlled it in /usr/lib/python2.7/site-packages/.

Also, please check what's the default python version in your system. Just type

Code:
# python -V


at the command line and tell us what version of python you have.


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 29, 2012 6:20 pm 
Offline

Joined: Wed Feb 29, 2012 4:20 pm
Posts: 20
Location: Maroc
I install python-lxml, and I try to start openerp-server bu the same probleme

What I find in
[root@localhost init.d]# cd /usr/lib/python2.6/site-packages/
[root@localhost site-packages]# ls
drv_libxml2.py libxml2.pyc openerp_server-6.0.3-py2.6.egg-info
easy-install.pth libxsltmod.a README
libxml2mod.a libxsltmod.la setuptools-0.6c11-py2.6.egg
libxml2mod.la libxsltmod.so setuptools.pth
libxml2mod.so libxslt.py
libxml2.py openerp-server

I have Python 2.6


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 29, 2012 7:16 pm 
Offline

Joined: Tue Oct 18, 2011 8:52 am
Posts: 19
Location: Algiers
There's no reason that python can't import lxml if it's present in /usr/lib/python2.6/site-packages/, unless you installed python from source also.

Please paste the result of the following command

Code:
which python2.6


If you installed python from the source, there are changes that it is installed somewhere in /usr/local/lib and that it seeks for lxml there.

Otherwise, your installation is messed up :)


Top
 Profile  
 
 Post subject: Re: No module named lxml
PostPosted: Wed Feb 29, 2012 7:18 pm 
Offline

Joined: Wed Feb 29, 2012 4:20 pm
Posts: 20
Location: Maroc
which python2.6

/usr/local/bin/python2.6


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 39 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP