Last active
March 5, 2024 15:32
-
-
Save eneshazr/c59c8564ed7c63460d01d4796cb7d4cc to your computer and use it in GitHub Desktop.
Update All Packages in pip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
TR: Bu kod, pip aracılığıyla yüklü olan tüm Python paketlerini günceller. | |
EN: This code updates all Python packages installed via pip. | |
""" | |
import subprocess | |
# Yüklü paketlerin listesini al | |
outdated_packages = subprocess.check_output(["pip", "list"]).decode("utf-8") | |
outdated_packages = [line.split()[0] for line in outdated_packages.splitlines()[2:]] | |
# Her bir paketi güncelle | |
for package in outdated_packages: | |
result = subprocess.call(["pip", "install", "--upgrade", package], | |
stdout=subprocess.DEVNULL, | |
stderr=subprocess.DEVNULL) | |
if result: | |
print(f"[ X ] {package} paket yüklenemedi.") | |
else: | |
print(f"[ ✓ ] {package} paket güncellendi.") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pip ile yüklü olan tüm modülleri bu kod ile güncelleyebilirsiniz.