<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://serverrental.store/index.php?action=history&amp;feed=atom&amp;title=Python_Package_Management</id>
	<title>Python Package Management - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://serverrental.store/index.php?action=history&amp;feed=atom&amp;title=Python_Package_Management"/>
	<link rel="alternate" type="text/html" href="https://serverrental.store/index.php?title=Python_Package_Management&amp;action=history"/>
	<updated>2026-04-18T08:11:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>https://serverrental.store/index.php?title=Python_Package_Management&amp;diff=2095&amp;oldid=prev</id>
		<title>Admin: Automated server configuration article</title>
		<link rel="alternate" type="text/html" href="https://serverrental.store/index.php?title=Python_Package_Management&amp;diff=2095&amp;oldid=prev"/>
		<updated>2025-04-15T18:48:13Z</updated>

		<summary type="html">&lt;p&gt;Automated server configuration article&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;# Python Package Management&lt;br /&gt;
&lt;br /&gt;
This article details best practices for managing Python packages on servers supporting a MediaWiki installation. Proper package management is crucial for maintaining a stable, secure, and reproducible environment. We will cover virtual environments, pip, and common pitfalls. This guide is geared toward system administrators and developers maintaining MediaWiki infrastructure.&lt;br /&gt;
&lt;br /&gt;
== Why Package Management Matters ==&lt;br /&gt;
&lt;br /&gt;
Without proper package management, installing and updating Python dependencies can quickly become a nightmare. Conflicts between package versions, system-wide installations interfering with MediaWiki, and difficulty reproducing environments are common problems. Using virtual environments and a package manager like pip solves these issues. [[Software configuration]] is directly related to this topic.&lt;br /&gt;
&lt;br /&gt;
== Virtual Environments ==&lt;br /&gt;
&lt;br /&gt;
Virtual environments create isolated Python environments. Each environment has its own set of installed packages, independent of the system-wide Python installation and other virtual environments. This prevents conflicts and ensures reproducibility.&lt;br /&gt;
&lt;br /&gt;
=== Creating a Virtual Environment ===&lt;br /&gt;
&lt;br /&gt;
Use the `venv` module (available in Python 3.3 and later) to create a virtual environment.&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
python3 -m venv /path/to/your/environment&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Replace `/path/to/your/environment` with the desired location for the environment.&lt;br /&gt;
&lt;br /&gt;
=== Activating a Virtual Environment ===&lt;br /&gt;
&lt;br /&gt;
Before installing packages, you must activate the virtual environment. The activation script is located in the environment&amp;#039;s `bin` directory.&lt;br /&gt;
&lt;br /&gt;
*   **Bash/Zsh:**&lt;br /&gt;
    ```bash&lt;br /&gt;
    source /path/to/your/environment/bin/activate&lt;br /&gt;
    ```&lt;br /&gt;
*   **Fish:**&lt;br /&gt;
    ```fish&lt;br /&gt;
    source /path/to/your/environment/bin/activate.fish&lt;br /&gt;
    ```&lt;br /&gt;
*   **Csh/Tcsh:**&lt;br /&gt;
    ```csh&lt;br /&gt;
    source /path/to/your/environment/bin/activate.csh&lt;br /&gt;
    ```&lt;br /&gt;
&lt;br /&gt;
Once activated, your shell prompt will typically be prefixed with the environment name.&lt;br /&gt;
&lt;br /&gt;
=== Deactivating a Virtual Environment ===&lt;br /&gt;
&lt;br /&gt;
To exit the virtual environment, simply type:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
deactivate&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
== Pip: The Python Package Installer ==&lt;br /&gt;
&lt;br /&gt;
Pip is the standard package installer for Python.  It allows you to easily install, upgrade, and remove packages. It works best *within* an activated virtual environment. [[Python]] is the foundation of many MediaWiki extensions.&lt;br /&gt;
&lt;br /&gt;
=== Installing Packages ===&lt;br /&gt;
&lt;br /&gt;
To install a package, use the `pip install` command:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip install &amp;lt;package_name&amp;gt;&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
For example, to install the `requests` library:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip install requests&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
=== Specifying Package Versions ===&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to specify package versions to ensure reproducibility. Use the `==` operator to specify an exact version:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip install requests==2.28.1&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
You can also use other comparison operators like `&amp;gt;` (greater than), `&amp;lt;` (less than), `&amp;gt;=` (greater than or equal to), and `&amp;lt;=` (less than or equal to).&lt;br /&gt;
&lt;br /&gt;
=== Requirements Files ===&lt;br /&gt;
&lt;br /&gt;
For complex projects with many dependencies, use a `requirements.txt` file.  This file lists all the required packages and their versions.&lt;br /&gt;
&lt;br /&gt;
Example `requirements.txt`:&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
requests==2.28.1&lt;br /&gt;
beautifulsoup4==4.11.1&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Install all packages from a requirements file using:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip install -r requirements.txt&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
=== Upgrading Packages ===&lt;br /&gt;
&lt;br /&gt;
To upgrade a package to the latest version:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip install --upgrade &amp;lt;package_name&amp;gt;&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
To upgrade all packages listed in a requirements file:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip install --upgrade -r requirements.txt&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
=== Listing Installed Packages ===&lt;br /&gt;
&lt;br /&gt;
To see a list of all installed packages and their versions:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip list&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Or, for a more detailed output:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip freeze&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
The output of `pip freeze` is commonly used to generate a `requirements.txt` file.&lt;br /&gt;
&lt;br /&gt;
== Common Pitfalls and Best Practices ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Pitfall&lt;br /&gt;
! Solution&lt;br /&gt;
|-&lt;br /&gt;
| Installing packages system-wide&lt;br /&gt;
| Always use virtual environments.&lt;br /&gt;
|-&lt;br /&gt;
| Not specifying package versions&lt;br /&gt;
| Use `requirements.txt` and pin specific versions.&lt;br /&gt;
|-&lt;br /&gt;
| Using `sudo pip install`&lt;br /&gt;
| Avoid using `sudo` with `pip`. It can cause permission issues. Use virtual environments instead.&lt;br /&gt;
|-&lt;br /&gt;
| Ignoring dependency conflicts&lt;br /&gt;
| Carefully review error messages and resolve conflicts by specifying versions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Package Caching ===&lt;br /&gt;
&lt;br /&gt;
Pip caches downloaded packages to speed up subsequent installations.  The cache location varies depending on your operating system.  You can clear the cache using:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
pip cache purge&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
=== Managing Multiple Environments ===&lt;br /&gt;
&lt;br /&gt;
Consider using tools like `virtualenvwrapper` or `conda` to manage multiple virtual environments more effectively. [[System administration]] benefits from these tools.&lt;br /&gt;
&lt;br /&gt;
=== Security Considerations ===&lt;br /&gt;
&lt;br /&gt;
Always verify the source of the packages you install.  Use reputable package indexes like the Python Package Index (PyPI).  Be cautious of typosquatting attacks, where malicious packages are uploaded with names similar to legitimate packages.  Consider using a vulnerability scanner to identify security issues in your dependencies. [[Security]] is paramount.&lt;br /&gt;
&lt;br /&gt;
== Example Server Configuration Table ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component&lt;br /&gt;
! Setting&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Python Version&lt;br /&gt;
| Supported Versions&lt;br /&gt;
| 3.8, 3.9, 3.10&lt;br /&gt;
|-&lt;br /&gt;
| Virtual Environment Location&lt;br /&gt;
| Default Location&lt;br /&gt;
| /opt/mediawiki/venv&lt;br /&gt;
|-&lt;br /&gt;
| Package Manager&lt;br /&gt;
| Preferred Tool&lt;br /&gt;
| pip&lt;br /&gt;
|-&lt;br /&gt;
| Requirements File&lt;br /&gt;
| Location&lt;br /&gt;
| /opt/mediawiki/requirements.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Problem&lt;br /&gt;
! Possible Solution&lt;br /&gt;
|-&lt;br /&gt;
| `ImportError: No module named &amp;lt;module&amp;gt;`&lt;br /&gt;
| Ensure the virtual environment is activated and the package is installed within it.&lt;br /&gt;
|-&lt;br /&gt;
| `pip install` fails with permission errors&lt;br /&gt;
| Do not use `sudo pip install`. Use a virtual environment.&lt;br /&gt;
|-&lt;br /&gt;
| Dependency conflicts&lt;br /&gt;
| Specify specific package versions in `requirements.txt`.&lt;br /&gt;
|-&lt;br /&gt;
| Slow installation times&lt;br /&gt;
| Check your internet connection and consider using a package mirror.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Further Resources ==&lt;br /&gt;
&lt;br /&gt;
*   [Python Virtual Environments Documentation](https://docs.python.org/3/tutorial/venv.html)&lt;br /&gt;
*   [Pip Documentation](https://pip.pypa.io/en/stable/)&lt;br /&gt;
*   [Requirements Files Documentation](https://pip.pypa.io/en/stable/reference/requirements-file-format/)&lt;br /&gt;
*   [[Extension development]] often requires careful package management&lt;br /&gt;
*   [[MediaWiki architecture]] depends on the correct functioning of Python packages.&lt;br /&gt;
*   [[Debugging]] often involves inspecting package versions.&lt;br /&gt;
*   [[Performance optimization]] can be affected by package choices.&lt;br /&gt;
&lt;br /&gt;
[[Category:Server Hardware]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Intel-Based Server Configurations ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Configuration&lt;br /&gt;
! Specifications&lt;br /&gt;
! Benchmark&lt;br /&gt;
|-&lt;br /&gt;
| [[Core i7-6700K/7700 Server]]&lt;br /&gt;
| 64 GB DDR4, NVMe SSD 2 x 512 GB&lt;br /&gt;
| CPU Benchmark: 8046&lt;br /&gt;
|-&lt;br /&gt;
| [[Core i7-8700 Server]]&lt;br /&gt;
| 64 GB DDR4, NVMe SSD 2x1 TB&lt;br /&gt;
| CPU Benchmark: 13124&lt;br /&gt;
|-&lt;br /&gt;
| [[Core i9-9900K Server]]&lt;br /&gt;
| 128 GB DDR4, NVMe SSD 2 x 1 TB&lt;br /&gt;
| CPU Benchmark: 49969&lt;br /&gt;
|-&lt;br /&gt;
| [[Core i9-13900 Server (64GB)]]&lt;br /&gt;
| 64 GB RAM, 2x2 TB NVMe SSD&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Core i9-13900 Server (128GB)]]&lt;br /&gt;
| 128 GB RAM, 2x2 TB NVMe SSD&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Core i5-13500 Server (64GB)]]&lt;br /&gt;
| 64 GB RAM, 2x500 GB NVMe SSD&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Core i5-13500 Server (128GB)]]&lt;br /&gt;
| 128 GB RAM, 2x500 GB NVMe SSD&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Core i5-13500 Workstation]]&lt;br /&gt;
| 64 GB DDR5 RAM, 2 NVMe SSD, NVIDIA RTX 4000&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AMD-Based Server Configurations ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Configuration&lt;br /&gt;
! Specifications&lt;br /&gt;
! Benchmark&lt;br /&gt;
|-&lt;br /&gt;
| [[Ryzen 5 3600 Server]]&lt;br /&gt;
| 64 GB RAM, 2x480 GB NVMe&lt;br /&gt;
| CPU Benchmark: 17849&lt;br /&gt;
|-&lt;br /&gt;
| [[Ryzen 7 7700 Server]]&lt;br /&gt;
| 64 GB DDR5 RAM, 2x1 TB NVMe&lt;br /&gt;
| CPU Benchmark: 35224&lt;br /&gt;
|-&lt;br /&gt;
| [[Ryzen 9 5950X Server]]&lt;br /&gt;
| 128 GB RAM, 2x4 TB NVMe&lt;br /&gt;
| CPU Benchmark: 46045&lt;br /&gt;
|-&lt;br /&gt;
| [[Ryzen 9 7950X Server]]&lt;br /&gt;
| 128 GB DDR5 ECC, 2x2 TB NVMe&lt;br /&gt;
| CPU Benchmark: 63561&lt;br /&gt;
|-&lt;br /&gt;
| [[EPYC 7502P Server (128GB/1TB)]]&lt;br /&gt;
| 128 GB RAM, 1 TB NVMe&lt;br /&gt;
| CPU Benchmark: 48021&lt;br /&gt;
|-&lt;br /&gt;
| [[EPYC 7502P Server (128GB/2TB)]]&lt;br /&gt;
| 128 GB RAM, 2 TB NVMe&lt;br /&gt;
| CPU Benchmark: 48021&lt;br /&gt;
|-&lt;br /&gt;
| [[EPYC 7502P Server (128GB/4TB)]]&lt;br /&gt;
| 128 GB RAM, 2x2 TB NVMe&lt;br /&gt;
| CPU Benchmark: 48021&lt;br /&gt;
|-&lt;br /&gt;
| [[EPYC 7502P Server (256GB/1TB)]]&lt;br /&gt;
| 256 GB RAM, 1 TB NVMe&lt;br /&gt;
| CPU Benchmark: 48021&lt;br /&gt;
|-&lt;br /&gt;
| [[EPYC 7502P Server (256GB/4TB)]]&lt;br /&gt;
| 256 GB RAM, 2x2 TB NVMe&lt;br /&gt;
| CPU Benchmark: 48021&lt;br /&gt;
|-&lt;br /&gt;
| [[EPYC 9454P Server]]&lt;br /&gt;
| 256 GB RAM, 2x2 TB NVMe&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Order Your Dedicated Server ==&lt;br /&gt;
[https://powervps.net/?from=32 Configure and order] your ideal server configuration&lt;br /&gt;
&lt;br /&gt;
=== Need Assistance? ===&lt;br /&gt;
* Telegram: [https://t.me/powervps @powervps Servers at a discounted price]&lt;br /&gt;
&lt;br /&gt;
⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>