2

I'm having trouble importing plotly using pip install. The error I get is as follows:

 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.

I'm very new to programming, so I simply tried this in the windows command prompt and it said "pip is not recognized as an internal or external command, operable program, or batch file". I'm using Spyder if that helps, but I'm not sure what I'm missing here.

Thanks for your help.

user2744315
  • 67
  • 1
  • 1
  • 7
  • Possible duplicate of ['pip' is not recognized as an internal or external command](https://stackoverflow.com/questions/23708898/pip-is-not-recognized-as-an-internal-or-external-command) – phd Apr 30 '18 at 18:05

4 Answers4

4

I guess you forgot to put ! before pip. try:

!pip install plotly

in your notebook, should work.

Nicolas Gervais
  • 21,923
  • 10
  • 61
  • 96
Salman
  • 43
  • 4
2

For windows the cleanest way to install a python package is to:

python -m pip install [packagename]

This removes the ambiguity if pip is added to the path variable or not.

Abhisek Rana
  • 46
  • 1
  • 5
1

If you are getting below error while installing any python packages in window using command "pip install packageName".

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/

solution: add "!" at beginning of pip

!pip install configobj(packageName)

It will work. It worked in my case.

0

What worked for me was going to the directory in which Spyder is located, which you can do by searching Spyder on your computer and then right clicking → directory, and then in the directory opening the Anaconda Prompt. In this Prompt you can type in:

pip install [packagename]

and it will work.

double-beep
  • 3,889
  • 12
  • 24
  • 35
Anon
  • 15
  • 6