Notebook: Jupyter notebook can't find lxml for BeautifulSoup

Created on 18 May 2018  路  4Comments  路  Source: jupyter/notebook

I hava installed lxml from Jupyter - 'Kernel' - 'Conda Packages',
but when I coding in Jupyter Notebook, it's print 'FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?'

11

But, when I coding it though the same environment in the server shell, it correct.

222

333

Really don't konw why, very puzzling ... Could anyone help me,please

Most helpful comment

conda install -c anaconda lxml

All 4 comments

nobody..............

It sounds like you're trying an import in two different installations of Python, or two different environments. Check sys.executable to see which Python and environment you're running in, and sys.path to see where it looks to import modules.

Python packages must be installed separately for each copy of Python you use, and if you are using virtualenvs or conda envs, packages must be installed into each environment where you need them. Either the package is not installed in one, or a different version of the package is installed.

To install packages to a particular Python installation or environment using pip, you can run it like this:

path/to/python -m pip install ...
# Replace path/to/python with the path of the Python executable (sys.executable)

If you are using conda environments, you can install packages from conda like this:

source activate myenv  # On Windows, just 'activate myenv' (no 'source')
conda install ...

For more detail, see this blog post.

[ This is a saved reply because I answer similar questions often - sorry if it doesn't exactly fit your case ]

Can probably be closed 馃槈

conda install -c anaconda lxml

Was this page helpful?
0 / 5 - 0 ratings