MacBook Pro OS v10.13.2(17C88)でSpyder3を使用してPython 3.6でpandasを使用してテーブルデータを削り取ろうとしています。コードは:コンソールに示すTypeError:__init __()は、予期しないキーワード引数 'encoding'を持っています
import pandas as pd
...
url = "https://coinmarketcap.com/currencies/bitcoin/historical-data/?start=20130428&end="+time.strftime("%Y%m%d")
# CODE FAILS HERE
bitcoin_market_info = pd.read_html(url)[0]
結果:
bitcoin_market_info = pd.read_html(url)[0]
Traceback (most recent call last):
File "<ipython-input-2-0b0d269a2c9d>", line 15, in <module>
bitcoin_market_info = pd.read_html(url)[0]
File "/Users/EL-C/anaconda3/lib/python3.6/site-packages/pandas/io/html.py", line 915, in read_html
keep_default_na=keep_default_na)
File "/Users/EL-C/anaconda3/lib/python3.6/site-packages/pandas/io/html.py", line 749, in _parse
raise_with_traceback(retained)
File "/Users/EL-C/anaconda3/lib/python3.6/site-packages/pandas/compat/__init__.py", line 385, in raise_with_traceback
raise exc.with_traceback(traceback)
TypeError: __init__() got an unexpected keyword argument 'encoding'
PD。私はthis修正を試みたが、古いバージョンではなく、まさにこのような状況のためであると思われる、与えられた
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Darwin
OS-release: 17.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.21.1
pytest: 3.3.0
pip: 9.0.1
setuptools: 36.5.0.post20170921
Cython: 0.27.3
numpy: 1.13.3
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: 6.2.1
sphinx: 1.6.3
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: 1.2.1
tables: 3.4.2
numexpr: 2.6.4
feather: None
matplotlib: 2.1.1
openpyxl: 2.4.9
xlrd: 1.1.0
xlwt: 1.2.0
xlsxwriter: 1.0.2
lxml: 4.1.1
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: 1.1.13
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
:バージョンは「0.21.1」pd.show_versionsの
結果()であります私はhtml5libをインポートしていません。
必要な場合:
the html5lib。 バージョンは1.0.1
bs4です。 バージョンは4.6.0
端末で 'pip3 install -U html5lib == "0.9999999"(推奨)を実行してもSpyder3のバージョンは変更されません。
何のコマンドを実行しているとき、私は、端末に表示することです:
Requirement already up-to-date: html5lib==0.9999999 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requirement already up-to-date: six in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from html5lib==0.9999999)
多分これがルートのですか?もしそうなら、これを理解する助けが必要です。 Anaconda Python distributive (available for Linux, Windows and MacOS
をインストールする
あなたは逐語的に完全なトレースバックを投稿することができますか? –
'url2'は' url'と同じですか? –
url2はurlと同じです。それを変更してトレースを追加する質問が更新されました。 – user