5
votes

As we know, map is a python built-in function.

I use PyCharm 3.4.1 currently, and it reports an

Unresolved reference 'map' 

in my code:

a = map(int, [1,2,3])

where the map word was with red waved underscore, and shows this tip of message.

enter image description here

I've been reading about the question: PyCharm shows unresolved references error for valid code

And did File | Invalidate Caches... and restarting PyCharm helps.

But problem still unsolved.


For more info, I'm working on a django 1.6 object.

and the project interpreter is as below:

enter image description here

Could anyone tell why and how? Thanks a lot!

1
Is it something to do with the "Project Interpreter" setting? - John Mee
More detail about that? - Alfred Huang
go 'Preferences -> Project Interpreter'. What does it say your project interpreter is? - John Mee
What happens when you run it? - John Mee
In fact no running problem, but have some mistake on the code spelling check - Alfred Huang

1 Answers

1
votes

Finally I found the point myself:

Pycharm generates a file builtins.py for code prompt.

It's path is probably under:

C:\Program Files (x86)\JetBrains\PyCharm 3.4.1\helpers\python-skeletons\builtins.py

Randomly choose a built-in function, click it with Ctrl key, then this file is open in PyCharm.

Then I see the error, but still without knowing how and when it happens:

enter image description here

I see the multiline comment block was closed incorrectly.

I manually fixed it, and everything goes well!