close

How to downgrade numpy?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to downgrade numpy in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to downgrade numpy?

  1. How to downgrade numpy?

    You can downgrade using the –upgrade flag it works both ways e.g
    pip install --upgrade numpy==1.10.1

  2. downgrade numpy

    You can downgrade using the –upgrade flag it works both ways e.g
    pip install --upgrade numpy==1.10.1

Method 1

You are likely confused between python2, python3, and different python virtual environments.

This is the most reliable source, in your case

$ python
>>> import numpy
>>> numpy.__version__
'1.14.5'

To upgrade/downgrade numpy, you need to use pip that corresponds to the python that you are using. I think you are using python 2.7. Look around for a pip executable that corresponds to the installed package at /usr/local/lib/python2.7/dist-packages/pip.

This is not the “right” way, but it will work

python -m pip install numpy==x.y.z
  • python will just correspond to python interpreter you are using
  • -m pip will find the right pip that corresponds to your installation of python 2.7
  • numpy==x.y.z will force the downgrade

Now, you will probably run into permissions problems that will tempt you to use sudo. At that point, you can either try adding the --user flag … but if you really have to use sudo, then consider creating a virtualenv. (Please.)

Probably The Right Thing to Do

Others have commented on this: maybe your indices are actually not integers.

Find the places in your code that is indexing into a list, and make sure that are actually integers.

assert isinstance(a, int), 'a must be an int'
assert isinstance(b, int), 'b must be an int'
x = y[a:b]

Keep adding those type assertions until you find the bug.

Method 2

You can downgrade using the –upgrade flag it works both ways e.g

pip install --upgrade numpy==1.10.1

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read