• <i id='MePM8'><tr id='MePM8'><dt id='MePM8'><q id='MePM8'><span id='MePM8'><b id='MePM8'><form id='MePM8'><ins id='MePM8'></ins><ul id='MePM8'></ul><sub id='MePM8'></sub></form><legend id='MePM8'></legend><bdo id='MePM8'><pre id='MePM8'><center id='MePM8'></center></pre></bdo></b><th id='MePM8'></th></span></q></dt></tr></i><div id='MePM8'><tfoot id='MePM8'></tfoot><dl id='MePM8'><fieldset id='MePM8'></fieldset></dl></div>
      <bdo id='MePM8'></bdo><ul id='MePM8'></ul>

      <small id='MePM8'></small><noframes id='MePM8'>

      <legend id='MePM8'><style id='MePM8'><dir id='MePM8'><q id='MePM8'></q></dir></style></legend>

        <tfoot id='MePM8'></tfoot>

        如何在 Python 中列出所有已安装的包及其版本?

        时间:2023-09-14

        <small id='RNXGC'></small><noframes id='RNXGC'>

        <i id='RNXGC'><tr id='RNXGC'><dt id='RNXGC'><q id='RNXGC'><span id='RNXGC'><b id='RNXGC'><form id='RNXGC'><ins id='RNXGC'></ins><ul id='RNXGC'></ul><sub id='RNXGC'></sub></form><legend id='RNXGC'></legend><bdo id='RNXGC'><pre id='RNXGC'><center id='RNXGC'></center></pre></bdo></b><th id='RNXGC'></th></span></q></dt></tr></i><div id='RNXGC'><tfoot id='RNXGC'></tfoot><dl id='RNXGC'><fieldset id='RNXGC'></fieldset></dl></div>
      1. <tfoot id='RNXGC'></tfoot>

              <tbody id='RNXGC'></tbody>
            • <bdo id='RNXGC'></bdo><ul id='RNXGC'></ul>

            • <legend id='RNXGC'><style id='RNXGC'><dir id='RNXGC'><q id='RNXGC'></q></dir></style></legend>
                • 本文介绍了如何在 Python 中列出所有已安装的包及其版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  Is there a way in Python to list all installed packages and their versions?

                  I know I can go inside python/Lib/site-packages and see what files and directories exist, but I find this very awkward. What I'm looking for something that is similar to npm list i.e. npm-ls.

                  解决方案

                  If you have pip install and you want to see what packages have been installed with your installer tools you can simply call this:

                  pip freeze
                  

                  It will also include version numbers for the installed packages.

                  Update

                  pip has been updated to also produce the same output as pip freeze by calling:

                  pip list
                  

                  Note

                  The output from pip list is formatted differently, so if you have some shell script that parses the output (maybe to grab the version number) of freeze and want to change your script to call list, you'll need to change your parsing code.

                  这篇关于如何在 Python 中列出所有已安装的包及其版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:是否可以使用两个具有相同名称的 Python 包? 下一篇:setup.py 中 entry_points/console_scripts 和脚本之间的区

                  相关文章

                  最新文章

                    <legend id='4ltYt'><style id='4ltYt'><dir id='4ltYt'><q id='4ltYt'></q></dir></style></legend>

                    <tfoot id='4ltYt'></tfoot>

                    <small id='4ltYt'></small><noframes id='4ltYt'>

                    • <bdo id='4ltYt'></bdo><ul id='4ltYt'></ul>

                    1. <i id='4ltYt'><tr id='4ltYt'><dt id='4ltYt'><q id='4ltYt'><span id='4ltYt'><b id='4ltYt'><form id='4ltYt'><ins id='4ltYt'></ins><ul id='4ltYt'></ul><sub id='4ltYt'></sub></form><legend id='4ltYt'></legend><bdo id='4ltYt'><pre id='4ltYt'><center id='4ltYt'></center></pre></bdo></b><th id='4ltYt'></th></span></q></dt></tr></i><div id='4ltYt'><tfoot id='4ltYt'></tfoot><dl id='4ltYt'><fieldset id='4ltYt'></fieldset></dl></div>