PyCharm 5.0.1 doesn't resolve builtin modules / methods

前端 未结 2 496
名媛妹妹
名媛妹妹 2021-01-06 17:42

My PyCharm 5.0.1 installation does not resolve references to any builtin modules or methods:

As you can see, I have installed python over cygwin.

I alr

相关标签:
2条回答
  • 2021-01-06 18:20

    I use Windows 10 x64, Python 3.5.1 and PyCharm Community Edition 2016.1.4

    I have the same problem and sovled it by runnig PyCharm in admin mode (it is required only once).

    0 讨论(0)
  • 2021-01-06 18:21

    This is an update with a much better solution than my previous answer (which I completely missed that OP was asking for a solution that didn't require exactly what I suggested).

    Like Carl commented above, updating python-skeletons is actually the way to go, however, if you're using Cygwin, the interpreter paths are a little wonky, and PyCharm won't always automatically add the right paths. For me, PyCharm handled it just fine in version 4.5.4, but not 5.0.4.

    You'll find the python builtins in your Pycharm config directory, probably at:

    C:\Users\[USERNAME]\.PyCharm50\system\python_stubs\-[RANDOM_STRING_OF_NUMBERS]
    

    Just manually add this path (or paths) to your interpreter and it should resolve your problem. You can do the same for your site-packages folder if that's currently polluting your project structure space.

    To get to the right menu:

    1. Click File -> Settings
    2. Navigate to Project -> Project Interpreter
    3. Click the gear on the top right and click "More"
    4. Select your interpreter and click the "Show paths" button on the right
    5. Instead of clicking refresh, as many other posts suggest, click the "Add" button on the right and add your paths

    There's a handy screenshot uploaded by r---------k on the updating python-skeletons post that if that helps you.

    Try installing the Python package for Windows from http://www.python.org/download/windows and point PyCharm to that interpreter instead.

    Settings -> Project -> Project Interpreter -> Gear -> Add Local

    You may also need to install PyCharm's Python packaging tools (you should see a link on the bottom of the Project Interpreter page if it isn't installed already).

    While this may not be a perfect solution depending on your workflow because PyCharm will no longer be using Cygwin's python interpreter, but this at least got rid of those pesky squiggly red underlines for me.

    0 讨论(0)
提交回复
热议问题