3

I am on 64-bit Windows 7 SP1. I have PyCharm Community Edition 4.0.4 with Python 3.4.2. I want to install new packages in PyCharm.

In PyCharm, when I go to File -> Settings -> Project -> Project Interpreter I get a list of packages in the project, which initially has pip, requests and setuptools. pip and setuptools were very outdated so I updated them by clicking the little blue arrow on the right of this list. They are now pip 6.1.1 and setuptools 15.0.

When I try to install a package:

  1. Click green plus icon
  2. In the Available Packages window, select a package that requires a C compiler (eg. line_profiler)
  3. Select it in the list
  4. Click the Install Package button in bottom left

I get an error. If I look at error details, basically the relevant line is this:

    error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).

Surely there is a way to fix this within PyCharm? I've seen that setting VS90COMNTOOLS can work but I don't understand where to type it in. PyCharm Python console? Options in the Available Packages window? Some other obscure option screen in PyCharm?

By the way, I have Visual Studio 2013 installed. I don't want to uninstall it or do anything else that will make it unusable. If possible I'd like to not waste space installing a whole IDE just for the C compiler, either (the "install VS2010" solution). The solution should not be VS2013 specific - or I'd have to come back again to ask the same question when VS2015 is released.

Community
  • 1
  • 1
Superbest
  • 25,318
  • 14
  • 62
  • 134
  • There are many questions on SO about `vcvarsall` and Python, but I am asking specifically about PyCharm. – Superbest Apr 11 '15 at 09:11
  • Also relevant: http://stackoverflow.com/a/8705722 – Superbest Apr 11 '15 at 09:24
  • 1
    Did you read all the comments under the linked answer about [setting VS90COMNTOOLS](http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat/10558328#10558328) saying it's **wrong**? They are correct about that. – martineau Apr 11 '15 at 10:18

2 Answers2

0

My suggestion is:

  1. Check if you have installed Windows Software Developement Kit (SDK). Go to your Control pannel and see the list of your installed programmes. If you do not have it, install it. If the installation failed, uninstall your Microsoft Visual Studios (2010, 2013, etc). Repeat the installation. and reinstall your Visual Studios.
  2. I would recommand upgrade your Visual Studio to version 2015. Install both Visual Studio 2015 Express (recently it is called "community") and Visual Studio 2015 redistributable. (You need both otherwise some dlls will be missing).

    Visual Studio Express 2015.

    Visual C++ 2015, Redistributable

  3. Regarding setting the variables (VS90COMNTOOLS): Go to control panel -> system -> Advanced system parameters then click on Environment variables. Make a new variable (in system variable table) name it VS90COMNTOOLS and set its value to %VS140COMNTOOLS% (if you followed my suggestions) or set it to %VS120COMNTOOLS% (if you have visual studio 2013).

It worked for me.

0

If you are at all like me, and you are just looking for a quick way to get those packages to just install. A very quick option is to install the Activepython distribution.

This comes included with a package manager 'pypm' that gets around this issue. You will need to install your packages from the command-line but this is extremely straightforward. The error you are describing drove me almost insane and this method really does get around it in the fastest possible manner.