importerror

Why can't Python import Image from PIL?

穿精又带淫゛_ 提交于 2019-11-26 21:07:22
问题 The single line that I am trying to run is the following: from PIL import Image However simple this may seem, it gives an error: Traceback (most recent call last): File "C:\...\2014-10-22_12-49.py", line 1, in <module> from PIL import Image File "C:\pyzo2014a\lib\site-packages\PIL\Image.py", line 29, in <module> from PIL import VERSION, PILLOW_VERSION, _plugins ImportError: cannot import name 'VERSION' In case that's helpful, I installed pillow from https://pypi.python.org/pypi/Pillow/2.6.1

Python files - import from each other

橙三吉。 提交于 2019-11-26 20:36:31
问题 I would like for two of my python files to import some methods from each other. This seems to be giving me import errors. Example: file_A.py: from file_B import do_B_stuff file_B.py: from file_A import do_A_stuff The reason I am trying to do this is because I would like to organize my project in the way it intuitively makes sense to me as opposed to organizing it with respect to what makes sense to the compiler. Is there a way to do this? Thanks! 回答1: Don't use the names within the other

How can I troubleshoot Python “Could not find platform independent libraries <prefix>”

ⅰ亾dé卋堺 提交于 2019-11-26 17:39:44
问题 I'm trying to use Fontcustom to create an icon font using svg files and fontforge. I'm on OSX.7. However, whenever I run the program I get the error Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] ImportError: No module named site` As a Python/Unix newbie I don't even know where to start trying to solve this. Can anyone offer any advice? What are <prefix> and <exec_prefix>

ImportError: No module named six

◇◆丶佛笑我妖孽 提交于 2019-11-26 12:12:29
问题 I\'m trying to build OpenERP project, done with dependencies. It\'s giving this error now Traceback (most recent call last): File \"openerp-client.py\", line 105, in <module> File \"modules\\__init__.pyo\", line 23, in <module> File \"modules\\gui\\__init__.pyo\", line 22, in <module> File \"modules\\gui\\main.pyo\", line 33, in <module> File \"rpc.pyo\", line 29, in <module> File \"common\\__init__.pyo\", line 22, in <module> File \"common\\common.pyo\", line 26, in <module> File \"tools\\_

Installing OpenCV for Python on Ubuntu, getting ImportError: No module named cv2.cv

冷暖自知 提交于 2019-11-26 12:05:13
问题 I have an Ubuntu 14.04 system, on which I want to install OpenCV and use it with Python 2.x. I installed OpenCV using the instructions here: https://help.ubuntu.com/community/OpenCV The install seemed to run properly, no errors, the script ended with output OpenCV 2.4.9 ready to be used When I try to run the sample Python script, I get the following: $ python opencv.py Traceback (most recent call last): File \"opencv.py\", line 1, in <module> from cv2.cv import * ImportError: No module named

“ImportError: No module named” when trying to run Python script

拥有回忆 提交于 2019-11-26 12:02:56
I'm trying to run a script that launches, amongst other things, a python script. I get a ImportError: No module named ..., however, if I launch ipython and import the same module in the same way through the interpreter, the module is accepted. What's going on, and how can I fix it? I've tried to understand how python uses PYTHONPATH but I'm thoroughly confused. Any help would greatly appreciated. tyleha This issue arises due to the ways in which the command line IPython interpreter uses your current path vs. the way a separate process does (be it an IPython notebook, external process, etc).

Getting “ImportError: DLL load failed: The specified module could not be found” when using cx_Freeze even with tcl86t.dll and tk86t.dll added in

心已入冬 提交于 2019-11-26 10:02:59
问题 I am trying to convert a .py file to .exe using cx_Freeze 5.1.1., but an ImportError: DLL load failed pops up every time I try to run the file. Based on the suggested solutions here and here, I added tcl86t.dll and tk86t.dll to the list of included files. They appear in the build folder, but the error message keeps popping up. Here is my setup.py: import sys import os from cx_Freeze import setup, Executable os.environ[\"TCL_LIBRARY\"] = r\"C:/Users/Name/AppData/Local/Programs/Python/Python36

Counter in Collections module Python

折月煮酒 提交于 2019-11-26 09:55:06
问题 I\'ve come across a really weird problem. I\'m trying to use Counter function in collections module. However, I keep getting the same error message AttributeError: \'module\' object has no attribute \'Counter\' I have tried using it before and it worked fine, but now for some reason when I import \"collections\" module it has a very limited number of attributes. I have tried: import collections # when calling Counter I would then use collections.Counter() import collections as collect #

ImportError: DLL load failed: %1 is not a valid Win32 application

喜你入骨 提交于 2019-11-26 07:34:51
问题 I have this issue where I try to import cv2 on python and get the following error message. >>> import cv2 Traceback (most recent call last): File \"<stdin>\", line 1, in <module> ImportError: DLL load failed: %1 is not a valid Win32 application. I do understand there are many posts about this where it is suggested that the bitness of the package is different from the python package. However, everything I am running is 64 bits. I am on win7 64 bits, I have the winpython 2.7.3.3, 64 bits

ImportError: No module named &#39;bottle&#39; - PyCharm

China☆狼群 提交于 2019-11-26 07:33:08
问题 I installed bottle on python3.4 with pip install. In terminal, when I do: $ python3.4 >>>import bottle # shows no import error >>> but when I do it in PyCharm, it says \"import bottle ImportError: No module named \'bottle\'\" 回答1: in your PyCharm project: press Ctrl + Alt + s to open the settings on the left column, select Project Interpreter on the top right there is a list of python binaries found on your system, pick the right one eventually click the + button to install additional python