Python v3.5, Windows 7 64位, IDE:PyCharm版本:4.5.4 Build:141.2569
情况: 当尝试使用 pip 安装名为 PyAutoGUI 的模块时,我遇到了“无法找到vcvarsall.bat”错误。尝试从命令提示符安装最终会给出相同的错误。虽然错误似乎很常见,但解决方案是从http://www.lfd.uci.edu/~gohlke/pythonlibs/下载模块,但我找不到我在那里寻找的模块。
非常感谢任何建议。
错误:的
Collecting PyAutoGUI
Downloading PyAutoGUI-0.9.31.zip (55kB)
Collecting pymsgbox (from PyAutoGUI)
Downloading PyMsgBox-1.0.3.zip
Collecting PyTweening>=1.0.1 (from PyAutoGUI)
Downloading PyTweening-1.0.2.zip
Collecting Pillow (from PyAutoGUI)
Downloading Pillow-2.9.0.tar.gz (9.3MB)
Collecting pyscreeze (from PyAutoGUI)
Downloading PyScreeze-0.1.7.zip
Installing collected packages: pymsgbox, PyTweening, Pillow, pyscreeze, PyAutoGUI
Running setup.py install for pymsgbox
Running setup.py install for PyTweening
Running setup.py install for Pillow
Complete output from command C:\Users\Marx\AppData\Local\Programs\Python\Python35-32\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\Marx\\AppData\\Local\\Temp\\pycharm-packaging0.tmp\\Pillow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Marx\AppData\Local\Temp\pip-iwse_fey-record\install-record.txt --single-version-externally-managed --compile:
Single threaded build, not installing mp_compile: 4 processes
running install
running build
running build_py
creating build
creating build\lib.win32-3.5
creating build\lib.win32-3.5\PIL
copying PIL\BdfFontFile.py -> build\lib.win32-3.5\PIL
copying PIL\BmpImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\BufrStubImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\ContainerIO.py -> build\lib.win32-3.5\PIL
copying PIL\CurImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\DcxImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\EpsImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\ExifTags.py -> build\lib.win32-3.5\PIL
copying PIL\features.py -> build\lib.win32-3.5\PIL
copying PIL\FitsStubImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\FliImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\FontFile.py -> build\lib.win32-3.5\PIL
copying PIL\FpxImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\GbrImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\GdImageFile.py -> build\lib.win32-3.5\PIL
copying PIL\GifImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\GimpGradientFile.py -> build\lib.win32-3.5\PIL
copying PIL\GimpPaletteFile.py -> build\lib.win32-3.5\PIL
copying PIL\GribStubImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\Hdf5StubImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\IcnsImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\IcoImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\Image.py -> build\lib.win32-3.5\PIL
copying PIL\ImageChops.py -> build\lib.win32-3.5\PIL
copying PIL\ImageCms.py -> build\lib.win32-3.5\PIL
copying PIL\ImageColor.py -> build\lib.win32-3.5\PIL
copying PIL\ImageDraw.py -> build\lib.win32-3.5\PIL
copying PIL\ImageDraw2.py -> build\lib.win32-3.5\PIL
copying PIL\ImageEnhance.py -> build\lib.win32-3.5\PIL
copying PIL\ImageFile.py -> build\lib.win32-3.5\PIL
copying PIL\ImageFileIO.py -> build\lib.win32-3.5\PIL
copying PIL\ImageFilter.py -> build\lib.win32-3.5\PIL
copying PIL\ImageFont.py -> build\lib.win32-3.5\PIL
copying PIL\ImageGrab.py -> build\lib.win32-3.5\PIL
copying PIL\ImageMath.py -> build\lib.win32-3.5\PIL
copying PIL\ImageMode.py -> build\lib.win32-3.5\PIL
copying PIL\ImageMorph.py -> build\lib.win32-3.5\PIL
copying PIL\ImageOps.py -> build\lib.win32-3.5\PIL
copying PIL\ImagePalette.py -> build\lib.win32-3.5\PIL
copying PIL\ImagePath.py -> build\lib.win32-3.5\PIL
copying PIL\ImageQt.py -> build\lib.win32-3.5\PIL
copying PIL\ImageSequence.py -> build\lib.win32-3.5\PIL
copying PIL\ImageShow.py -> build\lib.win32-3.5\PIL
copying PIL\ImageStat.py -> build\lib.win32-3.5\PIL
copying PIL\ImageTk.py -> build\lib.win32-3.5\PIL
copying PIL\ImageTransform.py -> build\lib.win32-3.5\PIL
copying PIL\ImageWin.py -> build\lib.win32-3.5\PIL
copying PIL\ImImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\ImtImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\IptcImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\Jpeg2KImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\JpegImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\JpegPresets.py -> build\lib.win32-3.5\PIL
copying PIL\McIdasImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\MicImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\MpegImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\MpoImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\MspImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\OleFileIO.py -> build\lib.win32-3.5\PIL
copying PIL\PaletteFile.py -> build\lib.win32-3.5\PIL
copying PIL\PalmImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\PcdImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\PcfFontFile.py -> build\lib.win32-3.5\PIL
copying PIL\PcxImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\PdfImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\PixarImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\PngImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\PpmImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\PsdImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\PSDraw.py -> build\lib.win32-3.5\PIL
copying PIL\PyAccess.py -> build\lib.win32-3.5\PIL
copying PIL\SgiImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\SpiderImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\SunImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\TarIO.py -> build\lib.win32-3.5\PIL
copying PIL\TgaImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\TiffImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\TiffTags.py -> build\lib.win32-3.5\PIL
copying PIL\WalImageFile.py -> build\lib.win32-3.5\PIL
copying PIL\WebPImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\WmfImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\XbmImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\XpmImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\XVThumbImagePlugin.py -> build\lib.win32-3.5\PIL
copying PIL\_binary.py -> build\lib.win32-3.5\PIL
copying PIL\_util.py -> build\lib.win32-3.5\PIL
copying PIL\__init__.py -> build\lib.win32-3.5\PIL
running egg_info
writing top-level names to Pillow.egg-info\top_level.txt
writing dependency_links to Pillow.egg-info\dependency_links.txt
writing Pillow.egg-info\PKG-INFO
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Pillow.egg-info\SOURCES.txt'
copying PIL\OleFileIO-README.md -> build\lib.win32-3.5\PIL
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'PIL._imaging' extension
error: Unable to find vcvarsall.bat
----------------------------------------
答案 0 :(得分:2)
我遇到类似cx_Oracle和pysftp等软件包的问题。这对我有用:
安装适当版本的c ++编译器。我在win32上使用以下Python解释器,Python 3.5.0(v3.5.0:374f501f4567,2015年9月13日,02:16:59)[MSC v.1900 32位(英特尔)]。我安装了Visual Studio 2015社区版。 (感谢@Colonel Panic)
重新运行目标包的点数。
快乐的编码!!
参考:
答案 1 :(得分:1)
如果您仔细阅读了错误消息,则可以看到在尝试安装pillow
时实际发生错误。 pillow
确实在您链接到的Gohlke网站上提供了一个版本。因此,请尝试从那里安装pillow
,然后执行pip install pyautogui
并查看是否有效。
某些Python软件包包含用C编写的部分。要使用这些软件包,您需要一个C编译器,或者需要一个Windows安装程序(如Gohlke网站上提供的那些)。似乎PyAutoGUI不需要编译,但它需要Pillow,它需要编译。因此,您可以通过单独安装Pillow来使其工作。 (您可能会再次收到错误消息,因为另一个依赖项可能存在同样的问题,因此您可能必须重复此过程,安装其他库,直到您安装了足够的pip
才能正常工作。)