9

I just updated PyCharm to the latest version and I've been having trouble with this error message. Basically, I can't turn off the error message that says "Python version 3.5 does not support variable annotations."

My default and project interpreter is Python 3.6, and I don't even have Python 3.5 added in PyCharm, so any help with this would be much appreciated.

Some pictures:

Picture of Pycharm IDE - Python version 3.5 does not support variable annotations

Picture of Pycharm IDE - Project Interpreter settings menu

Edit: Updated with one more picture of the Project Interpreter settings:

enter image description here

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Kyle
  • 685
  • 7
  • 14
  • What is parmetered in `File > Settings > Project : %your_project% > Project Interpreter` ? – gogaz Aug 21 '18 at 14:49
  • Same thing - All it has is Python 3.6. I'll add another picture in case I'm looking in the wrong place – Kyle Aug 21 '18 at 19:34
  • Try to search for `Python 3.5` in your `.idea` folder or the per-user settings directory... – Bakuriu Aug 21 '18 at 20:57
  • No dice. Command "find .idea/ -iname '\*Python\*'" returned nothing. What do you mean by the per-user settings directory? Is that the .Pycharm2018.2 folder in my home folder? If so, that also returned nothing besides python.decorator files – Kyle Aug 22 '18 at 01:03
  • 1
    Try to re-add interpreter – user2235698 Aug 22 '18 at 14:59
  • Ah, this is embarrassing...My Python 3 file in /usr/bin was pointing to Python 3.5 rather than 3.6, which was (/would obviously be) causing problems. Changed the interpreter to /usr/bin/python3.6 and the error is no more! I thought I had checked the versions, but I guess not. Thank you @user2235698! I saw this when re-adding the interpreter. – Kyle Aug 22 '18 at 17:22
  • @user2235698 - If you'd like, create an answer explaining the solution and I'll accept it. Otherwise, I'll comment myself and mark this question closed. Thank you everyone for helping out, I'm glad everything was resolved! – Kyle Aug 22 '18 at 17:25
  • My only solution that worked was to upgrade from pycharm 2017 to pycharm 2018. – Ron U Nov 06 '19 at 08:10

1 Answers1

7

Thanks to @user2235698, I fixed the issue by removing my project interpreter and re-adding it to Pycharm.

Ubuntu did an update which changed my Python 3 version from 3.6 to 3.5, but Pycharm didn't realize it was changed. Updating the interpreter directory from /usr/bin/python3 to /usr/bin/python3.6 fixed things.

Thanks again everyone! Marking this as solved.

Kyle
  • 685
  • 7
  • 14
  • 2
    There is an alternative - You need to turn off inspection/checks for the version you dont need as explained here - https://stackoverflow.com/a/49821592/3518294 – gvatreya Apr 07 '22 at 11:04