help installing pyquery

A forum for general discussion of the Python programming language.

help installing pyquery

Postby kiptip » Mon Oct 28, 2013 10:01 pm

Hi, I'm using XFCE and have used pip to install pyquery. However when I import pyquery I get the following response.
Code: Select all
>>> import pyquery

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import pyquery
  File "/usr/local/lib/python2.6/dist-packages/pyquery/", line 11, in <module>
    from .pyquery import PyQuery
  File "/usr/local/lib/python2.6/dist-packages/pyquery/", line 6, in <module>
    from .cssselectpatch import JQueryTranslator
  File "/usr/local/lib/python2.6/dist-packages/pyquery/", line 7, in <module>
    from cssselect import xpath as cssselect_xpath
  File "", line 24, in <module>
    class CSSSelector(etree.XPath):
AttributeError: 'module' object has no attribute 'XPath'

I've tried removing pyquery, lxml, cssselect etc, then re-installing them to not avail
Last edited by micseydel on Mon Oct 28, 2013 10:15 pm, edited 1 time in total.
Reason: Code tags, locked OP.
Posts: 1
Joined: Mon Oct 28, 2013 9:56 pm

Re: help installing pyquery

Postby micseydel » Mon Oct 28, 2013 10:20 pm

Do you have your own local file called If so, removing it will fix the problem.

If not, I'd like to see the first 30 lines of
Join the #python-forum IRC channel on for off-topic chat!

Please prefer not to PM members. The point of the forum is so that anyone can benefit. We don't want to help you over PMs/emails/Skype chats that others can't benefit from :)
User avatar
Posts: 2904
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 4 guests