0

What's the difference between

pip install numpy

and

pip install --upgrade numpy.

When I tried to use the first one to install the NumPy module in Python 3.5.2, it wasn't recognised, but when I used the second, there were no problems.

1
  • What system are you using? Commented Dec 12, 2016 at 21:11

2 Answers 2

1

Well, the first expression is used to install a new package, numpy in this case, at the last available version (if not specified)

If you want install a particular version, for example the 1.12.0b1, you can use the following command:

pip install numpy==1.12.0b1

Finally, the --upgrade or -U param, upgrades all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.

upgrade-strategy is another parameter that you can find in the relative doc.

Since you don't have added information about errors, is difficult understand what is the real problem. I mean, the expression it wasn't recognised and there were no problems are not very clear. I suggest you to edit you question with some information.

Anyway, I suppose that you have already installed numpy on your pc, maybe in some past attempt. To verify this run the command:

pip freeze

and check if there is numpy in the installed package list.

If yes, I think that this is the reason because pip install numpy doesn't work and instead pip install --upgrade numpy yes. Basically you are not installing numpy but upgrading it, because is already installed.

Let me know.

Sign up to request clarification or add additional context in comments.

Comments

0

First expression just verify if module installed. The installation will stop if module has outdated version. Second expression will install last released or upgrade already installed package to last released version. More info you can get from the docs

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.