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/__init__.py", line 11, in <module>
    from .pyquery import PyQuery
  File "/usr/local/lib/python2.6/dist-packages/pyquery/pyquery.py", line 6, in <module>
    from .cssselectpatch import JQueryTranslator
  File "/usr/local/lib/python2.6/dist-packages/pyquery/cssselectpatch.py", line 7, in <module>
    from cssselect import xpath as cssselect_xpath
  File "cssselect.py", 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.
kiptip
 
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 etree.py? If so, removing it will fix the problem.

If not, I'd like to see the first 30 lines of cssselect.py.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1443
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 0 guests