Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть How to Get Installed Python Modules Without Version Info Using pip

  • vlogize
  • 2025-08-26
  • 1
How to Get Installed Python Modules Without Version Info Using pip
Is there any way to get the installed modules without version info with pip?pippython packagingpython importlib
  • ok logo

Скачать How to Get Installed Python Modules Without Version Info Using pip бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно How to Get Installed Python Modules Without Version Info Using pip или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку How to Get Installed Python Modules Without Version Info Using pip бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео How to Get Installed Python Modules Without Version Info Using pip

Learn how to list installed Python modules without version numbers using `pip` commands. Perfect for creating auto-upgraders!
---
This video is based on the question https://stackoverflow.com/q/64322829/ asked by the user 'Xbox One' ( https://stackoverflow.com/u/13101893/ ) and on the answer https://stackoverflow.com/a/64322976/ provided by the user 'wim' ( https://stackoverflow.com/u/674039/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions.

Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Is there any way to get the installed modules without version info with pip?

Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l...
The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license.

If anything seems off to you, please feel free to write me at vlogize [AT] gmail [DOT] com.
---
How to Get Installed Python Modules Without Version Info Using pip

If you're working with Python and using pip for package management, you might have realized that when you run the pip freeze command, it lists your installed packages along with their version numbers. While this is usually helpful, there are situations where you only want the names of the modules—particularly if you’re developing an auto-upgrader for your Python packages. In this guide, we will explore how to achieve this on both Linux/macOS and Windows operating systems.

The Problem

When executing the command:

[[See Video to Reveal this Text or Code Snippet]]

You receive an output like this:

[[See Video to Reveal this Text or Code Snippet]]

However, if you only need the module names without the version info, you could be left wondering how to filter it out efficiently.

The Solution

On Linux / macOS

For users operating on Linux or macOS, you can leverage the power of the command line. Here’s how you can extract just the names of the installed Python modules using the awk command in combination with pip freeze:

[[See Video to Reveal this Text or Code Snippet]]

Explanation:

pip freeze: This command outputs the list of installed packages.

|: The pipe operator takes the output of the command on its left (pip freeze) and uses it as the input for the command on its right (awk).

awk -F "==": This specifies the field separator as ==, meaning that awk will recognize the module name and version as different fields.

{ print $1 }: This prints the first field, which corresponds to the module name.

On Windows

If you are on Windows, awk may not be readily available. Thankfully, there is a straightforward Python-based solution you can use. Just run the following command in your command line terminal:

[[See Video to Reveal this Text or Code Snippet]]

Explanation:

pip freeze: Again, this lists the installed packages.

|: This allows the output of pip freeze to feed into the Python process that follows.

py -c "...": This tells Python to execute the code contained within the quotes.

for p in __import__('sys').stdin: This iterates over each line of input being piped.

print(p.split('=')[0]): This splits each line at the = character and prints the first part, which is the module name.

Conclusion

Now that you know how to extract installed Python modules without including their version numbers on both Linux/macOS and Windows, you can easily create scripts for upgrading those modules without hassle. This simple modification can save you time and help streamline your development workflow—especially when maintaining dependencies in complex projects.

Whether you are building an auto-upgrader or just need a clean list of your packages, these commands will come in handy! Happy coding!

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]