ich lxml habe, weil ich esIch habe lxml aber noch bin ich gebeten, es zu installieren
mit geprüft`import pandas as pd `
`pd.show_versions(as_json=False)`
und ich habe lxml Version 3.6.0, die in diesen „installierten Versionen“ ist
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
aber als ich versuchte,
table_list = pd.read_html("http://www.psmsl.org/data/obtaining/")
ich erhalte diese Massage
012.351 zu laufen ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-13-5f8ed046a27a> in <module>()
1 # Needs `lxml`, `beautifulSoup4` and `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. We don't want to parse only to fail because of an
/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 from .builder import builder_registry, ParserRejectedMarkup
31 from .dammit import UnicodeDammit
32 from .element import (
/home/ola/anaconda2/lib/python2.7/site-packages/bs4/builder/__init__.py in <module>()
312 register_treebuilders_from(_htmlparser)
313 try:
--> 314 from . 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'
was soll ich tun? wohl wissend, dass ich diese comand versucht Conda installieren -c anaconda lxml = 3.6.0 und ich diese Massage
The following packages will be UPDATED:
conda-env: 2.5.0-py27_0 anaconda --> 2.5.2-py27_0 anaconda
The following packages will be SUPERCEDED by a higher-priority channel:
lxml: 3.6.0-py27_0 --> 3.6.0-py27_0 anaconda
Proceed ([y]/n)? y
Pruning fetched packages from the cache ...
Fetching packages ...
Could not connect to 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 with url: /anaconda/linux-64/conda-env-2.5.2-py27_0.tar.bz2 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7f6c0ac810>: Failed to establish a 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
Beim Import von BeautifulSoup scheint der Import fehlgeschlagen zu sein. Hast du das installiert? – Wombatz