If PyCharm complains that it
Can't start Mercurial: /usr/bin/hg Probably the path to hg executable is not valid, then check if running hg from the command line triggers a problem running a certain extension. In my case I had a version of
mercurial_keyring that did not play nice with each other. After upgrading these to 3.0.5 and 0.6.0 respectively, the problem went away. I guess PyCharm tests the run of the hg binary and if the shell return code (
echo $?) is something other than 0 will show this warning.
PyCharm 1.1.1 was released yesterday. It consists mostly of bugfixes, find the full release notes on their site.
PyCharm already has a number of features present in various tools to lint/check your source code with, but offers a way to hook up external tools. Under
File > Settings is a section called
IDE Settings. One of the headings here is called
External Tools. Select this heading and then press the
Add... button on the right hand pane to configure a new external tool.
Edit Tool window that now appeared fill in a name, e.g.
PEP8 and a group name
Lint and add a description. Next point the
Program to the location of the
pep8.exe executable, e.g.
Parameters you need to use
Working directory should be filled in by default. Once done, you can close it by pressing the
Now, pyflakes has no .exe or .bat file to accompany it. You will need to add a pyflakes.bat in your
Scripts directory inside Python with the following contents:
rem Use python to execute the python script having the same name as this batch
rem file, but without any extension, located in the same directory as this
rem batch file
python "%~dpn0" %*
Within PyCharm you follow largely the same settings as for pep8, however make sure to point to the batch file of pyflakes under
Program. Close the external tools configuration windows by clicking
OK twice. Under the menu heading
Tools you should see an submenu heading
Lint which, in turn, should contain two menu items: PEP8 and Pyflakes.
Now open a Python file, go to
Tools > Lint > PEP8 and you should get output like the following in your Run (4) window:
D:\pprojects\babel\babel\tests\__init__.py:16:1: E302 expected 2 blank lines, found 1
Process finished with exit code 1
So I was so impressed by PyCharm that I purchased a license. I haven’t noticed much of any delays or slowdowns that other people have complained about.