WattTime / pyiso

Python client libraries for ISO and other power grid data sources.
http://pyiso.readthedocs.org/
Other
237 stars 110 forks source link

html5lib version issue #89

Closed danaas18 closed 7 years ago

danaas18 commented 7 years ago

In attempting to use pyiso to get CAISO data, I receive the error below. Using Python 3.5 on ubuntu. It appears that _base.py should now be just base.py

https://groups.google.com/forum/#!topic/beautifulsoup/JO_9ufJB4UM

`--------------------------------------------------------------------------- AttributeError Traceback (most recent call last)

in () ----> 1 caiso = client_factory('CAISO') /home/dan/anaconda3/lib/python3.5/site-packages/pyiso/**init**.py in client_factory(client_name, **kwargs) 67 # load 68 try: ---> 69 mod = imp.load_module(module_name, fp, pathname, description) 70 finally: 71 # Since we may exit via an exception, close fp explicitly. /home/dan/anaconda3/lib/python3.5/imp.py in load_module(name, file, filename, details) 232 raise ValueError(msg) 233 elif type_ == PY_SOURCE: --> 234 return load_source(name, filename, file) 235 elif type_ == PY_COMPILED: 236 return load_compiled(name, filename, file) /home/dan/anaconda3/lib/python3.5/imp.py in load_source(name, pathname, file) 170 module = _exec(spec, sys.modules[name]) 171 else: --> 172 module = _load(spec) 173 # To allow reloading to potentially work, use a non-hacked loader which 174 # won't rely on a now-closed file object. /home/dan/anaconda3/lib/python3.5/importlib/_bootstrap.py in _load(spec) /home/dan/anaconda3/lib/python3.5/importlib/_bootstrap.py in _load_unlocked(spec) /home/dan/anaconda3/lib/python3.5/importlib/_bootstrap_external.py in exec_module(self, module) /home/dan/anaconda3/lib/python3.5/importlib/_bootstrap.py in _call_with_frames_removed(f, _args, *_kwds) /home/dan/anaconda3/lib/python3.5/site-packages/pyiso/caiso.py in () 4 import copy 5 import re ----> 6 from bs4 import BeautifulSoup 7 from io import BytesIO, StringIO 8 import pandas as pd /home/dan/anaconda3/lib/python3.5/site-packages/bs4/**init**.py in () 28 import warnings 29 ---> 30 from .builder import builder_registry, ParserRejectedMarkup 31 from .dammit import UnicodeDammit 32 from .element import ( /home/dan/anaconda3/lib/python3.5/site-packages/bs4/builder/**init**.py in () 312 register_treebuilders_from(_htmlparser) 313 try: --> 314 from . import _html5lib 315 register_treebuilders_from(_html5lib) 316 except ImportError: /home/dan/anaconda3/lib/python3.5/site-packages/bs4/builder/_html5lib.py in () 68 69 ---> 70 class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder): 71 72 def __init__(self, soup, namespaceHTMLElements): AttributeError: module 'html5lib.treebuilders' has no attribute '_base' `
aschn commented 7 years ago

Nice catch! Does the branch in PR #88 fix the problem for you?

aschn commented 7 years ago

That PR is now merged and available on pypi as version 0.3.9. Is that helping your situation?

danaas18 commented 7 years ago

It did. Thanks!

MadDenker commented 7 years ago

Very interesting, I had a similar issue with spyder and Ipython recently. BeautifulSoup caused a lot of trouble with this dependency issue!

https://github.com/spyder-ide/spyder/issues/3287#issuecomment-233743764