How to install numpy to Python 3.5?

How to install numpy to Python 3.5?

Although using virtual environment is advisable in many use-cases, it is not strictly required. You can have a system python3.5 and a pip installation associated with it.

Note that Python 3.5 is now end-of-life and pip has now dropped support. The final version of pip supporting Python 3.5 was 20.3.4 (Jan 2021).

  1. Download this file: pip-20.3.4-py2.py3-none-any.whl
  2. Bootstrap a pip installation using the wheel file: sudo python3.5 pip-20.3.4-py2.py3-none-any.whl/pip install pip-20.3.4-py2.py3-none-any.whl
  3. Install numpy with python3.5 -m pip install --user numpy

I strongly recommend using a virtual environment and in the case of the scientific Python stack, I further recommend using anaconda. It will save you loads of headaches in the future.

  1. Download anaconda for Python3.5.
  2. Create an environment.
  3. Activate it.
  4. conda install numpy.

Step 2 looks like this:

conda create --name env_name numpy

Step 3 looks like this:

source activate env_name

Step 4 looks like this:

conda install numpy

Now, anytime you want to use numpy or any other dependency in your environment, you just do source activate env_name.

To deactivate, do:

source deactivate

How to install numpy to Python 3.5?

Leave a Reply

Your email address will not be published. Required fields are marked *