Python Forum
Installing Numpy on Raspberry Pi
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing Numpy on Raspberry Pi
#1
Hi!

I'm trying to use numpy with python3 on my Rasspberry Pi, but I'm not able to import the module after I installed it with sudo apt install python3-numpy, see below.

Installing numpy:
pi@raspberrypi:~ $ sudo apt install python3-numpy
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
gfortran python-numpy-doc python3-dev python3-nose python3-numpy-dbg
The following NEW packages will be installed:
python3-numpy
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/1,693 kB of archives.
After this operation, 9,492 kB of additional disk space will be used.
Selecting previously unselected package python3-numpy.
(Reading database ... 129861 files and directories currently installed.)
Preparing to unpack .../python3-numpy_1%3a1.12.1-3_armhf.deb ...
Unpacking python3-numpy (1:1.12.1-3) ...
Setting up python3-numpy (1:1.12.1-3) ...
Processing triggers for man-db (2.7.6.1-2) ...


Afterwards I try to import numpy, but it fails:
pi@raspberrypi:~ $ python3
Python 3.6.3 (default, Mar 28 2020, 15:16:40)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'


What am I doing wrong? Could you please help me?

Tahnk's in advance,

Johannes
Reply
#2
Why not use pip?

I wouldn't be surprised if you have two Python 3 versions installed on your system, and that's the issue. I bet this would work:
$ python3 -m pip install numpy
Reply
#3
(Apr-03-2020, 06:17 PM)micseydel Wrote: Why not use pip?

I wouldn't be surprised if you have two Python 3 versions installed on your system, and that's the issue. I bet this would work:
$ python3 -m pip install numpy

Thank's alot! Unfortimateöy aösp üip fials on my Raspi:
pi@raspberrypi:~ $ sudo python3 -m pip install --index-url=https://pypi.python.org/simple/   numpy
Error:
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available.
What could I do?

Thanks in advance Smile ! Johannes
Reply
#4
Try this then try to install again.
python3 -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip
pip3 can also work alone,may need to install it.
# Install
sudo apt-get update
sudo apt install python3-pip

# Test with:
pip3 -V 

# Not using sudo
pip3 install --user numpy 
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Installing Older Version Of Numpy & Pandas knight2000 6 1,754 Aug-30-2023, 10:58 AM
Last Post: knight2000
  Installing Numpy multiple locations dwhe 4 3,132 Dec-21-2019, 02:02 AM
Last Post: dwhe
  Problem installing numpy and matplotlib achondrite 1 3,117 Jan-16-2019, 11:43 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020