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

ImportError: cannot import name viewkeys #336

Closed
madelinezec opened this issue Apr 27, 2017 · 7 comments
Closed

ImportError: cannot import name viewkeys #336

madelinezec opened this issue Apr 27, 2017 · 7 comments
Milestone

Comments

@madelinezec
Copy link

@madelinezec madelinezec commented Apr 27, 2017

I have python code that uses mechanize to login to a website. With six==1.4.1 and six==1.10.0, I get this error:

Traceback (most recent call last):
  File "scrapeRecipe.py", line 31, in <module>
    br.select_form(name="aspnetForm")
  File "/Library/Python/2.7/site-packages/mechanize/_mechanize.py", line 619, in select_form
    global_form = self._factory.global_form
  File "/Library/Python/2.7/site-packages/mechanize/_html.py", line 260, in global_form
    self.forms()
  File "/Library/Python/2.7/site-packages/mechanize/_html.py", line 267, in forms
    self._current_forms, self._current_global_form = self._get_forms()
  File "/Library/Python/2.7/site-packages/mechanize/_html.py", line 282, in _get_forms
    if self.root is None:
  File "/Library/Python/2.7/site-packages/mechanize/_html.py", line 247, in root
    response, verify=False))
  File "/Library/Python/2.7/site-packages/mechanize/_html.py", line 145, in content_parser
    from html5lib import parse
  File "/Library/Python/2.7/site-packages/html5lib/__init__.py", line 16, in <module>
    from .html5parser import HTMLParser, parse, parseFragment
  File "/Library/Python/2.7/site-packages/html5lib/html5parser.py", line 2, in <module>
    from six import with_metaclass, viewkeys, PY3
ImportError: cannot import name viewkeys

This appears to similar to this post, except changing the version of six package didn't fix anything.

@jakearchibald
Copy link

@jakearchibald jakearchibald commented Jun 1, 2017

I'm also getting this error when trying to run Bikeshed

@jakearchibald
Copy link

@jakearchibald jakearchibald commented Jun 1, 2017

I "fixed" it by doing

sudo pip install --ignore-installed six
@yellowdoge
Copy link

@yellowdoge yellowdoge commented Jun 7, 2017

I got the same problem and the same solution, thanks @jakearchibald ! (+@tabatkins FYI)

@Martin-Pitt
Copy link

@Martin-Pitt Martin-Pitt commented Aug 14, 2017

Thanks @jakearchibald. I had the same problem but when installing Bikeshed for the first time on OSX. Seems to be working now with your solution.

@tabatkins
Copy link

@tabatkins tabatkins commented Aug 14, 2017

@willkg willkg added this to the 1.0 milestone Oct 3, 2017
@Chronial
Copy link

@Chronial Chronial commented Nov 10, 2017

This should already be fixed and is basically a duplicate of #301.

@willkg
Copy link
Contributor

@willkg willkg commented Nov 10, 2017

@Chronial Awesome--thanks!

@willkg willkg closed this Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.