Pycharm“未解析的引用"加入 os.path [英] Pycharm "unresolved reference" on join of os.path

查看:282
本文介绍了Pycharm“未解析的引用"加入 os.path的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pycharm 升级到 2018.1,python 升级到 3.6.5 后,pycharm 报unresolved reference 'join'".pycharm 的最新版本没有显示以下行的任何警告:

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

我可以知道为什么吗?

(我之前用的是python 3.6.?之前)

(I used python 3.6.? before)

我尝试了几乎所有能找到的方法,例如删除并重新创建解释器、使缓存无效并重新启动、删除并重新创建 virtualenv...我该如何解决这个问题?

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.)

推荐答案

遗憾的是,PyCharm 似乎会尝试评估现有文件/文件夹的路径,该文件/文件夹在某些情况下不存在,因此会产生此警告.

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.

当你为应该创建的东西构建路径时,它不是很有用,因为显然它还不存在,但 PyCharm 仍然会抱怨.

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] 它会回来的,没什么可做的.

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

这篇关于Pycharm“未解析的引用"加入 os.path的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆