Skip to content

Instantly share code, notes, and snippets.

@eneshazr
Last active March 5, 2024 15:32
Show Gist options
  • Save eneshazr/c59c8564ed7c63460d01d4796cb7d4cc to your computer and use it in GitHub Desktop.
Save eneshazr/c59c8564ed7c63460d01d4796cb7d4cc to your computer and use it in GitHub Desktop.
Update All Packages in pip
"""
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.")
@eneshazr
Copy link
Author

eneshazr commented Mar 5, 2024

pip ile yüklü olan tüm modülleri bu kod ile güncelleyebilirsiniz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment