6
votes

After upgrade pycharm to 2018.1, and upgrade python to 3.6.5, pycharm reports "unresolved reference 'join'". The last version of pycharm doesn't show any warning for the line below:

from os.path import join, expanduser

May I know why?

(I used python 3.6.? before)

I tried almost everything I can find, such as delete and recreate interpreter, invalidate cache and restart, delete and recreate virtualenv... how do I fix this?

(I can run my program without any error.)

2
Have you tried deleting the folder ~/.PyCharmxxxx.xx/system/python_stubs as mentioned in this question: stackoverflow.com/questions/30311954/… - FlyingTeller
I checked there is no folder ".PyCharmxxx" under my home directory - Liu Yong
the same problem for a single and new python file. - Liu Yong

2 Answers

0
votes

Sadly, it seems that PyCharm will try to evaluate the path to an existing file/folder, which in some cases will not exist and thus create this warning.

It's not very useful when you are building a path for something that's supposed to be created, because obviously it will not exist yet, but PyCharm will still complain.

You could try clicking on File > Invalidate Caches > Invalidate and Restart. This worked for me.

[edit] It will come back tho, not much else to do.

-1
votes

Check that pycharms is using the correct interpreter.