{"id":126656,"date":"2022-07-18T19:48:46","date_gmt":"2022-07-18T19:48:46","guid":{"rendered":"https:\/\/blog.finxter.com\/?p=479172"},"modified":"2022-07-18T19:48:46","modified_gmt":"2022-07-18T19:48:46","slug":"how-to-check-future-package-version-in-python","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2022\/07\/18\/how-to-check-future-package-version-in-python\/","title":{"rendered":"How to Check \u2018future\u2019 Package Version in Python?"},"content":{"rendered":"\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-top\" data-payload=\"{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;479172&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;top&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;2&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;5\\\/5 - (2 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}\">\n<div class=\"kksr-stars\">\n<div class=\"kksr-stars-inactive\">\n<div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"kksr-stars-active\" style=\"width: 142.5px;\">\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/div>\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\"> 5\/5 &#8211; (2 votes) <\/div>\n<\/div>\n<p>In this article, I&#8217;ll show you:<\/p>\n<p class=\"has-base-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4ac.png\" alt=\"\ud83d\udcac\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> How to <a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/check-the-package-version-in-python\/\" data-type=\"post\" data-id=\"469309\" target=\"_blank\">check the version<\/a> of the <a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/how-to-write-a-python-module-package\/\" data-type=\"post\" data-id=\"35371\" target=\"_blank\">Python module<\/a> (package, library) <code>future<\/code>? And how to check if <code>future<\/code> is installed anyways?<\/p>\n<p>These are the eight best ways to check the installed version of the Python module <code>future<\/code>:<\/p>\n<ul class=\"has-global-color-8-background-color has-background\">\n<li><strong>Method 1<\/strong>: <code>pip show future<\/code><\/li>\n<li><strong>Method 2<\/strong>: <code>pip list<\/code><\/li>\n<li><strong>Method 3<\/strong>: <code>pip list | findstr future<\/code><\/li>\n<li><strong>Method 4<\/strong>: <code>library.__version__<\/code><\/li>\n<li><strong>Method 5<\/strong>: <code>importlib.metadata.version<\/code><\/li>\n<li><strong>Method 6<\/strong>: <code>conda list<\/code><\/li>\n<li><strong>Method 7<\/strong>: <code>pip freeze<\/code><\/li>\n<li><strong>Method 8<\/strong>: <code>pip freeze | grep future<\/code><\/li>\n<\/ul>\n<p>Before we go into these ways to check your <code>future<\/code> version, let&#8217;s first quickly understand how versioning works in Python&#8212;you&#8217;ll be thankful to have spent a few seconds on this topic, believe me! <\/p>\n<h2>A Note on Python Version Numbering<\/h2>\n<p class=\"has-global-color-8-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><strong>Python versioning<\/strong> adds a unique identifier to different package versions using <strong>semantic versioning<\/strong>. Semantic versioning consists of three numerical units of versioning information in the format <code>major.minor.patch<\/code>.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/versioning_py-1024x576.jpg\" alt=\"Python Version Numbering\" class=\"wp-image-476426\" srcset=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/versioning_py-1024x576.jpg 1024w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/versioning_py-300x169.jpg 300w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/versioning_py-768x432.jpg 768w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/versioning_py.jpg 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<p>In this tutorial, we&#8217;ll use the shorthand general version abbreviation like so:<\/p>\n<pre class=\"wp-block-preformatted\"><code>x.y.z<\/code><\/pre>\n<p>Practical examples would use numerical values for <code>x<\/code>, <code>y<\/code>, and <code>z<\/code>:<\/p>\n<ul>\n<li><code>1.2.3<\/code><\/li>\n<li><code>4.1.4<\/code><\/li>\n<li><code>1.0.0<\/code><\/li>\n<\/ul>\n<p>This is shorthand for<\/p>\n<pre class=\"wp-block-preformatted\"><code>major.minor.patch<\/code><\/pre>\n<ul>\n<li><strong>Major<\/strong> releases (<code><strong>0<\/strong>.1.0<\/code> to <code><strong>1<\/strong>.0.0<\/code>) are used for the first stable release or &#8220;breaking changes&#8221;, i.e., major updates that break backward compatibility.<\/li>\n<li><strong>Minor<\/strong> releases (<code>0.<strong>1<\/strong>.0<\/code> to <code>0.<strong>2<\/strong>.0<\/code>) are used for larger bug fixes and new features that are backward compatible.<\/li>\n<li><strong>Patch<\/strong> releases (<code>0.1.<strong>0<\/strong><\/code> to <code>0.1.<strong>1<\/strong><\/code>) are used for smaller bug fixes that are backward compatible.<\/li>\n<\/ul>\n<p>Let&#8217;s dive into the meat of this article: <\/p>\n<p class=\"has-global-color-8-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4ac.png\" alt=\"\ud83d\udcac\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Question<\/strong>: How to check the (major, minor, patch) version of <code>future<\/code> in your current Python environment?<\/p>\n<h2>Method 1: pip show<\/h2>\n<p class=\"has-pale-cyan-blue-background-color has-background\">To check which version of the Python library <code>future<\/code> is installed, run <code><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/a-guide-of-all-pip-commands\/\" data-type=\"post\" data-id=\"90570\" target=\"_blank\">pip show future<\/a><\/code> or <code>pip3 show future<\/code> in your CMD\/Powershell (Windows), or terminal (macOS\/Linux\/Ubuntu). <\/p>\n<p>This will work if your <a href=\"https:\/\/blog.finxter.com\/installing-specific-package-versions-with-pip\/\" data-type=\"post\" data-id=\"320873\" target=\"_blank\" rel=\"noreferrer noopener\">pip<\/a> installation is version <a rel=\"noreferrer noopener\" title=\"https:\/\/github.com\/pypa\/pip\/blob\/1.3\/CHANGES.txt#L54\" href=\"https:\/\/github.com\/pypa\/pip\/blob\/1.3\/CHANGES.txt#L54\" target=\"_blank\">1.3<\/a> or higher&#8212;which is likely to hold in your case because pip 1.3 was released a decade ago in 2013!! <\/p>\n<p>Here&#8217;s an example in my Windows <a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/powershell-operators\/\" data-type=\"post\" data-id=\"79052\" target=\"_blank\">Powershell<\/a>: I&#8217;ve highlighted the line that shows that my package version is <code>a.b.c<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1, 3\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">PS C:\\Users\\xcent> pip show future\nName: future\nVersion: a.b.c\nSummary: ...\nHome-page: ...\nAuthor: ...\nAuthor-email: ...\nLicense: ...\nLocation: ...\nRequires: ...\nRequired-by: ...<\/pre>\n<p>In some instances, this will not work&#8212;depending on your environment. In this case, try those commands before giving up:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python -m pip show future\npython3 -m pip show future\npy -m pip show future\npip3 show future<\/pre>\n<p>Next, we&#8217;ll dive into more ways to check your <code>future<\/code> version.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"498\" height=\"370\" src=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/WillSmithMagnifyingGlassGIF.gif\" alt=\"\" class=\"wp-image-476368\"\/><\/figure>\n<\/div>\n<p><strong>But before we move on, I&#8217;m excited to present you my new Python book <a rel=\"noreferrer noopener\" href=\"https:\/\/amzn.to\/2WAYeJE\" target=\"_blank\" title=\"https:\/\/amzn.to\/2WAYeJE\">Python One-Liners<\/a><\/strong> (Amazon Link).<\/p>\n<p>If you like one-liners, you&#8217;ll LOVE the book. It&#8217;ll teach you everything there is to know about a <strong>single line of Python code.<\/strong> But it&#8217;s also an <strong>introduction to computer science<\/strong>, data science, machine learning, and algorithms. <strong><em>The universe in a single line of Python!<\/em><\/strong><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/amzn.to\/2WAYeJE\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" width=\"215\" height=\"283\" src=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2020\/02\/image-1.png\" alt=\"\" class=\"wp-image-5969\"\/><\/a><\/figure>\n<\/div>\n<p>The book was released in 2020 with the world-class programming book publisher NoStarch Press (San Francisco). <\/p>\n<p>Link: <a href=\"https:\/\/nostarch.com\/pythononeliners\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/nostarch.com\/pythononeliners<\/a><\/p>\n<\/p>\n<h2>Method 2: pip list<\/h2>\n<p class=\"has-pale-cyan-blue-background-color has-background\">To check the versions of <strong><em>all<\/em><\/strong> installed packages, use <code><a rel=\"noreferrer noopener\" title=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/pip_show\/\" href=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/pip_show\/\" target=\"_blank\">pip list<\/a><\/code> and locate the version of <code>future<\/code> in the output list of package versions sorted alphabetically.<\/p>\n<p>This will work if your pip installation is version <a href=\"https:\/\/github.com\/pypa\/pip\/blob\/1.3\/CHANGES.txt#L54\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"https:\/\/github.com\/pypa\/pip\/blob\/1.3\/CHANGES.txt#L54\">1.3<\/a> or higher.<\/p>\n<p>Here&#8217;s a simplified example for Windows Powershell, I&#8217;ve highlighted the line that shows the package version is <code>1.2.3<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1,6\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">PS C:\\Users\\xcent> pip list\nPackage Version\n--------------- ---------\naaa 1.2.3\n...\nfuture 1.2.3\n...\nzzz 1.2.3<\/pre>\n<p>In some instances, this will not work&#8212;depending on your environment. Then try those commands before giving up:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python -m pip list\npython3 -m pip list\npy -m pip list\npip3 list <\/pre>\n<h2>Method 3: pip list + findstr on Windows<\/h2>\n<p class=\"has-global-color-8-background-color has-background\">To check the versions of <strong><em>a single package <\/em>on Windows<\/strong>, you can chain <code><a rel=\"noreferrer noopener\" title=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/pip_show\/\" href=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/pip_show\/\" target=\"_blank\">pip list<\/a><\/code> with <code>findstr future<\/code> using the CMD or Powershell command: <code>pip3 list | findstr future<\/code> to locate the version of <code>future<\/code> in the output list of package versions automatically.<\/p>\n<p>Here&#8217;s an example for <code>future<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip3 list | findstr future 1.2.3<\/pre>\n<h2>Method 4: Module __version__ Attribute<\/h2>\n<p class=\"has-pale-cyan-blue-background-color has-background\">To check which version is installed of a given <code>library<\/code>, you can use the <code>library.__version__<\/code> attribute after importing the library (package, module) with <code>import library<\/code>.<\/p>\n<p>Here&#8217;s the code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"2\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import my_library\nprint(my_library.__version__)\n# x.y.z for your version output<\/pre>\n<p>Here&#8217;s an excerpt from the <a rel=\"noreferrer noopener\" href=\"https:\/\/peps.python.org\/pep-0396\/\" data-type=\"URL\" data-id=\"https:\/\/peps.python.org\/pep-0396\/\" target=\"_blank\">PEP 8 docs<\/a> mentioning the <code>__version__<\/code> attribute. <\/p>\n<p class=\"has-base-2-background-color has-background\"><em>&#8220;<a href=\"https:\/\/peps.python.org\/pep-0008\">PEP 8<\/a> describes the use of a module attribute called <code>__version__<\/code> for recording &#8220;Subversion, CVS, or RCS&#8221; version strings using keyword expansion. In the PEP author\u2019s own email archives, the earliest example of the use of an <code>__version__<\/code> module attribute by independent module developers dates back to 1995.&#8221;<\/em><\/p>\n<p>You can also use the following <a href=\"https:\/\/blog.finxter.com\/python-one-liners\/\" data-type=\"post\" data-id=\"13555\" target=\"_blank\" rel=\"noreferrer noopener\">one-liner<\/a> snippet to run this from your terminal (macOS, Linux, Ubuntu) or CMD\/Powershell (Windows):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python3 -c \"import my_library; print(my_library.__version__)\"<\/pre>\n<p>However, this method doesn&#8217;t work for all libraries, so while simple, I don&#8217;t recommend it as a general approach for that reason.<\/p>\n<h2>Method 5: importlib.metadata.version<\/h2>\n<p class=\"has-pale-cyan-blue-background-color has-background\">The <code>importlib.metadata<\/code> library provides a general way to check the package version in your Python script via <code><a rel=\"noreferrer noopener\" title=\"https:\/\/docs.python.org\/3\/library\/importlib.metadata.html#distribution-versions\" href=\"https:\/\/docs.python.org\/3\/library\/importlib.metadata.html#distribution-versions\" target=\"_blank\">importlib.metadata.version('future')<\/a><\/code> for library <code>future<\/code>. This returns a string representation of the specific version such as <code>1.2.3<\/code> depending on the concrete version in your environment.<\/p>\n<p>Here&#8217;s the code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"2\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import importlib.metadata\nprint(importlib.metadata.version('future'))\n# 1.2.3<\/pre>\n<h2>Method 6: conda list<\/h2>\n<p class=\"has-global-color-8-background-color has-background\">If you have created your Python environment with Anaconda, you can use <code><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.conda.io\/projects\/conda\/en\/latest\/commands\/list.html\" data-type=\"URL\" data-id=\"https:\/\/docs.conda.io\/projects\/conda\/en\/latest\/commands\/list.html\" target=\"_blank\">conda list<\/a><\/code> to list all packages installed in your (virtual) environment. Optionally, you can add a regular expression using the syntax <code>conda list regex<\/code> to list only packages matching a certain pattern.<\/p>\n<p>How to list all packages in the current environment?<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">conda list<\/pre>\n<p>How to list all packages installed into the environment <code>'xyz'<\/code>?<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">conda list -n xyz<\/pre>\n<p><strong><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/python-regex\/\" data-type=\"post\" data-id=\"6210\" target=\"_blank\">Regex<\/a><\/strong>: How to list all packages starting with <code>'future'<\/code>?<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">conda list '^future'<\/pre>\n<h2>Method 7: pip freeze<\/h2>\n<p>The <code>pip freeze<\/code> command without any option lists all installed Python packages in your environment in alphabetically order (ignoring UPPERCASE or lowercase). You can spot your specific package <code>future<\/code> if it is installed in the environment. <\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip freeze<\/pre>\n<p><strong>Output<\/strong> example (depending on your concrete environment\/installation):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"1,4\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">PS C:\\Users\\xcent> pip freeze\naaa==1.2.3\n...\nfuture==1.2.3\n...\nzzz==1.2.3<\/pre>\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n<p>You can modify or exclude specific packages using the options provided in this screenshot:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"783\" height=\"938\" src=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-62.png\" alt=\"\" class=\"wp-image-469381\" srcset=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-62.png 783w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-62-250x300.png 250w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-62-768x920.png 768w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><figcaption><a href=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/pip_freeze\/\" data-type=\"URL\" data-id=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/pip_freeze\/\" target=\"_blank\" rel=\"noreferrer noopener\">source<\/a><\/figcaption><\/figure>\n<\/div>\n<h2>Method 8: pip freeze + grep on Linux\/Ubuntu\/macOS<\/h2>\n<p class=\"has-global-color-8-background-color has-background\">To check the versions of <strong><em>a single package <\/em>on Linux\/Ubuntu\/macOS<\/strong>, you can chain <code>pip freeze<\/code> with <code>grep future<\/code> using the CMD or Powershell command: <code>pip freeze | grep future<\/code> to programmatically locate the version of your particular package <code>future<\/code> in the output list of package versions.<\/p>\n<p>Here&#8217;s an example for <code>future<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip freeze | grep future\nfuture==1.2.3<\/pre>\n<h2>Related Questions<\/h2>\n<h3>Check future Installed Python<\/h3>\n<p><strong>How to check if <code>future<\/code> is installed in your Python script?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">To check if <code>future<\/code> is installed in your Python script, you can run <code>import future<\/code> in your Python shell and surround it by a <a href=\"https:\/\/blog.finxter.com\/python-try-except-an-illustrated-guide\/\" data-type=\"post\" data-id=\"367118\" target=\"_blank\" rel=\"noreferrer noopener\">try\/except<\/a> to catch a potential <code><a href=\"https:\/\/blog.finxter.com\/fixed-modulenotfounderror-no-module-named-future-3\/\" data-type=\"post\" data-id=\"77670\" target=\"_blank\" rel=\"noreferrer noopener\">ModuleNotFoundError<\/a><\/code>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">try: import future print(\"Module future installed\")\nexcept ModuleNotFoundError: print(\"Module future not installed\")<\/pre>\n<h3>Check future Version Python<\/h3>\n<p><strong>How to check the package version of <code>future<\/code> in Python?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">To check which version of <code>future<\/code> is installed, use <code>pip show future<\/code> or <code>pip3 show future<\/code> in your CMD\/Powershell (Windows), or terminal (macOS\/Linux\/Ubuntu) to obtain the output <code>major.minor.patch<\/code>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip show future # or pip3 show future\n# 1.2.3<\/pre>\n<h3>Check future Version Linux<\/h3>\n<p><strong>How to check my <code>future<\/code> version in Linux?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">To check which version of <code>future<\/code> is installed, use <code>pip show future<\/code> or <code>pip3 show future<\/code> in your Linux terminal.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip show future # or pip3 show future\n# 1.2.3<\/pre>\n<h3>Check future Version Ubuntu<\/h3>\n<p><strong>How to check my <code>future<\/code> version in Ubuntu?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">To check which version of <code>future<\/code> is installed, use <code>pip show future<\/code> or <code>pip3 show future<\/code> in your Ubuntu terminal.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip show future # or pip3 show future\n# 1.2.3<\/pre>\n<h3>Check future Version Windows<\/h3>\n<p><strong>How to check my <code>future<\/code> version on Windows?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">To check which version of <code>future<\/code> is installed, use <code>pip show future<\/code> or <code>pip3 show future<\/code> in your Windows CMD, command line, or PowerShell.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip show future # or pip3 show future\n# 1.2.3<\/pre>\n<h3>Check future Version Mac<\/h3>\n<p><strong>How to check my <code>future<\/code> version on macOS?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">To check which version of <code>future<\/code> is installed, use <code>pip show future<\/code> or <code>pip3 show future<\/code> in your macOS terminal.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip show future # or pip3 show future\n# 1.2.3<\/pre>\n<h3>Check future Version Jupyter Notebook<\/h3>\n<p><strong>How to check my <code>future<\/code> version in my Jupyter Notebook?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">To check which version of <code>future<\/code> is installed, add the line <code>!pip show future<\/code> to your notebook cell where you want to check. Notice the exclamation mark prefix <code>!<\/code> that allows you to run commands in your Python script cell.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">!pip show future<\/pre>\n<p><strong>Output<\/strong>: The following is an example on how this looks for <code>future<\/code> in a Jupyter Notebook cell:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"5\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Package Version\n--------------- ---------\naaa 1.2.3\n...\nfuture 1.2.3\n...\nzzz 1.2.3<\/pre>\n<h3>Check future Version Conda\/Anaconda<\/h3>\n<p><strong>How to check the <code>future<\/code> version in my conda installation?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">Use <code>conda list 'future'<\/code> to list version information about the specific package installed in your (virtual) environment.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">conda list 'future'<\/pre>\n<h3>Check future Version with PIP<\/h3>\n<p><strong>How to check the <code>future<\/code> version with pip?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">You can use multiple commands to check the <code>future<\/code> version with <a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/a-guide-of-all-pip-commands\/\" data-type=\"post\" data-id=\"90570\" target=\"_blank\">PIP<\/a> such as <code>pip show future<\/code>, <code>pip list<\/code>, <code>pip freeze<\/code>, and <code>pip list<\/code>. <\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip show future\npip list\npip freeze\npip list<\/pre>\n<p>The former will output the specific version of <code>future<\/code>. The remaining will output the version information of all installed packages and you have to locate <code>future<\/code> first.<\/p>\n<h3>Check Package Version in VSCode or PyCharm<\/h3>\n<p><strong>How to check the <code>future<\/code> version in VSCode or PyCharm?<\/strong><\/p>\n<p class=\"has-global-color-8-background-color has-background\">Integrated Development Environments (IDEs) such as VSCode or PyCharm provide a built-in terminal where you can run <code>pip show future<\/code> to check the current version of <code>future<\/code> in the specific environment you&#8217;re running the command in.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip show future\npip3 show future pip list\npip3 list pip freeze\npip3 freeze<\/pre>\n<p>You can type any of those commands in your IDE terminal like so:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"560\" src=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-64-1024x560.png\" alt=\"pip IDE check package version\" class=\"wp-image-469483\" srcset=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-64-1024x560.png 1024w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-64-300x164.png 300w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-64-768x420.png 768w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-64-1536x840.png 1536w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2022\/07\/image-64.png 1924w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<h2>Summary<\/h2>\n<p>In this article, you&#8217;ve learned those best ways to check a Python package version:<\/p>\n<ul class=\"has-global-color-8-background-color has-background\">\n<li><strong>Method 1<\/strong>: <code>pip show future<\/code><\/li>\n<li><strong>Method 2<\/strong>: <code>pip list<\/code><\/li>\n<li><strong>Method 3<\/strong>: <code>pip list | findstr future<\/code><\/li>\n<li><strong>Method 4<\/strong>: <code>library.__version__<\/code><\/li>\n<li><strong>Method 5<\/strong>: <code>importlib.metadata.version<\/code><\/li>\n<li><strong>Method 6<\/strong>: <code>conda list<\/code><\/li>\n<li><strong>Method 7<\/strong>: <code>pip freeze<\/code><\/li>\n<li><strong>Method 8<\/strong>: <code>pip freeze | grep future<\/code><\/li>\n<\/ul>\n<p>Thanks for giving us your valued attention &#8212; we&#8217;re grateful to have you here! <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f642.png\" alt=\"\ud83d\ude42\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n<h2>Programmer Humor<\/h2>\n<p class=\"has-global-color-8-background-color has-background\"><em>There are only 10 kinds of people in this world: those who know binary and those who don\u2019t.<br \/><\/em><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f469.png\" alt=\"\ud83d\udc69\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f9d4-200d-2642-fe0f.png\" alt=\"\ud83e\uddd4\u200d\u2642\ufe0f\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><em><br \/>~~~<\/p>\n<p>There are 10 types of people in the world. Those who understand trinary, those who don\u2019t, and those who mistake it for binary.<\/em> <em><br \/><\/em><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f469.png\" alt=\"\ud83d\udc69\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f9d4-200d-2642-fe0f.png\" alt=\"\ud83e\uddd4\u200d\u2642\ufe0f\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f471-200d-2640-fe0f.png\" alt=\"\ud83d\udc71\u200d\u2640\ufe0f\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n<h2>Related Tutorials<\/h2>\n<ul>\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/how-to-check-your-python-version\/\" data-type=\"post\" data-id=\"1371\" target=\"_blank\">How to Check Your Python Version<\/a><\/li>\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/check-the-package-version-in-python\/\" data-type=\"post\" data-id=\"469309\" target=\"_blank\">How to Check Your Module Version<\/a><\/li>\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/python-how-to-import-modules-from-another-folder\/\" data-type=\"post\" data-id=\"19786\" target=\"_blank\">How to Create a Python Module<\/a><\/li>\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/start-learning-python\/\" data-type=\"post\" data-id=\"841\" target=\"_blank\">Start Learning Python<\/a><\/li>\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/freelance-developer\/\" data-type=\"post\" data-id=\"5912\" target=\"_blank\">How to Become a Freelance Developer<\/a><\/li>\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/blog.finxter.com\/a-guide-of-all-pip-commands\/\" data-type=\"URL\" data-id=\"https:\/\/blog.finxter.com\/a-guide-of-all-pip-commands\/\" target=\"_blank\">PIP Commands &#8211; A Simple Guide<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>5\/5 &#8211; (2 votes) In this article, I&#8217;ll show you: How to check the version of the Python module (package, library) future? And how to check if future is installed anyways? These are the eight best ways to check the installed version of the Python module future: Method 1: pip show future Method 2: pip [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[857,41],"tags":[73,468,528],"class_list":["post-126656","post","type-post","status-publish","format-standard","hentry","category-python-tut","category-windows-information","tag-programming","tag-python","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/126656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=126656"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/126656\/revisions"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=126656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=126656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=126656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}