3

Python v3.5, Windows 7 64-bit, IDE: PyCharm Version: 4.5.4 Build: 141.2569

Situation: When trying to install a module called PyAutoGUI with pip I came across a "Unable to find vcvarsall.bat" error. Trying to install from the command prompt ends up giving the same error. Although the error seems to be quite commonplace, with the solution being downloading the module from http://www.lfd.uci.edu/~gohlke/pythonlibs/, I did not find the module I was looking for there.

Any advice would be greatly appreciated.

Error:


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

----------------------------------------

N. Cross
  • 227
  • 1
  • 2
  • 7
  • Do you have a C compiler installed? – BrenBarn Sep 18 '15 at 16:48
  • No, was not aware that was needed. Could you elaborate on that a bit more, why is it needed and where could I get one? – N. Cross Sep 18 '15 at 16:51
  • If you don't have a C compiler installed, be sure to get the same one that was used to build the version of the Python interpreter you're using (or use mingw32). When you start Python's console, it prints out what compiler was used to build it. For Windows you can use Visual Studio Express which you can download from Microsoft's website. – martineau Sep 18 '15 at 16:51

2 Answers2

2

I ran into similar problem with packages like cx_Oracle and pysftp. This is what worked for me:

  1. Install an appropriate version of c++ compiler. I am using the following Python interpreter, Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] on win32. I installed Visual Studio 2015 Community Edition. (thanks to @Colonel Panic)

  2. Rerun the pip for your target package.

Happy coding!!

Reference:

Community
  • 1
  • 1
deepthought
  • 87
  • 11
1

If you read your error message carefully, you can see that the error actually occurs when trying to install pillow. pillow does have a version available on Gohlke's website that you linked to. So try installing pillow from there, then do your pip install pyautogui and see if it works.

Some Python packages have parts that are written in C. To use these, you either need a C compiler or you need a Windows installer for the package (like those provided on Gohlke's site). It appears that PyAutoGUI does not require compilation, but it requires Pillow, which does require compilation. So you may be able to get it to work by installing Pillow separately. (You may get the error message again because the same problem may exist for another dependency, so you may have to repeat this process, installing other libs until you have enough installed that pip will work.)

BrenBarn
  • 242,874
  • 37
  • 412
  • 384
  • "Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] on win32" Considering my Python version, which one should I download? – N. Cross Sep 18 '15 at 17:09
  • @N.Cross: Get the one called `Pillow‑2.9.0‑cp35‑none‑win32.whl`. (`cp35` means CPython 3.5, `win32` because the line you pasted shows "32 bit".) Then you can install that wheel with `pip` (`pip install Pillow‑2.9.0‑cp35‑none‑win32.whl`). – BrenBarn Sep 18 '15 at 17:12
  • Running that command just gives me an error saying the file doesn't exist although I have downloaded it. – N. Cross Sep 18 '15 at 17:44
  • @N.Cross: You have to be in the directory where you downloaded the `.whl` before you try to install it with the command I showed. – BrenBarn Sep 18 '15 at 17:46