cltk / cltk

The Classical Language Toolkit
http://cltk.org
MIT License
832 stars 329 forks source link

Error importing CLTK NLP #1035

Closed Pika78 closed 3 years ago

Pika78 commented 3 years ago

Hello, I encounter the following situation

Issue While running this code from cltk import NLP from cltk.languages.example_texts import get_example_text

I get the following error :

ImportError Traceback (most recent call last)

in ----> 1 from cltk import NLP 2 from cltk.languages.example_texts import get_example_text ImportError: cannot import name 'NLP' from 'cltk' (/Users/my-name/venv/lib/python3.7/site-packages/cltk/__init__.py) **Desktop :** - OS and version: MacOS 10.15.7 - Python 3.7 Any suggestion as to what I should do ? Many thanks
kylepjohnson commented 3 years ago

Tell me about how you installed the code?

Pika78 commented 3 years ago

Pip install CLTK in venv/python 3.7

Le 2 déc. 2020 à 18:40, Kyle P. Johnson notifications@github.com a écrit :

Tell me about how you installed the code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cltk/cltk/issues/1035#issuecomment-737386198, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPJTNACYAPEWRNMTCCJYODSSZ3Z3ANCNFSM4UKF42KQ.

Pika78 commented 3 years ago

The full lines:

(venv) philippeguillet@Air-de-Philippe ~ % pip install cltk Requirement already satisfied: cltk in ./venv/lib/python3.7/site-packages (0.1.121) Requirement already satisfied: nltk in ./venv/lib/python3.7/site-packages (from cltk) (3.5) Requirement already satisfied: python-crfsuite in ./venv/lib/python3.7/site-packages (from cltk) (0.9.7) Requirement already satisfied: pyyaml in ./venv/lib/python3.7/site-packages (from cltk) (5.1b3) Requirement already satisfied: gitpython in ./venv/lib/python3.7/site-packages (from cltk) (3.1.11) Requirement already satisfied: regex in ./venv/lib/python3.7/site-packages (from cltk) (2020.11.13) Requirement already satisfied: whoosh in ./venv/lib/python3.7/site-packages (from cltk) (2.7.4) Requirement already satisfied: pyuca in ./venv/lib/python3.7/site-packages (from cltk) (1.2) Requirement already satisfied: gitdb<5,>=4.0.1 in ./venv/lib/python3.7/site-packages (from gitpython->cltk) (4.0.5) Requirement already satisfied: smmap<4,>=3.0.1 in ./venv/lib/python3.7/site-packages (from gitdb<5,>=4.0.1->gitpython->cltk) (3.0.4) Requirement already satisfied: click in ./venv/lib/python3.7/site-packages (from nltk->cltk) (7.1.2) Requirement already satisfied: joblib in ./venv/lib/python3.7/site-packages (from nltk->cltk) (0.17.0) Requirement already satisfied: regex in ./venv/lib/python3.7/site-packages (from cltk) (2020.11.13) Requirement already satisfied: tqdm in ./venv/lib/python3.7/site-packages (from nltk->cltk) (4.54.0) (venv) philippeguillet@Air-de-Philippe ~ % python Python 3.7.8 (v3.7.8:4b47a5b6ba, Jun 27 2020, 04:47:50) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.

from cltk import NLP Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'NLP' from 'cltk' (/Users/philippeguillet/venv/lib/python3.7/site-packages/cltk/init.py) quit()

Le 2 déc. 2020 à 18:42, Philippe Guillet guillet.philippe@gmail.com a écrit :

Pip install CLTK in venv/python 3.7

Le 2 déc. 2020 à 18:40, Kyle P. Johnson <notifications@github.com mailto:notifications@github.com> a écrit :

Tell me about how you installed the code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cltk/cltk/issues/1035#issuecomment-737386198, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPJTNACYAPEWRNMTCCJYODSSZ3Z3ANCNFSM4UKF42KQ.

kylepjohnson commented 3 years ago

What instructions did you follow? We have 2 releases available through pip right now: https://dev.cltk.org/en/latest/installation.html

The "pre" is for our upcoming version (1.0) and the default for the stable (0.1). The API example you gave here (from cltk import NLP) is actually for our pre-release v. 1.0.

It's a bit confusing, I admit.

Could you tell me your goal? Are you looking to use the stable system or test the new one?

kylepjohnson commented 3 years ago

(venv) philippeguillet@Air-de-Philippe ~ % pip install cltk

Great. This is the stable version and all the docs are here: https://docs.cltk.org/en/latest/

Again, let me know what you are trying to do and I can try to help!

Pika78 commented 3 years ago

I am trying to use the stable version to tokenize and lemmatize Medieval Latin texts

Le 2 déc. 2020 à 18:47, Kyle P. Johnson notifications@github.com a écrit :

(venv) philippeguillet@Air-de-Philippe ~ % pip install cltk

Great. This is the stable version and all the docs are here: https://docs.cltk.org/en/latest/ https://docs.cltk.org/en/latest/ Again, let me know what you are trying to do and I can try to help!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cltk/cltk/issues/1035#issuecomment-737390214, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPJTNBHY7XG5S7SSOLWK4TSSZ4UVANCNFSM4UKF42KQ.

kylepjohnson commented 3 years ago

Great. Assuming you have your texts, then:

Going to close this Issue, but write here with any questions.

Pika78 commented 3 years ago

This works fine. Thank you for your help. Kind regards

Le 2 déc. 2020 à 22:58, Kyle P. Johnson notifications@github.com a écrit :

Closed #1035 https://github.com/cltk/cltk/issues/1035.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cltk/cltk/issues/1035#event-4064559983, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADPJTNF6LSKZ2CJKN4SO4JDSS22ABANCNFSM4UKF42KQ.