1

I am using conda virtual environment and I have intsalled the lxml module using conda install lxml. The package was successfully installed but when I open python in my terminal and do import lxml, I get the following error:

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

I don't understand what is the issue here.

My installed packages are as follows:

`# packages in environment at /users/deepayan/miniconda3/envs/pytorch:
#
hdf5                      1.8.17                        1  
jbig                      2.1                           0  
jpeg                      8d                            2  
libiconv                  1.14                          0    anaconda
libpng                    1.6.27                        0  
libtiff                   4.0.6                         2  
libxml2                   2.9.4                         0    anaconda
libxslt                   1.1.29                        0    anaconda
lxml                      3.8.0                    py36_0  
mkl                       2017.0.1                      0  
numpy                     1.12.1                   py36_0  
opencv                    3.1.0               np112py36_1  
openssl                   1.0.2l                        0  
pip                       9.0.1                    py36_1  
python                    3.6.1                         2  
readline                  6.2                           2  
setuptools                27.2.0                   py36_0  
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
wheel                     0.29.0                   py36_0  
xz                        5.2.2                         1  
zlib                      1.2.8                         3  
`

All other packages can be imported error free, the problem is only with lxml. If anyone can suggest a way out, I'd be very grateful. Thanks

7
  • Are you sure you're inside the correct virtual environment?
    – athul.sure
    Jun 23, 2017 at 8:19
  • yes @athul.sure I am pretty sure I am inside the correct environment. Jun 23, 2017 at 8:21
  • create new virtualenv then install all package again.
    – ammy
    Jun 23, 2017 at 8:44
  • then activate this virtualenv and use python shell
    – ammy
    Jun 23, 2017 at 8:45
  • okay, @ammy will try this, but do you have any idea as to why it is happening? Jun 23, 2017 at 8:49

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.