importerror

ImportError: cannot import name PunktWordTokenizer

喜你入骨 提交于 2019-12-06 00:05:49
I was trying to use PunktWordTokenizer and it was occurred an error as below. from nltk.tokenize.punkt import PunktWordTokenizer And this gave the following error message. Traceback (most recent call last): File "file", line 5, in <module> from nltk.tokenize.punkt import PunktWordTokenizer ImportError: cannot import name PunktWordTokenizer I've checked that nltk is installed and that PunkWordTokenzer is also installed using nltk.download(). Need some help for this. There appears to be a regression related to PunktWordTokenizer in 3.0.2. The issue was not present in 3.0.1, rolling back to that

More on python ImportError No module named

坚强是说给别人听的谎言 提交于 2019-12-05 21:28:42
Following the suggestion here , my package (or the directory containing my modules) is located at C:/Python34/Lib/site-packages. The directory contains an __init__.py and sys.path contains a path to the directory as shown. Still I am getting the following error: Traceback (most recent call last): File "C:/Python34/Lib/site-packages/toolkit/window.py", line 6, in <module> from catalogmaker import Catalog File "C:\Python34\Lib\site-packages\toolkit\catalogmaker.py", line 1, in <module> from patronmaker import Patron File "C:\Python34\Lib\site-packages\toolkit\patronmaker.py", line 4, in <module>

ImportError: No module named numpy - Google Cloud Dataproc when using Jupyter Notebook

ぃ、小莉子 提交于 2019-12-05 19:12:30
When starting Jupyter Notebook on Google Dataproc, importing modules fails. I have tried to install the modules using different commands. Some examples: import os os.sytem("sudo apt-get install python-numpy") os.system("sudo pip install numpy") #after having installed pip os.system("sudo pip install python-numpy") #after having installed pip import numpy None of the above examples work and return an import error: enter image description here When using command line I am able to install modules, but still the import error remains. I guess I am installing modules in a wrong location. Any

Importing modules from a sibling directory for use with py.test

ぃ、小莉子 提交于 2019-12-05 16:22:58
I am having problems importing anything into my testing files that I intend to run with py.test. I have a project structure as follows: /ProjectName | |-- /Title | |-- file1.py | |-- file2.py | |-- file3.py | |-- __init__.py | |-- /test | |-- test_file1.py I have not been able to get any import statements working with pytest inside the test_file1.py file, and so am currently just attempting to use a variable declared in file_1.py and print it out when test_file1.py is run. file1.py contains: file1_variable = "Hello" test_file1.py contains: import sys import os sys.path.append(os.path.abspath('

Absolute Import Not Working, But Relative Import Does

懵懂的女人 提交于 2019-12-05 15:15:57
Here is my app structure: foodo/ setup.py foodo/ __init__.py foodo.py models.py foodo/foodo/foodo.py imports classes from the models.py module: from foodo.models import User which throws an ImportError : ImportError: No module named models However, it does work if I use a relative import: from models import User And it also works if I put in an pdb breakpoint before the import and continue. I should be able to use both absolute and relative imports right? You have a local module foodoo inside the foodoo package. Imports in Python 2 always first look for names in the current package before

import error; no module named Quandl

佐手、 提交于 2019-12-05 12:35:33
问题 I am am trying to run the Quandl module on a virtualenv which I have uninstalled packages only pandas and then Quandl, I am running Python 2.7.10 - I have uninstalled all other python versions, but its still giving me the issue of 'ImportError: No module named Quandl'. Do you know what might be wrong? Thanks 回答1: Try with lower case, import is case sensitive and it's as below: import quandl Did you install with pip? If so ensure quandl is among the listed installed modules with pip list

ImportError for my code on Readthedocs

大城市里の小女人 提交于 2019-12-05 09:45:25
I am trying to link my sphinx documentation with read the docs. I can build the documentation locally but when i try to have read the docs automatically generate the documentation i get the following error: Sphinx Standard Error Making output directory... Exception occurred: File "/var/build/user_builds/mousedb/checkouts/latest/Docs/source/conf.py", line 25, in <module> from mousedb import settings ImportError: No module named mousedb The full traceback has been saved in /tmp/sphinx-err-n_8fkR.log, if you want to report the issue to the developers. Please also report this if it was a user

pygtk import gtk error

十年热恋 提交于 2019-12-05 06:14:45
问题 I downloaded everything described as in pygtk for installation. Everything went fine until when I tried to type "import gtk" , it threw an ImportError as follows: from gtk import _gtk ImportError: DLL load failed: ...(something unreadable) Then I re-install the pygtk-2.22.0 again, the same problem existed. So what to do please? Thanks in advance! 回答1: The error you describe is usually caused by the python bindings (pygtk/pygobject/pycairo) being unable to load a dll it needs to function

python 2.7 module pandas not installing “cannot import name hashtable”

眉间皱痕 提交于 2019-12-05 05:43:15
I tried looking for an answer to this around the forum/google, but I can't find anything. My issue is this (from python console): >>> import pandas cannot import name hashtable Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\pandas\__init__.py", line 6, in <module> from . import hashtable, tslib, lib ImportError: cannot import name hashtable //also can't import name NaT somtimes I ran the windows 1-click installer prior to attempting the import. I'm running everything 32-bit. The pandas installer is for python 2.7. Here's a list of

ImportError: cannot import name signals

匆匆过客 提交于 2019-12-05 05:40:02
I'm using Django 1.3.0 with Python 2.7.1. In every test I write the following imports I get the importError above: from django.utils import unittest from django.test.client import Client The full stack trace: File "C:\Program Files (x86)\j2ee\plugins\org.python.pydev.debug_1.6.3.2010100513\pysrc\runfiles.py", line 342, in __get_module_from_str mod = __import__(modname) File "C:/Users/benjamin/workspace/BookIt/src/BookIt/tests\basic_flow.py", line 11, in from django.test.client import Client File "C:\Python27\lib\site-packages\django\test\__init__.py", line 5, in from django.test.client import