'cssselect seems not to be installed. '

933 views
Skip to first unread message

NP

unread,
Apr 15, 2013, 11:28:06 PM4/15/13
to google-a...@googlegroups.com
I'm running python 2.7 on a mac. I have lxml (3.1.1) installed. I also downloaded and installed cssselector since it no longer comes with lxml

In my python file, I have the following

import lxml.etree
from lxml.cssselect import CSSSelector

When I run the python file (F5), there are no errors and I get my expected output.

But if I launch my app from Google App Engine (on the dev server), I get an error and the log file shows the following

File "/Library/Python/2.7/site-packages/lxml/cssselect.py", line 18, in <module>
    raise ImportError('cssselect seems not to be installed. '
ImportError: cssselect seems not to be installed. See http://packages.python.org/cssselect/

I found this link http://code.google.com/p/googleappengine/issues/detail?id=9136

Anybody have a solution/work around?

timh

unread,
Apr 15, 2013, 11:32:21 PM4/15/13
to google-a...@googlegroups.com
Remember every 3rd party lib you use must either be in the SDK (lxml for instance) or copied/installed into your project and the 
sys.path needs to reflect where in your project the library is located,  it also needs to be deployed with your application.

NP

unread,
Apr 15, 2013, 11:40:48 PM4/15/13
to google-a...@googlegroups.com
my app.yaml has this

libraries:
- name: lxml
  version: "latest"

NP

unread,
Apr 16, 2013, 12:32:39 AM4/16/13
to google-a...@googlegroups.com
You're right. I copied the cssselector folder into my project directory and it resolved the issue. I had thought I didn't need to do that since the lxml folder itself had the cssselect.py file within it.


On Monday, April 15, 2013 8:32:21 PM UTC-7, timh wrote:

timh

unread,
Apr 16, 2013, 7:21:15 AM4/16/13
to google-a...@googlegroups.com
Yes you local install might but apengine runs in a sandbox

T
Reply all
Reply to author
Forward
0 new messages