Comments (18)
This doesn't reproduce with newer versions of lxml - if possible, it'd be good to test with at least 2.3.6 but it appears that simply using a newer version of Cython during compilation might be sufficient based on this compatibility fix which they made about six months ago:
http://comments.gmane.org/gmane.comp.python.cython.user/7190
cython/cython@a8f70e2
Chris
from pysolr.
lxml was built without cython. and I have same problems with lxml-2.3.6
Works well with lxml-3.0
from pysolr.
lxml 2.3 appears to ship with sources compiled using Cython 0.14. It looks like you will need to either switch to lxml 3.0 or install Cython 0.17 or later before installing lxml 2.3.x:
$ git tag --contains a8f70e2210b9a36c3b67ce5f426000c62473b62e
0.17
0.17.1
0.17.4
0.17b4
0.18
If lxml 2.x is still supported it might be worth creating an issue on lxml for an upstream release using a version of Cython which is fully compatible with Python 2.6+ and unicode_literals
.
Chris
from pysolr.
Thanks. I have found the solution (change lxml version).
from pysolr.
We just ran into this. Is lxml version xxxxxx specified as a dependency by pysolr? I.e., when pysolr installs, does it look for lxml>=3.x.y?
from pysolr.
@stugots Not by default – it's optional and only used for parsing Tomcat error messages so we don't want to install it everywhere. I updated the extras_require
stanza but you'll need to use the extras syntax to install – e.g. pip install pysolr[tomcat]==3.0.6
. See http://pythonhosted.org/distribute/setuptools.html#declaring-dependencies for more information.
from pysolr.
This seems to be back in the latest GIT revision of django-haystack... The traceback seems to indicate that the error is in lxml, but there is practically no way to do this on Ubuntu 12.10. I tried the "patch" above and this seems to work.
Traceback (most recent call last):
File "/home/patrick/spng/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/patrick/spng/lib/python2.7/site-packages/django/db/transaction.py", line 223, in inner
return func(*args, **kwargs)
File "/home/patrick/spng/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/patrick/spng/src/internship/views.py", line 248, in register_step_4
person.save()
File "/home/patrick/spng/src/person/models.py", line 128, in save
self.update_solr()
File "/home/patrick/spng/src/person/models.py", line 135, in update_solr
InternIndex().update_object(self.intern)
File "/home/patrick/spng/src/haystack/indexes.py", line 266, in update_object
self._get_backend(using).update(self, [instance])
File "/home/patrick/spng/src/haystack/backends/solr_backend.py", line 66, in update
self.conn.add(docs, commit=commit, boost=index.get_field_weights())
File "/home/patrick/spng/lib/python2.7/site-packages/pysolr.py", line 740, in add
message.append(self._build_doc(doc, boost=boost))
File "/home/patrick/spng/lib/python2.7/site-packages/pysolr.py", line 695, in _build_doc
field = ET.Element('field', **attrs)
File "lxml.etree.pyx", line 2560, in lxml.etree.Element (src/lxml/lxml.etree.c:52924)
TypeError: Element() keywords must be strings
from pysolr.
@xudonax Did you try upgrading to lxml 3? It's a clean install on Ubuntu.
from pysolr.
I couldn't update lxml in any way. apt-get update && apt-get upgrade didn't give me any upgrades. Then again, I'm still on 12.10, I guess I can wait a little while and check it out on Ubuntu 13.04 which should be released any day now.
from pysolr.
@xudonax Ubuntu won't ship an updated lxml system package but you can install lxml 3 along with everything else from PyPI inside a virtualenv – I've run it on 12.04 servers that way for awhile.
from pysolr.
I got an gcc compilation error. I'll take a look at dependencies tomorrow. So far I installed only libxml-dev AFAIK, because it couldn't find python-dev...
from pysolr.
I get the same issue. Using lxml 3.2.0 pysolr 3.0.6
from pysolr.
I was running into this issue. The following setup worked for me:
Python 2.7.4
pysolr 3.0.6
lxml 3.2.1
from pysolr.
I had this issue, but fixed it by changing to lxml 3.0.2. I'm using pysolr 3.0.6.
from pysolr.
I had the same issue.
Python 2.7.3
pysolr 3.1.0 (02e7b65)
lxml 2.3.2
It works for me after upgrading lxml 2.3.2 to 3.2.4.
from pysolr.
@toastdriven Think it's worth making our lxml check do something like issue a warning and fallback to stdlib if lxml is present but <3.x?
from pysolr.
I just ran into that issue (from 2013?). Wouldn't it be better to make pysolr require a certain lxml version in its setup.py to avoid problems like this?
from pysolr.
@tisto The problem was that people had other versions of lxml in their projects & it'd conflict for something which is only relevant to a subset of users. My preferred approach is the one from #133 (comment) where we simply drop lxml entirely since it's only used for error handling. I just wrapped that code into #149 for easier testing / commenting.
from pysolr.
Related Issues (20)
- delete() is not escaping special XML characters in its query or ID parameters. HOT 5
- Solr responded with an error (HTTP 400): [Reason: Error parsing JSON field value. Unexpected OBJECT_START at [##], field=??] HOT 1
- Support for customized Python installs which do not include setuptools HOT 6
- Add "add if not exists" functionality to pysolr HOT 1
- Error when deleting documents HOT 2
- Is there a new release for pysolr? HOT 11
- q.op doesn't work in solr.search()
- `solr.ping()` returns 404: `SolrError: Solr responded with an error (HTTP 404): [Reason: Error 404 Not Found]` HOT 7
- Installing 3.9.0 release via pip is somehow broken HOT 2
- Unknown operation for the an atomic update with pysolr-3.9.0 HOT 2
- Intermittent Connection Failure
- Unable to store custom/nested JSON docs
- How can I export (/export)?
- "Required" should be remove from Travis CI HOT 1
- Code Injection HOT 3
- Unable to retrieve results using pysolr.search() with grouping HOT 2
- AttributeError: 'int' object has no attribute 'decode' HOT 1
- commitWithin for Solr.add is ignored when JSON update API is used (when no `boost` or `fieldUpdates`) HOT 1
- DeprecationWarning from pkg_resources on Python 3.10+ HOT 2
- NaN values are not working when simplejson >= 3.19.0 is used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysolr.