I downloaded the source of lxml.
then unpacked it
typed "python setup.py install".
==> everything went fine.
but now typing :
import lxml
i get:
Traceback (most recent call last):
File "lxml.py", line 1, in
from lxml import etree
File "/Soft/fox_dev/dev/ut1u3h/dev/lxml.py", line 1, in
from lxml import etree
ImportError: cannot import name etree
Before you offer me any solution, I must tell you, our sys admins and network admins are control/Sercurity freaks.
I am not root
I cannot reach any url outside the company ( from the server on which i'm trying to install lxml on )
for example I tried to install pip:
>> python get-pip.py
Downloading/unpacking pip
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /Home/ut1u3h/.pip/pip.log
I have a windows machine which can reach the web. Then I can transfer files from it to the linux server via sftp.
Any idea/solution ?
EDIT
first :
make inplace
python setup.py install
now if depending on the path on which I open the python interpreter, either it works or I get the above error. I've added the source too the pythonpath... but it does not chang anything !
EDIT2: solution
Please don't hurt me... the final solution: do not put a file named lxml.py in the directory from which you are trying to import lxml... rather name your test lxml_test.py !!!!
解决方案
probably you change the default python version python2.7 to other like python3.6, as we all known that some modules are different between the two versions, and some modules work bad with python3+, so you can reset your python version to 2.7
if you are using ubuntu, you can do as follows:
$ rm /usr/bin/python
$ ln -s /usr/bin/python2.7 /usr/bin/python