Skip to content

error while running python ask.py #2

@trinetrareddy

Description

@trinetrareddy

Traceback (most recent call last):
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/sklearn/externals/joblib/format_stack.py", line 33, in
generate_tokens = tokenize.generate_tokens
AttributeError: module 'tokenize' has no attribute 'generate_tokens'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "ask.py", line 1, in
from bin_questions import BinQuestion
File "/Users/vivekrao/QA_Model_Research/nlp_qa_project/bin_questions.py", line 1, in
from nltk.tree import Tree
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/nltk/init.py", line 143, in
from nltk.chunk import *
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/nltk/chunk/init.py", line 157, in
from nltk.chunk.api import ChunkParserI
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/nltk/chunk/api.py", line 13, in
from nltk.parse import ParserI
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/nltk/parse/init.py", line 100, in
from nltk.parse.transitionparser import TransitionParser
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/nltk/parse/transitionparser.py", line 22, in
from sklearn.datasets import load_svmlight_file
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/sklearn/init.py", line 64, in
from .base import clone
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/sklearn/base.py", line 13, in
from .utils.fixes import signature
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/sklearn/utils/init.py", line 14, in
from . import _joblib
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/sklearn/utils/_joblib.py", line 22, in
from ..externals import joblib
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/sklearn/externals/joblib/init.py", line 119, in
from .parallel import Parallel
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 24, in
from .format_stack import format_outer_frames
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/sklearn/externals/joblib/format_stack.py", line 35, in
generate_tokens = tokenize.tokenize
AttributeError: module 'tokenize' has no attribute 'tokenize'
(virtual_env) Trinetra-Reddy-MacBook-Air:nlp_qa_project vivekrao$ Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/init.py", line 16, in
from . import context
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/context.py", line 3, in
import threading
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 7, in
from traceback import format_exc as _format_exc
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 5, in
import linecache
File "/Users/vivekrao/virtual_env/lib/python3.6/linecache.py", line 11, in
import tokenize
File "/Users/vivekrao/QA_Model_Research/nlp_qa_project/tokenize.py", line 1, in
import nltk
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/nltk/init.py", line 129, in
from nltk.collocations import *
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/nltk/collocations.py", line 38, in
from nltk.util import ngrams
File "/Users/vivekrao/virtual_env/lib/python3.6/site-packages/nltk/util.py", line 15, in
import pydoc
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pydoc.py", line 72, in
from traceback import format_exception_only
ImportError: cannot import name 'format_exception_only'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions