使用python IntelliJ运行';即使使用相同的解释器从shell运行也不起作用
即使使用相同的解释器从shell运行程序,在IntelliJ中使用python运行程序也不起作用 IntelliJ自动完成并引用相关模块工作 我使用virtualenvwrapper add2virtualenv命令将路径添加到解释器 导入来自同一项目中的另一个模块,两个模块都配置为使用相同的解释器使用python IntelliJ运行';即使使用相同的解释器从shell运行也不起作用,python,intellij-idea,virtualenv,virtualenvwrapper,Python,Intellij Idea,Virtualenv,Virtualenvwrapper,即使使用相同的解释器从shell运行程序,在IntelliJ中使用python运行程序也不起作用 IntelliJ自动完成并引用相关模块工作 我使用virtualenvwrapper add2virtualenv命令将路径添加到解释器 导入来自同一项目中的另一个模块,两个模块都配置为使用相同的解释器 from rx import Observer ImportError: cannot import name 'Observer' pip冻结的内容 cachetools==2.1.0 cert
from rx import Observer
ImportError: cannot import name 'Observer'
pip冻结的内容
cachetools==2.1.0
certifi==2018.4.16
chardet==3.0.4
click==6.7
Flask==1.0.2
google-auth==1.4.1
idna==2.6
ipaddress==1.0.22
itsdangerous==0.24
Jinja2==2.10
kafka-python==1.4.3
kubernetes==6.0.0
MarkupSafe==1.0
oauthlib==2.1.0
pyasn1==0.4.3
pyasn1-modules==0.2.1
python-dateutil==2.7.3
PyYAML==3.12
requests==2.18.4
requests-oauthlib==0.8.0
rsa==3.4.2
Rx==1.6.1
six==1.11.0
urllib3==1.22
websocket-client==0.47.0
归功于@BurhanKhalid评论 事实证明,我在导入路径(不是直接导入)中有一个名为rx的库,并且使用IntelliJ时发生了冲突。我仍然不明白IntelliJ和shell解释之间为什么有区别
我通过重命名库来修复它。如果您的文件名为
rx.py
,则pip冻结的输出是什么。添加了pip冻结,文件名为arguer;)