Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tut] How to Check ‘future’ Package Version in Python?

#1
How to Check ‘future’ Package Version in Python?

<div>
<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;}">
<div class="kksr-stars">
<div class="kksr-stars-inactive">
<div class="kksr-star" data-star="1" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" data-star="2" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" data-star="3" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" data-star="4" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" data-star="5" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
</p></div>
<div class="kksr-stars-active" style="width: 142.5px;">
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
</p></div>
</div>
<div class="kksr-legend" style="font-size: 19.2px;"> 5/5 – (2 votes) </div>
</div>
<p>In this article, I’ll show you:</p>
<p class="has-base-background-color has-background"><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f4ac.png" alt="?" 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>
<p>These are the eight best ways to check the installed version of the Python module <code>future</code>:</p>
<ul class="has-global-color-8-background-color has-background">
<li><strong>Method 1</strong>: <code>pip show future</code></li>
<li><strong>Method 2</strong>: <code>pip list</code></li>
<li><strong>Method 3</strong>: <code>pip list | findstr future</code></li>
<li><strong>Method 4</strong>: <code>library.__version__</code></li>
<li><strong>Method 5</strong>: <code>importlib.metadata.version</code></li>
<li><strong>Method 6</strong>: <code>conda list</code></li>
<li><strong>Method 7</strong>: <code>pip freeze</code></li>
<li><strong>Method 8</strong>: <code>pip freeze | grep future</code></li>
</ul>
<p>Before we go into these ways to check your <code>future</code> version, let’s first quickly understand how versioning works in Python—you’ll be thankful to have spent a few seconds on this topic, believe me! </p>
<h2>A Note on Python Version Numbering</h2>
<p class="has-global-color-8-background-color has-background"><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f4a1.png" alt="?" 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>
<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" 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/uplo...00x169.jpg 300w, https://blog.finxter.com/wp-content/uplo...68x432.jpg 768w, https://blog.finxter.com/wp-content/uplo...ing_py.jpg 1280w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>
<p>In this tutorial, we’ll use the shorthand general version abbreviation like so:</p>
<pre class="wp-block-preformatted"><code>x.y.z</code></pre>
<p>Practical examples would use numerical values for <code>x</code>, <code>y</code>, and <code>z</code>:</p>
<ul>
<li><code>1.2.3</code></li>
<li><code>4.1.4</code></li>
<li><code>1.0.0</code></li>
</ul>
<p>This is shorthand for</p>
<pre class="wp-block-preformatted"><code>major.minor.patch</code></pre>
<ul>
<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 “breaking changes”, i.e., major updates that break backward compatibility.</li>
<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>
<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>
</ul>
<p>Let’s dive into the meat of this article: </p>
<p class="has-global-color-8-background-color has-background"><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f4ac.png" alt="?" 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>
<h2>Method 1: pip show</h2>
<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>
<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—which is likely to hold in your case because pip 1.3 was released a decade ago in 2013!! </p>
<p>Here’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’ve highlighted the line that shows that my package version is <code>a.b.c</code>:</p>
<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
Name: future
Version: a.b.c
Summary: ...
Home-page: ...
Author: ...
Author-email: ...
License: ...
Location: ...
Requires: ...
Required-by: ...</pre>
<p>In some instances, this will not work—depending on your environment. In this case, try those commands before giving up:</p>
<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
python3 -m pip show future
py -m pip show future
pip3 show future</pre>
<p>Next, we’ll dive into more ways to check your <code>future</code> version.</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" width="498" height="370" src="https://blog.finxter.com/wp-content/uploads/2022/07/WillSmithMagnifyingGlassGIF.gif" alt="" class="wp-image-476368"/></figure>
</div>
<p><strong>But before we move on, I’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>
<p>If you like one-liners, you’ll LOVE the book. It’ll teach you everything there is to know about a <strong>single line of Python code.</strong> But it’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>
<div class="wp-block-image">
<figure class="aligncenter"><a href="https://amzn.to/2WAYeJE" target="_blank" rel="noopener noreferrer"><img 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>
</div>
<p>The book was released in 2020 with the world-class programming book publisher NoStarch Press (San Francisco). </p>
<p>Link: <a href="https://nostarch.com/pythononeliners" target="_blank" rel="noreferrer noopener">https://nostarch.com/pythononeliners</a></p>
</p>
<h2>Method 2: pip list</h2>
<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>
<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>
<p>Here’s a simplified example for Windows Powershell, I’ve highlighted the line that shows the package version is <code>1.2.3</code>:</p>
<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
Package Version
--------------- ---------
aaa 1.2.3
...
future 1.2.3
...
zzz 1.2.3</pre>
<p>In some instances, this will not work—depending on your environment. Then try those commands before giving up:</p>
<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
python3 -m pip list
py -m pip list
pip3 list </pre>
<h2>Method 3: pip list + findstr on Windows</h2>
<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>
<p>Here’s an example for <code>future</code>:</p>
<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>
<h2>Method 4: Module __version__ Attribute</h2>
<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>
<p>Here’s the code:</p>
<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
print(my_library.__version__)
# x.y.z for your version output</pre>
<p>Here’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>
<p class="has-base-2-background-color has-background"><em>“<a href="https://peps.python.org/pep-0008">PEP 8</a> describes the use of a module attribute called <code>__version__</code> for recording “Subversion, CVS, or RCS” version strings using keyword expansion. In the PEP author’s own email archives, the earliest example of the use of an <code>__version__</code> module attribute by independent module developers dates back to 1995.”</em></p>
<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>
<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>
<p>However, this method doesn’t work for all libraries, so while simple, I don’t recommend it as a general approach for that reason.</p>
<h2>Method 5: importlib.metadata.version</h2>
<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>
<p>Here’s the code:</p>
<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
print(importlib.metadata.version('future'))
# 1.2.3</pre>
<h2>Method 6: conda list</h2>
<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>
<p>How to list all packages in the current environment?</p>
<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>
<p>How to list all packages installed into the environment <code>'xyz'</code>?</p>
<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>
<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>
<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>
<h2>Method 7: pip freeze</h2>
<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>
<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>
<p><strong>Output</strong> example (depending on your concrete environment/installation):</p>
<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
aaa==1.2.3
...
future==1.2.3
...
zzz==1.2.3</pre>
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<p>You can modify or exclude specific packages using the options provided in this screenshot:</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img 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/uplo...50x300.png 250w, https://blog.finxter.com/wp-content/uplo...68x920.png 768w" sizes="(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>
</div>
<h2>Method 8: pip freeze + grep on Linux/Ubuntu/macOS</h2>
<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>
<p>Here’s an example for <code>future</code>:</p>
<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
future==1.2.3</pre>
<h2>Related Questions</h2>
<h3>Check future Installed Python</h3>
<p><strong>How to check if <code>future</code> is installed in your Python script?</strong></p>
<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>
<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")
except ModuleNotFoundError: print("Module future not installed")</pre>
<h3>Check future Version Python</h3>
<p><strong>How to check the package version of <code>future</code> in Python?</strong></p>
<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>
<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
# 1.2.3</pre>
<h3>Check future Version Linux</h3>
<p><strong>How to check my <code>future</code> version in Linux?</strong></p>
<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>
<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
# 1.2.3</pre>
<h3>Check future Version Ubuntu</h3>
<p><strong>How to check my <code>future</code> version in Ubuntu?</strong></p>
<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>
<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
# 1.2.3</pre>
<h3>Check future Version Windows</h3>
<p><strong>How to check my <code>future</code> version on Windows?</strong></p>
<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>
<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
# 1.2.3</pre>
<h3>Check future Version Mac</h3>
<p><strong>How to check my <code>future</code> version on macOS?</strong></p>
<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>
<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
# 1.2.3</pre>
<h3>Check future Version Jupyter Notebook</h3>
<p><strong>How to check my <code>future</code> version in my Jupyter Notebook?</strong></p>
<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>
<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>
<p><strong>Output</strong>: The following is an example on how this looks for <code>future</code> in a Jupyter Notebook cell:</p>
<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
--------------- ---------
aaa 1.2.3
...
future 1.2.3
...
zzz 1.2.3</pre>
<h3>Check future Version Conda/Anaconda</h3>
<p><strong>How to check the <code>future</code> version in my conda installation?</strong></p>
<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>
<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>
<h3>Check future Version with PIP</h3>
<p><strong>How to check the <code>future</code> version with pip?</strong></p>
<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>
<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
pip list
pip freeze
pip list</pre>
<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>
<h3>Check Package Version in VSCode or PyCharm</h3>
<p><strong>How to check the <code>future</code> version in VSCode or PyCharm?</strong></p>
<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’re running the command in.</p>
<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
pip3 show future pip list
pip3 list pip freeze
pip3 freeze</pre>
<p>You can type any of those commands in your IDE terminal like so:</p>
<div class="wp-block-image">
<figure class="aligncenter size-large"><img 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/uplo...00x164.png 300w, https://blog.finxter.com/wp-content/uplo...68x420.png 768w, https://blog.finxter.com/wp-content/uplo...36x840.png 1536w, https://blog.finxter.com/wp-content/uplo...age-64.png 1924w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>
<h2>Summary</h2>
<p>In this article, you’ve learned those best ways to check a Python package version:</p>
<ul class="has-global-color-8-background-color has-background">
<li><strong>Method 1</strong>: <code>pip show future</code></li>
<li><strong>Method 2</strong>: <code>pip list</code></li>
<li><strong>Method 3</strong>: <code>pip list | findstr future</code></li>
<li><strong>Method 4</strong>: <code>library.__version__</code></li>
<li><strong>Method 5</strong>: <code>importlib.metadata.version</code></li>
<li><strong>Method 6</strong>: <code>conda list</code></li>
<li><strong>Method 7</strong>: <code>pip freeze</code></li>
<li><strong>Method 8</strong>: <code>pip freeze | grep future</code></li>
</ul>
<p>Thanks for giving us your valued attention — we’re grateful to have you here! <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<h2>Programmer Humor</h2>
<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’t.<br /></em><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f469.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f9d4-200d-2642-fe0f.png" alt="?‍♂️" class="wp-smiley" style="height: 1em; max-height: 1em;" /><em><br />~~~</p>
<p>There are 10 types of people in the world. Those who understand trinary, those who don’t, and those who mistake it for binary.</em> <em><br /></em><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f469.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f9d4-200d-2642-fe0f.png" alt="?‍♂️" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f471-200d-2640-fe0f.png" alt="?‍♀️" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<h2>Related Tutorials</h2>
<ul>
<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>
<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>
<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>
<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>
<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>
<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 – A Simple Guide</a></li>
</ul>
</div>


https://www.sickgaming.net/blog/2022/07/...in-python/
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016