5

I can't figure out how to fix this PyCharm warning. I started getting it after I migrated my account to a new Mac. (I also just updated PyCharm.)

Another symptom is the PyCharm editor is complaining about references to methods on commands like "logging.info()". Even though when I run my app, it seems to run fine.

And... I'm also getting PyCharm failed to generate skeletons. I did unload and reload the 2.5 interpreter and still getting the same.

Thanks.

leontx
  • 1,165
  • 1
  • 14
  • 24

3 Answers3

3

That can be caused by corrupted .pyc files. See http://bugs.python.org/issue1180193 for details.

You can try to remove all .pyc files from your project and reinstall your Python.

Dmitry Trofimov
  • 7,371
  • 1
  • 30
  • 34
  • Thanks, that makes sense. I was able to delete the .pyc files in my project, and i think the python reinstall is needed too (and the system seems to really not want me to delete python 2.5's .pyc files). Given that I'm new to the Mac, what's the easiest way to reinstall Python 2.5? – leontx Jul 02 '12 at 14:58
  • I've never done that myself as I use Linux. I think that may help http://stackoverflow.com/questions/3819449/how-to-uninstall-python-2-7-on-a-mac-os-x-10-6-4 – Dmitry Trofimov Jul 02 '12 at 15:29
  • To install Python 2.5 just download dmg from http://www.python.org/download/releases/2.5.4/ – Dmitry Trofimov Jul 02 '12 at 15:31
  • To remove the .pyc files, try the following: In the Project pane (left side usually) right click on the project name at the top of the tree and select Clean Python Compiled Files. – Matt Nov 21 '22 at 10:16
3

I just found this error coming from PyCharm Pro, 2021.1. It was in the python console tab, only.

I was using python 3.11 and it was just too new, though worked fine with both run and debug configurations.

I changed my virtual environment to one using 3.10.

The python console works now. The run/debug configurations took persuasion to update. I ended up recreating those too.

John
  • 6,433
  • 7
  • 47
  • 82
1

Re-cloning my entire repository to a fresh location, and then re-installing Google app engine caused this error to go away. Also note, I tried reinstalling OSX first to get a fresh copy of the Python interpreters, although by itself, that didn't seem to affect it.

EDIT

Ran into the same problem when switching to 2.7 and the conclusive fix, as I found here

https://stackoverflow.com/a/11753554/497357

was to install Apple's Command Line Tools (which seems to install the Python interpreter source that has evidently been removed from the standard Mountain Lion install). I installed from within Xcode at

Xcode>Preferences>Downloads pane>Install.
Community
  • 1
  • 1
leontx
  • 1,165
  • 1
  • 14
  • 24