Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in pulling PJM forecast #104

Open
MadDenker opened this issue Feb 2, 2017 · 3 comments
Open

Error in pulling PJM forecast #104

MadDenker opened this issue Feb 2, 2017 · 3 comments

Comments

@MadDenker
Copy link

I received the following error(s) when trying to pull PJM forecasts:

In [78]: pjm1.get_load(latest=True, forecast=True)
C:\Anaconda\lib\site-packages\requests\packages\urllib3\connectionpool.py:838: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
Traceback (most recent call last):

  File "<ipython-input-78-e344816073a0>", line 1, in <module>
    pjm1.get_load(latest=True, forecast=True)

  File "C:\Anaconda\lib\site-packages\pyiso\pjm.py", line 151, in get_load
    df = self.fetch_edata_series('ForecastedLoadHistory', {'name': 'PJM RTO Total'})

  File "C:\Anaconda\lib\site-packages\pyiso\pjm.py", line 86, in fetch_edata_series
    dfs = pd.read_html(response.content, header=0, index_col=0)

  File "C:\Anaconda\lib\site-packages\pandas\io\html.py", line 896, in read_html
    keep_default_na=keep_default_na)

  File "C:\Anaconda\lib\site-packages\pandas\io\html.py", line 733, in _parse
    raise_with_traceback(retained)

  File "C:\Anaconda\lib\site-packages\pandas\io\html.py", line 727, in _parse
    tables = p.parse_tables()

  File "C:\Anaconda\lib\site-packages\pandas\io\html.py", line 196, in parse_tables
    tables = self._parse_tables(self._build_doc(), self.match, self.attrs)

  File "C:\Anaconda\lib\site-packages\pandas\io\html.py", line 451, in _build_doc
    from_encoding=self.encoding)

  File "C:\Anaconda\lib\site-packages\bs4\__init__.py", line 228, in __init__
    self._feed()

  File "C:\Anaconda\lib\site-packages\bs4\__init__.py", line 289, in _feed
    self.builder.feed(self.markup)

  File "C:\Anaconda\lib\site-packages\bs4\builder\_html5lib.py", line 68, in feed
    doc = parser.parse(markup, **extra_kwargs)

  File "C:\Anaconda\lib\site-packages\html5lib\html5parser.py", line 235, in parse
    self._parse(stream, False, None, *args, **kwargs)

  File "C:\Anaconda\lib\site-packages\html5lib\html5parser.py", line 85, in _parse
    self.tokenizer = _tokenizer.HTMLTokenizer(stream, parser=self, **kwargs)

  File "C:\Anaconda\lib\site-packages\html5lib\_tokenizer.py", line 36, in __init__
    self.stream = HTMLInputStream(stream, **kwargs)

  File "C:\Anaconda\lib\site-packages\html5lib\_inputstream.py", line 151, in HTMLInputStream
    return HTMLBinaryInputStream(source, **kwargs)

TypeError: __init__() got an unexpected keyword argument 'encoding'

It looks like our old friend bs4 and html5lib that pandas.io is using again...

Lucas

@MadDenker
Copy link
Author

I'm trying this:

Pandas read_html
Running Python 3.4 on a mac
New pyvenv
pip install pandas
pip install lxml
pip install html5lib
pip install BeautifulSoup4
Then ran your example....

@MadDenker
Copy link
Author

Actually, after restarting my kernel, that fixed it!

Can someone update the dependencies on the package?

@marcparewatttime
Copy link
Contributor

Thanks, Lucas. I'll take a look at this sometime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants