Pycharm突然显示"未解决的参考"

dis*_*ame 7 python pycharm

我不知道我能做些什么,但是Pycharm现在决定声称它不知道类似的东西,TaggedDocument或者Doc2Vec虽然它在一小时前工作.

在此输入图像描述

这是我的项目结构:

在此输入图像描述

我不记得做任何导致这种情况的事情所以请告诉我如何解决这个问题.

我不知道在项目资源管理器中的外部库中我实际上可以看到它gensim.models.doc2vec实际存在.那么为什么PyCharm仍然在这里抱怨?


在此输入图像描述


更新

我注意到以下内容:在包中gensim.models我看到该文件doc2vec.py未标记为Python文件!请注意右侧没有语法突出显示!奇怪的是,该目录中的所有其他文件实际上都被正确识别!

在此输入图像描述

这些是文件权限 /usr/local/lib/python2.7/dist-packages/gensim/models

drwxr-sr-x 3 root staff   4096 Oct 23  2015 .
drwxr-sr-x 9 root staff   4096 Oct 23  2015 ..
-rw-r--r-- 1 root staff 570651 Oct 23  2015 doc2vec_inner.c
-rw-r--r-- 1 root staff  26872 Oct 23  2015 doc2vec_inner.pyx
-rwxr-xr-x 1 root staff 473658 Oct 23  2015 doc2vec_inner.so
-rw-r--r-- 1 root staff  37304 Oct 23  2015 doc2vec.py
-rw-r--r-- 1 root staff  35822 Oct 23  2015 doc2vec.pyc
-rw-r--r-- 1 root staff  23000 Oct 23  2015 hdpmodel.py
-rw-r--r-- 1 root staff  21250 Oct 23  2015 hdpmodel.pyc
-rw-r--r-- 1 root staff   1920 Oct 23  2015 __init__.py
-rw-r--r-- 1 root staff   2697 Oct 23  2015 __init__.pyc
-rw-r--r-- 1 root staff   6724 Oct 23  2015 lda_dispatcher.py
-rw-r--r-- 1 root staff   7451 Oct 23  2015 lda_dispatcher.pyc
-rw-r--r-- 1 root staff  37778 Oct 23  2015 ldamodel.py
-rw-r--r-- 1 root staff  32106 Oct 23  2015 ldamodel.pyc
-rw-r--r-- 1 root staff  12478 Oct 23  2015 ldamulticore.py
-rw-r--r-- 1 root staff  11924 Oct 23  2015 ldamulticore.pyc
-rw-r--r-- 1 root staff   4079 Oct 23  2015 lda_worker.py
-rw-r--r-- 1 root staff   5067 Oct 23  2015 lda_worker.pyc
-rw-r--r-- 1 root staff   4239 Oct 23  2015 logentropy_model.py
-rw-r--r-- 1 root staff   4452 Oct 23  2015 logentropy_model.pyc
-rw-r--r-- 1 root staff   7100 Oct 23  2015 lsi_dispatcher.py
-rw-r--r-- 1 root staff   7518 Oct 23  2015 lsi_dispatcher.pyc
-rw-r--r-- 1 root staff  34968 Oct 23  2015 lsimodel.py
-rw-r--r-- 1 root staff  27309 Oct 23  2015 lsimodel.pyc
-rw-r--r-- 1 root staff   3793 Oct 23  2015 lsi_worker.py
-rw-r--r-- 1 root staff   4848 Oct 23  2015 lsi_worker.pyc
-rw-r--r-- 1 root staff  10461 Oct 23  2015 phrases.py
-rw-r--r-- 1 root staff   9505 Oct 23  2015 phrases.pyc
-rw-r--r-- 1 root staff   3734 Oct 23  2015 rpmodel.py
-rw-r--r-- 1 root staff   4002 Oct 23  2015 rpmodel.pyc
-rw-r--r-- 1 root staff   6372 Oct 23  2015 tfidfmodel.py
-rw-r--r-- 1 root staff   6100 Oct 23  2015 tfidfmodel.pyc
-rw-r--r-- 1 root staff    310 Oct 23  2015 voidptr.h
-rw-r--r-- 1 root staff 517311 Oct 23  2015 word2vec_inner.c
-rwxr-xr-x 1 root staff  22906 Oct 23  2015 word2vec_inner.pyx
-rwxr-xr-x 1 root staff 357937 Oct 23  2015 word2vec_inner.so
-rw-r--r-- 1 root staff  72866 Oct 23  2015 word2vec.py
-rw-r--r-- 1 root staff  62243 Oct 23  2015 word2vec.pyc
drwxr-sr-x 2 root staff   4096 Oct 23  2015 wrappers
Run Code Online (Sandbox Code Playgroud)

这里是我的全部内容doc2vec.py.

小智 1

请检查您是否意外地从 doc2vec.py 文件中删除了部分代码,因为奇怪的是 pycharm 可以给出该文件的直接路径但无法读取它。另一件可能发生但完全奇怪的事情是关于权限的事情,也许你已经更改了这个文件夹的权限,现在 pycharm 没有读取这个文件的权限?