-1

I recently downloaded anaconda and added it to the environment variables following the question below: anaconda - path environment variable in windows.

I added it as

C:\Users\My_User\Anaconda3

The thing is, I've been trying to install some packages using either pip or conda without luck.

For instance:

pip install seaborn

Return the following

Error output

Does somebody know how can I enable package installation either through pip or conda?

I'm very new to executing commands through cmd and couldn't figure out a better way to type my question, sorry about that

Lucas Abreu
  • 425
  • 3
  • 14
  • 1
    Please do not put code or terminal input/output into images. See here for why: https://meta.stackoverflow.com/a/285557/2449192 – darthbith Jul 23 '19 at 02:21
  • Please consider reading through [the Anaconda documentation](https://docs.anaconda.com/anaconda/). It is a much better resource than following (often outdated) suggestions from StackOverflow answers. Everything you are asking is clearly covered. Also, be aware that you shouldn't be installing packages through `pip` if they are available through `conda` (see ["Using `pip` in a Conda environment"](https://www.anaconda.com/using-pip-in-a-conda-environment/)). – merv Jul 23 '19 at 21:47
  • @darthbith, sorry ! Wasn't aware of that – Lucas Abreu Jul 29 '19 at 21:45
  • @LucasAbreu You can [edit] your post to put the content from the image into the post. – darthbith Jul 30 '19 at 20:15

3 Answers3

1

Step 1: Open Anaconda Navigator navigator

Step 2: Go to Environments and select All packages, to view the list of all packages installed. environment packages

Step 3: Look for seaborn in the Search bar search bar

Install it and see if that works.

If it doesn't then try creating a new environment and installing the seaborn package there. create new environment

Adhish
  • 61
  • 1
  • 1
  • 7
0

Try

python -m pip install seaborn
codingatty
  • 2,026
  • 1
  • 23
  • 32
  • Thanks a lot! Could you tell me what does the "-m" mean, please? – Lucas Abreu Jul 23 '19 at 01:43
  • The real key here is that the python interpreter is directly invoked, rather than counting on "pip" to be recognized as a python script and invoking it indirectly. The "-m" means the operand immediately following is a module to be run as a script; really "python -m pip" and "python pip" are equivalent; but the important part that -m provides is that any operands after the module name are recognized as parameters to the module rather than as parameters to the interpreter. – codingatty Jul 23 '19 at 17:20
  • While this technically overcomes the immediate issue, I'm downvoting because this promotes a discouraged practice that can lead to an unstable Conda env. Conda users should only resort to `pip` if the package is unavailable through `conda` (see ["Using `pip` in a Conda environment"](https://www.anaconda.com/using-pip-in-a-conda-environment/). – merv Jul 23 '19 at 21:58
0

You're getting this error because you're running pip from inside of the Python interpreter when you should be running it from the command line. To exit the Python interpreter, press ctrl+d. Then, make sure you have pip installed and in your PATH and you can try again.

Unsolved Cypher
  • 1,025
  • 10
  • 24