dkpro / dkpro-cassis

UIMA CAS processing library written in Python
https://pypi.org/project/dkpro-cassis/
Apache License 2.0
85 stars 22 forks source link

Bug: cassis cannot be loaded #18

Closed WeaponXiii closed 6 years ago

WeaponXiii commented 6 years ago

I have created a new virtualenv and installed casis using following commands

>>>:~/ukp/test_new_cas$ virtualenv env --python=python3.6 
Running virtualenv with interpreter /usr/bin/python3.6
Using base prefix '/usr'
New python executable in /home/weaponxiii/ukp/test_new_cas/env/bin/python3.6
Also creating executable in /home/weaponxiii/ukp/test_new_cas/env/bin/python
Installing setuptools, pip, wheel...done.

>>>:~/ukp/test_new_cas$ source env/bin/activate

(env) >>>:~/ukp/test_new_cas$ python -m pip install git+https://github.com/dkpro/dkpro-cassis
Collecting git+https://github.com/dkpro/dkpro-cassis
  Cloning https://github.com/dkpro/dkpro-cassis to /tmp/pip-req-build-a3u2ig4q
Collecting lxml (from cassis==0.0.1)
  Using cached https://files.pythonhosted.org/packages/03/a4/9eea8035fc7c7670e5eab97f34ff2ef0ddd78a491bf96df5accedb0e63f5/lxml-4.2.5-cp36-cp36m-manylinux1_x86_64.whl
Collecting attrs (from cassis==0.0.1)
  Using cached https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Collecting sortedcontainers (from cassis==0.0.1)
  Using cached https://files.pythonhosted.org/packages/be/e3/a065de5fdd5849450a8a16a52a96c8db5f498f245e7eda06cc6725d04b80/sortedcontainers-2.0.5-py2.py3-none-any.whl
Collecting toposort (from cassis==0.0.1)
  Using cached https://files.pythonhosted.org/packages/e9/8a/321cd8ea5f4a22a06e3ba30ef31ec33bea11a3443eeb1d89807640ee6ed4/toposort-1.5-py2.py3-none-any.whl
Building wheels for collected packages: cassis
  Running setup.py bdist_wheel for cassis ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-j0ltlofg/wheels/c2/d1/6c/2b0e0b6c03d1d64f9782fb6e3b174abaaed41ff3c62b2cafa5
Successfully built cassis
Installing collected packages: lxml, attrs, sortedcontainers, toposort, cassis
Successfully installed attrs-18.2.0 cassis-0.0.1 lxml-4.2.5 sortedcontainers-2.0.5 toposort-1.5

and pip show also recongizes it

(env) >>>:~/ukp/test_new_cas$ python -m pip show cassis
Name: cassis
Version: 0.0.1
Summary: UIMA CAS processing library in Python
Home-page: https://github.com/dkpro/dkpro-cassis
Author: Jan-Christoph Klie
Author-email: git@mrklie.com
License: Apache License 2.0
Location: /home/weaponxiii/ukp/test_new_cas/env/lib/python3.6/site-packages
Requires: attrs, lxml, toposort, sortedcontainers
Required-by: 

But for some reason it can not be imported

(env) >>>:~/ukp/test_new_cas$ python
Python 3.6.6 (default, Sep 12 2018, 18:26:19) 
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cassis
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cassis'
>>> import imp
>>> imp.find_module('cassis')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/weaponxiii/ukp/test_new_cas/env/lib/python3.6/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'cassis'
>>> imp.find_module('json')
(None, '/usr/lib/python3.6/json', ('', '', 5))
>>> 

I have tested the same procedure on this project to install and use other packages ( eg. h5py ) successfully but so far no luck with cassis

jcklie commented 6 years ago

I can reproduce your error, but it is really strange that it does not work. I will write here when it is fixed.

jcklie commented 6 years ago

@WeaponXiii The bug was really subtle, but it should be fixed now. Can you test it please?

WeaponXiii commented 6 years ago

Yes, it seems like working. Thanks for the quick response.