简体   繁体   English

Windows8.1上带有模块的Python ImportError

[英]Python ImportError on Windows8.1 with module

I believe I have this problem because python is not finding the module installed on my machine and I'm not sure what the best way to debug this is. 我相信我有这个问题,因为python找不到我机器上安装的模块,我不确定调试它的最佳方法是什么。

First off, I know I have the module installed. 首先,我知道我已经安装了模块。 If I do pip freeze 如果我pip freeze

I get: 我得到:

Pillow==2.9.0
praw==2.1.20
requests==2.5.3
six==1.9.0
update-checker==0.11

However, when I try to run the following code, it tell me that there is no module named Pillow 但是,当我尝试运行以下代码时,它告诉我没有名为Pillow的模块

import os
from Pillow import Image


def extractFrames(inGif, outFolder):
    frame = Image.open(inGif)
    nframes = 0
    while frame:
        frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF')
        nframes += 1
        try:
            frame.seek( nframes )
        except EOFError:
            break;
    return True


extractFrames('donkey.gif', 'output')

I've programmed a lot in node.js so I'm used to package dependency there, but the system of pip is pretty foreign to and I would greatly appreciate any help. 我已经在node.js中进行了很多编程,因此我习惯了在其中打包依赖项,但是pip系统对它来说是很陌生的,我将不胜感激任何帮助。 Thanks! 谢谢!

It's 它的

from PIL import Image

Pillow is a fork of PIL and for backwards compatibility they kept the import name PIL. Pillow是PIL的分支,为了向后兼容,他们保留了导入名称PIL。 (Kind of weird). (有点奇怪)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入错误:没有名为 OpenSSL 的模块(python 2.7,windows 8.1) - ImportError: No module named OpenSSL (python 2.7 , windows 8.1) Python: ImportError: No module named Selenium Windows - Python: ImportError: No module named Selenium Windows 在Windows8.1上安装PyBluez之后,我得到DLL%1无效的win32应用程序 - After installing PyBluez on Windows8.1 I get DLL %1 not valid win32 app ImportError:Windows 7 python 2.7和python 3.3中没有名为serial的模块 - ImportError: No module named serial in windows 7 python 2.7 and python 3.3 在Windows上创建Python 3.3.4和virtualenv:ImportError:没有名为'pip'的模块 - Python 3.3.4 and virtualenv creation on Windows: ImportError: No module named 'pip' ImportError:没有名为助手的模块(Python 2.7.12- Windows 10) - ImportError: No module named helpers (Python 2.7.12- Windows 10) 导入Pocketsphinx无法在python 3.2(Windows)中运行。 “ ImportError:没有名为pocketsphinx的模块” - Importing pocketsphinx not working python 3.2 (Windows). “ImportError: No module named pocketsphinx” python3 ImportError:Windows10上没有名为“ numpy”的模块 - python3 ImportError: No module named 'numpy' on windows10 Python软件包没有模块ImportError - Python package No module ImportError ImportError:没有名为的模块 - Python - ImportError: No module named - Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM