importerror

Importing arcpy module into anaconda's Spyder

跟風遠走 提交于 2019-11-30 05:26:14
问题 I would like to use arcpy into Anaconda's Spyder. I have a full ArcGIS license, so this is not an issue. I am able to semi-import the module by way of copying the the arcpy folder out of C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy and into C:\Anaconda\Lib\site-packages, but the import is never completed because I get an error of "ImportError: No module named arcgisscripting". Is there any way for arcpy to work in Spyder? 回答1: This is what you need to do: Open the Python window in ArcGIS,

NLTK - No module named corpus

萝らか妹 提交于 2019-11-30 05:18:46
问题 After installing NLTK and NLTK-DATA with PIP, i run python then i type from nltk.corpus import cmudict and it works. But when i wrote a script like this: from nltk.corpus import cmudict d = cmudict.dict() def nsyl(word): return [len(list(y for y in x if y[-1].isdigit())) for x in d[word.lower()]] print nsyl("hello") I have the following error : Traceback (most recent call last): File "nltk.py", line 1, in <module> from nltk.corpus import cmudict File "nltk.py", line 1, in <module> from nltk

pip install error: cannot import name 'unpack_url'

笑着哭i 提交于 2019-11-30 04:02:27
问题 I'm using Python 3.4.1 64-bit on a Windows 8.1 machine. Pip has been giving me problems lately, specifically this error: C:\Users\Charlie\Desktop>pip install wxPython_Phoenix-3.0.3.dev78341-cp34-none-w in_amd64.whl Traceback (most recent call last): File "C:\Python34\Scripts\pip-script.py", line 9, in <module> load_entry_point('Scipy-stack==14.8.27', 'console_scripts', 'pip')() File "C:\Python34\lib\site-packages\pkg_resources\__init__.py", line 519, in l oad_entry_point return get

Python: cannot import urandom module (OS X)

本小妞迷上赌 提交于 2019-11-30 03:34:59
问题 I'm quite ashamed to ask a question like this one, but I've been trying for a couple of hours already...it seems I can't get my python version to do random things anymore. More precisely, it's missing the module urandom . First, here are some info about my system: OSX version: 10.7.4 python version: Python 2.7.1 which python : /opt/local/bin/python import os; os : <module 'os' from '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc'> echo $PATH : /opt/local/bin:

ImportError: No module named django.core.management when using manage.py

两盒软妹~` 提交于 2019-11-30 02:02:23
I'm trying to run python manage.py runserver on a Django application I have and I get this error: Traceback (most recent call last): File "manage.py", line 8, in <module> from django.core.management import execute_from_command_line ImportError: No module named django.core.management Here is the output of pip freeze | grep -i django to show I do in fact have Django installed: Django==1.6.5 django-cached-authentication-middleware==0.2.0 django-cors-headers==1.1.0 django-htmlmin==0.7.0 django-static-precompiler==0.9 djangorestframework==2.3.14 Also, trying to run /usr/local/bin/python2.7 manage

“ImportError: no module named 'requests'” after installing with pip

倾然丶 夕夏残阳落幕 提交于 2019-11-30 01:37:25
问题 I am getting ImportError : no module named 'requests' . But I have installed the requests package using the command pip install requests . On running the command pip freeze in the command prompt, the result is requests==2.7.0 So why is this sort of error happening while running the python file? 回答1: Run in command prompt. pip list Check what version you have installed on your system if you have an old version. Try to uninstall the package... pip uninstall requests Try after to install it: pip

python3: ImportError: No module named xxxx [duplicate]

喜欢而已 提交于 2019-11-30 01:26:04
This question already has an answer here: Changes in import statement python3 4 answers I am new to Python and I am trying to understand a problem, which I see when creating a package. I have the following file structure: (Working-Directory is /my/Python/jmLib2) /my/Python/jmLib2 |--- Phone | |--- __init__.py | |--- Pots.py |- Test2.py --------------------------------- cat ./jmLib2/Pots.py #!/usr/bin/python def Pots(): print ("I'm Pots Phone") --------------------------------- cat ./jmLib2/__init__.py from Pots import Pots --------------------------------- cat ./Test2.py #!/usr/bin/python from

ImportError: libSM.so.6: cannot open shared object file: No such file or directory

让人想犯罪 __ 提交于 2019-11-29 22:37:40
When trying to import OpenCV, using import cv2 I get the following error: /usr/local/lib/python2.7/dist-packages/cv2/__init__.py in <module>() 7 8 # make IDE's (PyCharm) autocompletion happy ----> 9 from .cv2 import * 10 11 # wildcard import above does not import "private" variables like __version__ ImportError: libSM.so.6: cannot open shared object file: No such file or directory Not sure how to fix this - trying to play around with Google's new Colaboratory tool. Notebook is here: https://drive.google.com/file/d/0B7-sJqBiyjCcRmFkMzl6cy1iN0k/view?usp=sharing This fixed the problem by having

What could cause a Django error when debug=False that isn't there when debug=True

半腔热情 提交于 2019-11-29 22:30:10
Using the development server, it works with debug=True or False. In production, everything works if debug=True, but if debug=False, I get a 500 error and the apache logs end with an import error: "ImportError: cannot import name Project". Nothing in the import does anything conditional on debug - the only code that does is whether the development server should serve static files or not (in production, apache should handle this - and this is tested separately and works fine). This happens if you have a circular import in one of your files. Check and see if you are importing something from

Django Import Error: No module named apps

时光怂恿深爱的人放手 提交于 2019-11-29 17:53:28
问题 I just checked out a project with git. The project structure is project apps myapp settings __init__.py __init__.py manage.py There are other directories and files, but I think those are the important ones. When I run the server I get Traceback (most recent call last): File "C:/Dev/project/apps/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 385, in execute_from_command_line utility.execute()