简体   繁体   中英

How do you deal with importing built-in libraries under windows using PyCharm?

I have python-2.6 installed and use pycharm-3.1.3 (community edition) to develop.

But the imports of the built-in libraries (for instance - datetime ) are marked as errors by the given IDE.

在此处输入图片说明

It only happens for built-in libraries, the external ones that are located in <pythondir>/Lib (for instance base64 ) are imported without problems - IDE can resolve symbols from them for intellisense and whatnot.

So the question is how to deal with this?

PS: I know I can mark it as "ignore this import error" but then the library symbols won't be autocompleted.

It happened right after an upgrade from 3.0 to 3.1.x, so probably it's just some upgrade issue.

The solution is to re-add interpreter. After that all built-in modules are resolved fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM