{"id":12448,"date":"2021-11-28T18:33:30","date_gmt":"2021-11-28T18:33:30","guid":{"rendered":"https:\/\/linuxways.net\/?p=12448"},"modified":"2021-11-28T18:33:30","modified_gmt":"2021-11-28T18:33:30","slug":"how-to-install-numpy-on-ubuntu-20-04-lts","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-numpy-on-ubuntu-20-04-lts\/","title":{"rendered":"How to Install NumPy on Ubuntu 20.04 LTS"},"content":{"rendered":"<p>Written in Python and C, <a href=\"https:\/\/numpy.org\/doc\/stable\/user\/whatisnumpy.html\">Numpy<\/a> is a popular Python library used for scientific computing. It&#8217;s hugely popular in data science and a de facto standard for handling numerical data in Python programming. Numpy API is extensively used in other Python libraries such as matplotlib, SciPy, Pandas and so many more.<\/p>\n<p>In this guide, we will demonstrate how to install Numpy on Ubuntu 20.04.<\/p>\n<h2><strong>Step 1: Install PIP package manager<\/strong><\/h2>\n<p>The easiest route to install Numpy is to use the pip utility which is one of the most widely-used Python package managers. But first, update your system as shown.<\/p>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<p>To install pip first ensure Python is installed. Thankfully, Python3 is installed by default in Ubuntu 20.04. You can confirm this by running the command:<\/p>\n<pre><strong>$ python3 -V<\/strong><\/pre>\n<p>OR<\/p>\n<pre><strong>$ python3 --version<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"575\" height=\"108\" class=\"wp-image-12449\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-516.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-516.png 575w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-516-300x56.png 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/strong><\/p>\n<p>Next, install <strong>pip3 <\/strong>as follows:<\/p>\n<pre><strong>$ sudo apt install python3-pip<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"289\" class=\"wp-image-12450\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-517.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-517.png 898w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-517-300x97.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-517-768x247.png 768w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\" \/><\/p>\n<p>Once installed, confirm the version of pip installed:<\/p>\n<pre><strong>$ pip3 --version<\/strong><\/pre>\n<p>This displays not only the version of PIP but also the binary location of the package.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"110\" class=\"wp-image-12451\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-518.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-518.png 680w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-518-300x49.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<h2><strong>Step 2: Install Numpy on Ubuntu 20.04<\/strong><\/h2>\n<p>With PIP installed, the next course of action is to install Numpy. To do this, execute the command:<\/p>\n<pre><strong>$ sudo apt install python3-numpy<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"333\" class=\"wp-image-12452\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-519.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-519.png 875w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-519-300x114.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-519-768x292.png 768w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/p>\n<p>When the installation of Numpy is done, verify the version of Numpy installed as follows<\/p>\n<pre><strong>$ python3 -c \u201cimport print; print(numpy.__version__)\u201d<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"696\" height=\"123\" class=\"wp-image-12453\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-520.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-520.png 696w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-520-300x53.png 300w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><\/p>\n<p>Alternatively, you can access the Python shell:<\/p>\n<pre><strong>$ python3<\/strong><\/pre>\n<p>Import Numpy<\/p>\n<pre><strong>&gt;&gt;&gt; import numpy<\/strong><\/pre>\n<p>Next, check the version of Numpy installed:<\/p>\n<pre><strong>print(numpy.__version__)<\/strong><\/pre>\n<p>Note that the underscores are double underscores and not single underscores.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"154\" class=\"wp-image-12454\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-521.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-521.png 660w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-521-300x70.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p>If you wish to upgrade Numpy in the future, simply run:<\/p>\n<pre><strong>$ pip3 install --upgrade numpy<\/strong><\/pre>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>And there you go! We have successfully installed Numpy on Ubuntu 20.04. Your thoughts and feedback on this guide are welcome.<\/p>","protected":false},"excerpt":{"rendered":"<p>Written in Python and C, Numpy is a popular Python library used for scientific computing. It&#8217;s hugely popular in data science and a de facto standard for handling&hellip;<\/p>","protected":false},"author":1,"featured_media":12522,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[707,100],"class_list":["post-12448","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-numpy","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=12448"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12448\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/12522"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=12448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=12448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=12448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}