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

Error Initializing Talon #81

Closed
chipallen2 opened this issue Mar 10, 2016 · 1 comment
Closed

Error Initializing Talon #81

chipallen2 opened this issue Mar 10, 2016 · 1 comment

Comments

@chipallen2
Copy link

I installed talon using PIP on python 2.7. I'm trying to run the example but I get an error as soon as talon.init() is called. I can't figure out what parser it is colliding with - any ideas what is wrong? I didn't receive any error installing talon with pip.

Here's the code, error, and the other files I see on my system called parser.py.

Parser.py files:

vagrant@vagrant-ubuntu-trusty-64:/$ sudo find . -name "parser.py"
./usr/lib/python3.4/html/parser.py
./usr/lib/python3.4/email/parser.py
./usr/lib/python2.7/email/parser.py
./usr/lib/python2.7/dist-packages/jinja2/parser.py
./usr/lib/python2.7/dist-packages/yaml/parser.py
./usr/lib/python2.7/dist-packages/dateutil/parser.py
./usr/lib/python3/dist-packages/ufw/parser.py
./usr/local/lib/python2.7/dist-packages/cssselect/parser.py

Code:

import talon
from talon import quotations

talon.init()

text =  """Reply

-----Original Message-----

Quote"""

reply = quotations.extract_from(text, 'text/plain')
reply = quotations.extract_from_plain(text)
Print(reply)

Error

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    talon.init()
  File "/usr/local/lib/python2.7/dist-packages/talon/__init__.py", line 7, in init
    signature.initialize()
  File "/usr/local/lib/python2.7/dist-packages/talon/signature/__init__.py", line 38, in initialize
    EXTRACTOR_DATA)
  File "/usr/local/lib/python2.7/dist-packages/talon/signature/learning/classifier.py", line 31, in load
    return joblib.load(saved_classifier_filename)
  File "/usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/numpy_pickle.py", line 425, in load
    obj = unpickler.load()
  File "/usr/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/numpy_pickle.py", line 291, in load_build
    array = nd_array_wrapper.read(self)
  File "/usr/local/lib/python2.7/dist-packages/sklearn/externals/joblib/numpy_pickle.py", line 113, in read
    mmap_mode=unpickler.mmap_mode)
  File "/usr/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 394, in load
    return format.read_array(fid)
  File "/usr/lib/python2.7/dist-packages/numpy/lib/format.py", line 437, in read_array
    shape, fortran_order, dtype = read_array_header_1_0(fp)
  File "/usr/lib/python2.7/dist-packages/numpy/lib/format.py", line 334, in read_array_header_1_0
    d = safe_eval(header)
  File "/usr/lib/python2.7/dist-packages/numpy/lib/utils.py", line 1128, in safe_eval
    ast = compiler.parse(source, mode="eval")
  File "/usr/lib/python2.7/compiler/transformer.py", line 53, in parse
    return Transformer().parseexpr(buf)
  File "/usr/lib/python2.7/compiler/transformer.py", line 132, in parseexpr
    return self.transform(parser.expr(text))
AttributeError: 'module' object has no attribute 'expr'
@chipallen2
Copy link
Author

I think I found the culprit for anyone else having this trouble. I had installed a few of the packages using PIP instead of using ubuntu's apt-get. So when I re-installed lxml like this it started working.

sudo apt-get install -y python-lxml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant