Pycharm: Error "Cannot perform Refactoring. Function is not under the source root"

pycharm

Solution

Do you have your project root in the list of interpreter paths (`Settings| Project Interpreter| Press Cogwheel| More| Show paths for the selected interpreter`)?

If yes, it's the following known issue https://youtrack.jetbrains.com/issue/PY-9285.

You can follow it for updates, see howto: http://intellij-support.jetbrains.com/entries/23368682.

Problem

I am using pycharm 4.0.4 on windows 8 and my project structure is as follows: ``` my_django_project (pycharm content root) -lib -docs -scripts (virtualenv) -my_project (pycharm source root) -tempaltes -management -models.py -views.py etc.... ``` pycharm project interpreter: ``` 2.7.2 virualenv at c:\path\to\my_django_project ``` I am trying to perform a change signature refactor and a method in a class in my models.py file. With the project interpreter set as above rename refactorings work perfectly but, change signature results in `Cannot perform Refactoring. Function is not under the source root"` If I change pycharm project interpreter to: ``` 2.7.2 virualenv at c:\Python27\python.exe ``` And all refactorings work but, this is not my virtualenv. What am i doing wrong? Seems wrong having to switch out of the virtualenv in order to refactor. Any ideas welcome, thanks!

Original source