python - I have lxml but still I am asked to install it -
i have lxml because checked using
`import pandas pd ` `pd.show_versions(as_json=false)`
and have lxml version 3.6.0 in "installed versions"
installed versions ------------------ commit: none python: 2.7.12.final.0 python-bits: 64 os: linux os-release: 3.19.0-64-generic machine: x86_64 processor: x86_64 byteorder: little lc_all: none lang: en_us.utf-8 pandas: 0.18.0 nose: 1.3.7 pip: 8.1.2 setuptools: 20.3 cython: 0.23.4 numpy: 1.10.4 scipy: 0.17.0 statsmodels: 0.6.1 xarray: none ipython: 4.1.2 sphinx: 1.3.5 patsy: 0.4.0 dateutil: 2.5.1 pytz: 2016.2 blosc: none bottleneck: 1.0.0 tables: 3.2.2 numexpr: 2.5 matplotlib: 1.5.1 openpyxl: 2.3.2 xlrd: 0.9.4 xlwt: 1.0.0 xlsxwriter: 0.8.4 lxml: 3.6.0 bs4: none html5lib: 0.999999999 httplib2: none apiclient: none sqlalchemy: 1.0.12 pymysql: none psycopg2: none jinja2: 2.8 boto: 2.39.0
but when tried run
table_list = pd.read_html("http://www.psmsl.org/data/obtaining/")
i massage
--------------------------------------------------------------------------- attributeerror traceback (most recent call last) <ipython-input-13-5f8ed046a27a> in <module>() 1 # needs `lxml`, `beautifulsoup4` , `html5lib` python packages 2 # local backup in data/sea_levels/obtaining tide gauge data.html ----> 3 table_list = pd.read_html("http://www.psmsl.org/data/obtaining/") /home/ola/anaconda2/lib/python2.7/site-packages/pandas/io/html.pyc in read_html(io, match, flavor, header, index_col, skiprows, attrs, parse_dates, tupleize_cols, thousands, encoding) 859 pandas.read_csv 860 """ --> 861 _importers() 862 863 # type check here. don't want parse fail because of /home/ola/anaconda2/lib/python2.7/site-packages/pandas/io/html.pyc in _importers() 40 41 try: ---> 42 import bs4 # noqa 43 _has_bs4 = true 44 except importerror: /home/ola/anaconda2/lib/python2.7/site-packages/bs4/__init__.py in <module>() 28 import warnings 29 ---> 30 .builder import builder_registry, parserrejectedmarkup 31 .dammit import unicodedammit 32 .element import ( /home/ola/anaconda2/lib/python2.7/site-packages/bs4/builder/__init__.py in <module>() 312 register_treebuilders_from(_htmlparser) 313 try: --> 314 . import _html5lib 315 register_treebuilders_from(_html5lib) 316 except importerror: /home/ola/anaconda2/lib/python2.7/site-packages/bs4/builder/_html5lib.py in <module>() 68 69 ---> 70 class treebuilderforhtml5lib(html5lib.treebuilders._base.treebuilder): 71 72 def __init__(self, soup, namespacehtmlelements): attributeerror: 'module' object has no attribute '_base'
what should ? knowing tried comand conda install -c anaconda lxml=3.6.0 , det massage
the following packages updated: conda-env: 2.5.0-py27_0 anaconda --> 2.5.2-py27_0 anaconda following packages superceded higher-priority channel: lxml: 3.6.0-py27_0 --> 3.6.0-py27_0 anaconda proceed ([y]/n)? y pruning fetched packages cache ... fetching packages ... not connect https://conda.anaconda.org/anaconda/linux-64/conda-env-2.5.2-py27_0.tar.bz2 error: connection error: httpsconnectionpool(host='conda.anaconda.org', port=443): max retries exceeded url: /anaconda/linux-64/conda-env-2.5.2-py27_0.tar.bz2 (caused newconnectionerror('<requests.packages.urllib3.connection.verifiedhttpsconnection object @ 0x7f7f6c0ac810>: failed establish new connection: [errno -2] name or service not known',)): https://conda.anaconda.org/anaconda/linux-64/conda-env-2.5.2-py27_0.tar.bz2
i see 2 problems reporting:
- you have issue internet access
anaconda.org
. try ping see if down, review connection, and/or see if service temporarily down... - i have tested on anaconda-python3.5 , canopy1.7 (python 2.7) , both, cell works
lxml 3.6
, ,html5lib 0.999
. have samelxml
seem have different version of html5lib.
your best bet update html5lib
, try , update lxml
if that's not enough, or report issue continuum if doesn't work. there might incompatibilities between 2 in package resolution. in meanwhile, try anaconda-python3.5, or canopy1.7 if want stay on python2 (see tutorial instructions).
Comments
Post a Comment