leolani / cltl-chatbots

Series of chatbots that demonstrate Leolani’s functionalities
Apache License 2.0
0 stars 1 forks source link

Cannot import Sequence from Collections #4

Closed esg550 closed 2 years ago

esg550 commented 3 years ago

I get an error when I run a cell with "from cltl import brain":

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_33504/3505524354.py in <module>
     12 import emissor as em
     13 import requests
---> 14 from cltl import brain
     15 from cltl.brain.long_term_memory import LongTermMemory
     16 from cltl.brain.utils.helper_functions import brain_response_to_json

~\cltl-chatbots\venv\lib\site-packages\cltl\brain\__init__.py in <module>
      4 
      5 
----> 6 from cltl.brain.infrastructure import *
      7 from cltl.brain.long_term_memory import LongTermMemory

~\cltl-chatbots\venv\lib\site-packages\cltl\brain\infrastructure\__init__.py in <module>
----> 1 from cltl.brain.infrastructure.api import *
      2 from cltl.brain.infrastructure.store_connector import *
      3 from cltl.brain.infrastructure.rdf_builder import *

~\cltl-chatbots\venv\lib\site-packages\cltl\brain\infrastructure\api.py in <module>
      3 from typing import List, Optional
      4 
----> 5 from nltk.stem import WordNetLemmatizer
      6 from rdflib import Literal
      7 

~\cltl-chatbots\venv\lib\site-packages\nltk\__init__.py in <module>
    132 from nltk.grammar import *
    133 from nltk.probability import *
--> 134 from nltk.text import *
    135 from nltk.tree import *
    136 from nltk.util import *

~\cltl-chatbots\venv\lib\site-packages\nltk\text.py in <module>
     24 from six import text_type
     25 
---> 26 from nltk.lm import MLE
     27 from nltk.lm.preprocessing import padded_everygram_pipeline
     28 from nltk.probability import FreqDist

~\cltl-chatbots\venv\lib\site-packages\nltk\lm\__init__.py in <module>
    220 """
    221 
--> 222 from nltk.lm.models import (
    223     MLE,
    224     Lidstone,

~\cltl-chatbots\venv\lib\site-packages\nltk\lm\models.py in <module>
     10 
     11 from nltk import compat
---> 12 from nltk.lm.api import LanguageModel, Smoothing
     13 from nltk.lm.smoothing import KneserNey, WittenBell
     14 

~\cltl-chatbots\venv\lib\site-packages\nltk\lm\api.py in <module>
     15 from six import add_metaclass
     16 
---> 17 from nltk.lm.counter import NgramCounter
     18 from nltk.lm.util import log_base2
     19 from nltk.lm.vocabulary import Vocabulary

~\cltl-chatbots\venv\lib\site-packages\nltk\lm\counter.py in <module>
     13 from __future__ import unicode_literals
     14 
---> 15 from collections import Sequence, defaultdict
     16 
     17 from six import string_types

ImportError: cannot import name 'Sequence' from 'collections' (C:\Users\User\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
tae898 commented 3 years ago

Are you by any chance using python version >= 3.9? If that's the case, try using a lower version python. I use 3.7 this year.

esg550 commented 3 years ago

I downgraded to 3.7.11 and now the kernel just stops after running a cell. Here I ran the cell with venv as the kernel, but then the outcome is this: image

tae898 commented 3 years ago

Are you running on Windows btw?

esg550 commented 3 years ago

yes i am

tae898 commented 3 years ago

yeah unfortunately it's not easy to get things running on Windows...

Can you take a look at this? https://github.com/leolani/cltl-chatbots/issues/3