我在使用pip install进行绘图时遇到问题。我得到的错误如下:
The following command must be run outside of the IPython shell:
$ pip install plotly
The Python package manager (pip) can only be used from outside of IPython.
Please reissue the `pip` command in a separate terminal or command prompt.
我对编程非常陌生,所以我只是在Windows命令提示符下尝试了这一点,它说" pip不被识别为内部或外部命令,可操作程序或批处理文件" 。如果有帮助,我会使用Spyder,但我不确定我在这里缺少什么。
感谢您的帮助。
答案 0 :(得分:2)
对于Windows,安装python包的最简洁方法是:
python -m pip install [packagename]
如果将pip添加到路径变量,这将消除歧义。
答案 1 :(得分:2)
我猜你忘了放!点之前。 尝试:
!pip install plotly
在笔记本中应该可以工作。
答案 2 :(得分:1)
如果您在使用命令“pip install packageName”在窗口中安装任何 python 包时遇到以下错误。
The following command must be run outside of the IPython shell:
$ pip install configobj
The Python package manager (pip) can only be used from outside of IPython.
Please reissue the `pip` command in a separate terminal or command prompt.
See the Python documentation for more information on how to install packages:
https://docs.python.org/3/installing/
解决办法:加“!”在 pip 的开头
!pip install configobj(packageName)
它会起作用。它在我的情况下有效。
答案 3 :(得分:0)
对我有用的是转到Spyder所在的目录,您可以通过在计算机上搜索Spyder
,然后右键单击→目录,然后在打开Anaconda Prompt的目录中进行操作。在此提示中,您可以输入:
pip install [packagename]
它将起作用。