{"id":20748,"date":"2023-08-31T18:20:08","date_gmt":"2023-08-31T18:20:08","guid":{"rendered":"https:\/\/linuxways.net\/?p=20748"},"modified":"2023-08-31T21:29:39","modified_gmt":"2023-08-31T21:29:39","slug":"how-to-install-and-remove-pip-on-debian-bookworm","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-install-and-remove-pip-on-debian-bookworm\/","title":{"rendered":"How to Install and Remove Pip on Debian Bookworm ?"},"content":{"rendered":"<p>Pip is the package manager of Python. It allows us to install, update, and delete Python packages. To import packages from the <a href=\"https:\/\/pypi.org\/\">Python Package Index<\/a>, we need to install pip. When we download and install Python, it comes with built-in packages. A list of these packages can be seen at this <a href=\"https:\/\/docs.python.org\/3\/py-modindex.html\">link<\/a>. Other than these built-in packages do not come with Python. These packages are available in the repository of the Python Package Index (PyPI).<\/p>\n<p>This article will describe how to install pip3 in Debian 12 (Bookworm) systems.<\/p>\n<h2>How to Install Pip on Debian 12?<\/h2>\n<p>By using <strong>pip<\/strong> <strong>(Python Install Packages)<\/strong>, install and use packages by importing them into our code using pip. To install pip3 for Python 3, we will execute the following steps:<\/p>\n<h3>Step 1: Launch Terminal<\/h3>\n<p>The first step is to launch Terminal. It can be launched either by using the shortcut Ctrl+Alt+T or by using an Application launcher.<\/p>\n<p>All applications, system components, and files installed on the system are placed in the Application Launcher. The terminal can be launched by the application launcher by pressing the Activities button in the left corner of the screen. Then by typing \u201cTerminal\u201d in the search bar and selecting the Terminal icon:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"441\" class=\"wp-image-20749\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-1.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-1-300x65.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-1-1024x221.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-1-768x165.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-1-1536x331.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>The following screenshot shows how the Terminal looks like on Debian:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1576\" height=\"698\" class=\"wp-image-20750\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-2.png 1576w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-2-300x133.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-2-1024x454.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-2-768x340.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-2-1536x680.png 1536w\" sizes=\"auto, (max-width: 1576px) 100vw, 1576px\" \/><\/p>\n<h3>Step 2: Update apt Sources\/Packages<\/h3>\n<p>It is highly recommended to make sure that all existing packages are up to date before installing any software. This is to avoid dependency issues. We can do that by running the following command as root or user with sudo privileges:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1704\" height=\"558\" class=\"wp-image-20751\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-3.png 1704w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-3-300x98.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-3-1024x335.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-3-768x251.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-3-1536x503.png 1536w\" sizes=\"auto, (max-width: 1704px) 100vw, 1704px\" \/><\/p>\n<h3>Step 3: Install pip for Python 3<\/h3>\n<p>We will install pip3 and all of its dependencies for Python 3 by running the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> python3-pip<\/div><\/div>\n<h2><a id=\"post-20748-_xcf6iv911g9i\"><\/a><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"855\" class=\"wp-image-20752\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-4.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-4-300x125.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-4-1024x428.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-4-768x321.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-4-1536x641.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/h2>\n<p>Press Y at the prompt to continue with the installation process:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"890\" class=\"wp-image-20754\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-5.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-5-300x130.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-5-1024x445.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-5-768x334.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-5-1536x668.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>After pressing Y, the installation will be completed. We can see from the above screenshot that the installation is completed.<\/p>\n<h3>Step 3: Verifying Installation<\/h3>\n<p>We can verify the installation by checking the version of pip3 by running the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span>pip3 <span class=\"re5\">--version<\/span><\/div><\/div>\n<h2><a id=\"post-20748-_6a55g6dj1jg0\"><\/a><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"174\" class=\"wp-image-20755\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-6.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-6-300x25.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-6-1024x87.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-6-768x65.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-6-1536x131.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/h2>\n<h2><a id=\"post-20748-_qhjt1dpe89je\"><\/a>How to Manage Python Packages Using pip3?<\/h2>\n<p>In this section, we will discuss a few pip3 commands to manage Python packages using pip3.<\/p>\n<h3>List<\/h3>\n<p>List command \u201clist\u201d installed Python packages in the pip repository. We can list the installed packages using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span>pip3 list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1780\" height=\"1244\" class=\"wp-image-20756\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-7.png 1780w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-7-300x210.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-7-1024x716.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-7-768x537.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-7-1536x1073.png 1536w\" sizes=\"auto, (max-width: 1780px) 100vw, 1780px\" \/><\/p>\n<h3>Install<\/h3>\n<p>If we need to install a pip3 package, which is not on the list, we can install that package. If we want to use \u201cNumPy\u201d, we can first check if it is installed in our pip3 repository by \u201cpip3 list\u201d:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1818\" height=\"864\" class=\"wp-image-20757\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-8.png 1818w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-8-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-8-1024x487.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-8-768x365.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-8-1536x730.png 1536w\" sizes=\"auto, (max-width: 1818px) 100vw, 1818px\" \/><\/p>\n<p>We can see that Numpy is not installed. So, install Python packages\/modules with all their dependencies by using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> python3-numpy<\/div><\/div>\n<h2><a id=\"post-20748-_2m0o3npqgllj\"><\/a><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"968\" class=\"wp-image-20758\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-9.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-9-300x142.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-9-1024x484.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-9-768x363.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-9-1536x726.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/h2>\n<p>From the above screenshot, it can be seen that the \u201c<strong>numpy<\/strong>\u201d package is installed. We can verify it by again checking the pip3 list:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"889\" class=\"wp-image-20759\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-10.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-10-300x130.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-10-1024x445.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-10-768x333.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-10-1536x667.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>We can see that the \u201cnumpy\u201d package is now installed.<\/p>\n<h3>Show<\/h3>\n<p>If we need to display information about installed packages, we can use the \u201dshow\u201d command as follows:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span>pip3 show beautifulsoup4<\/div><\/div>\n<h2><a id=\"post-20748-_we2hich9mgof\"><\/a><img loading=\"lazy\" decoding=\"async\" width=\"1798\" height=\"632\" class=\"wp-image-20761\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-11.png 1798w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-11-300x105.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-11-1024x360.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-11-768x270.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-11-1536x540.png 1536w\" sizes=\"auto, (max-width: 1798px) 100vw, 1798px\" \/><\/h2>\n<h2>How to Uninstall Pip3 on Debian 12?<\/h2>\n<p>In case, we need to completely uninstall pip3 and all its dependencies from our system, we can use the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt purge python3-pip<\/div><\/div>\n<h1><a id=\"post-20748-_4tzww645xrkn\"><\/a><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"994\" class=\"wp-image-20762\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-12.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-12-300x146.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-12-1024x497.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-12-768x373.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-12-1536x746.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/h1>\n<p>Press Y to continue with the uninstallation. From the screenshot, we can see that pip3 is uninstalled. We can verify the uninstallation of pip3 by the following command:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"183\" class=\"wp-image-20763\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-13.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-13-300x27.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-13-1024x92.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-13-768x69.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20748-13-1536x137.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>From the above screenshot, it can be seen that pip3 is uninstalled successfully.<\/p>\n<h2>Conclusion<\/h2>\n<p>To install pip3 on Debian 12, use the \u201c<strong>sudo apt install python3-pip<\/strong>\u201d command. We can verify the installation by checking the version of pip3 by running the \u201cpip3 &#8211;version\u201d command. This article discussed the installation of pip3 on the Debian 12 (Bookworm) system using the default \u201capt\u201d repository.<\/p>","protected":false},"excerpt":{"rendered":"<p>Pip is the package manager of Python. It allows us to install, update, and delete Python packages. To import packages from the Python Package Index, we need to&hellip;<\/p>","protected":false},"author":110,"featured_media":20760,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-20748","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20748","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\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=20748"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20748\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/20760"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=20748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=20748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=20748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}