{"id":19,"date":"2023-11-24T23:41:57","date_gmt":"2023-11-25T04:41:57","guid":{"rendered":"https:\/\/coding101.xyz\/?p=19"},"modified":"2023-12-02T20:03:05","modified_gmt":"2023-12-03T01:03:05","slug":"python-pip-commands","status":"publish","type":"post","link":"https:\/\/coding101.xyz\/?p=19","title":{"rendered":"Python PIP Commands"},"content":{"rendered":"\n<p>This is a summary of pip commands that are useful for day to day activity. <\/p>\n\n\n\n<!--more-->\n\n\n\n<!-- HTML generated using hilite.me --><div style=\"background: #f0f0f0; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\"><pre style=\"margin: 0; line-height: 125%\">python -m pip uninstall &lt;packagename&gt;\npython -m pip show &lt;packagename&gt;\npython -m pip list\npython -m pip freeze &gt; requirements.txt\npython -m pip install -r requirements.txt\npython -m pip install --upgrade &lt;packagename&gt;\n<\/pre><\/div>\n\n\n\n<p>python -m pip list &#8211; lists the packages currently installed in the virtual environment<\/p>\n\n\n\n<p><strong>python -m pip freeze &gt; requirements.txt<\/strong> &#8211; takes out all the packages that are required for the current software to work; on each line there is a package name and the version (with = sign in between). The list is done at the console, so you might want to redirect this to a file, for example as mentioned above, to a file called requirements.txt<\/p>\n\n\n\n<p><strong>python -m pip install -r requirements.txt <\/strong>&#8211; well, install the packages that are listed in requirements.txt. Typically this is used when the application is prepared for installation in environment. That is the reason a well curated requirements.txt file MUST be part of the deliverables. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a summary of pip commands that are useful for day to day activity.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/coding101.xyz\/index.php?rest_route=\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coding101.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coding101.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coding101.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coding101.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":3,"href":"https:\/\/coding101.xyz\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":100,"href":"https:\/\/coding101.xyz\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions\/100"}],"wp:attachment":[{"href":"https:\/\/coding101.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coding101.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coding101.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}