python -m无法找到已安装的模块(ipython)
我有一些我不明白的行为:
python
告诉我我使用/opt/app-root/bin/python
。
当我尝试调用python -m ipython
找不到模块。当我刚运行ipython
时,它只是有效的。我真的不明白为什么会发生这种情况,因为由于/opt/app -root/bin/python
是路径python -m xxx
使用,所以我认为<代码> ipython 和python -m ipython
实际上是相同的命令。我在这里错了吗?
(app-root) bash-4.4# which python
/opt/app-root/bin/python
(app-root) bash-4.4# python -m ipython
/opt/app-root/bin/python: No module named ipython
(app-root) bash-4.4# ipython
Python 3.9.7 (default, Sep 13 2021, 08:18:39)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.3.0 -- An enhanced Interactive Python. Type '?' for help.
I have some behaviour I do not understand:
which python
tells me I use /opt/app-root/bin/python
.
When I try to call python -m ipython
the module is not found. When I just run ipython
it just works. I don´t really understand why this is happening, because since /opt/app-root/bin/python
is the path python -m xxx
uses, I would think ipython
and python -m ipython
are actually the same commands. Am I wrong here?
(app-root) bash-4.4# which python
/opt/app-root/bin/python
(app-root) bash-4.4# python -m ipython
/opt/app-root/bin/python: No module named ipython
(app-root) bash-4.4# ipython
Python 3.9.7 (default, Sep 13 2021, 08:18:39)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.3.0 -- An enhanced Interactive Python. Type '?' for help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论