Pycharm import RuntimeWarning after updating to 2016.2

Solution 1:

This is a known issue introduced with the 2016.2 release. Progress can be followed on the JetBrains website here. According to this page it is due to be fixed in the 2017.1 release. You can follow the utrunner.py workaround that others have mentioned in the meantime - a copy of this file is attached to the linked ticket.

Solution 2:

The latest recommendation (Dec. 19, 2016) is to put this line at the top of your unit test script:

from __future__ import absolute_import

Solution 3:

On OS X I've fixed this by replacing

Applications/PyCharm.app/Contents/helpers/pycharm/utrunner.py 

with an older version that can be found at http://code.metager.de/source/xref/jetbrains/intellij/community/python/helpers/pycharm/utrunner.py

Solution 4:

On Ubuntu 16.04 Bobby's solution also works:

Just replace your local utrunner.py file at

/usr/local/pycharm-edu-3.0/helpers/pycharm/utrunner.py

by the one from the Jetbrains website: http://code.metager.de/source/xref/jetbrains/intellij/community/python/helpers/pycharm/utrunner.py