8 Essential Ways to Install Python Packages: From easy_install to pipx
This article outlines eight practical methods for installing Python packages—including easy_install, pip, pipx, setup.py, yum, pipenv, poetry, and curl pipelines—providing command examples and usage tips for each approach.
1. Use easy_install
easy_installis an older package installer that is rarely used today. Below are some installation examples:
# Find the latest version on PyPI and install
$ easy_install pkg_name
# Install or upgrade from a specific download page
$ easy_install -f http://pythonpaste.org/package_index.html
# Install from a direct URL
$ easy_install http://example.com/path/to/MyPackage-1.2.3.tgz
# Install from a local .egg file
$ easy_install xxx.egg2. Use pip install
pip is the most common package manager. Use pip install <package> to search and install a package from PyPI.
Some common examples:
$ pip install requests
# Install from a local wheel directory
$ pip install --no-index --find-links=/local/wheels pkg
# Install a specific version
$ pip install pkg==2.1.2
# Install a minimum version
$ pip install pkg>=2.1.2
# Install a maximum version
$ pip install pkg<=2.1.2For more pip usage, see the author’s detailed guide.
3. Use pipx
pipx installs and manages CLI applications in isolated virtual environments.
First install pipx:
$ python3 -m pip install --user pipx
$ python3 -m userpath append ~/.local/binThen install a package: $ pipx install pkg Refer to the author’s article for more pipx usage.
4. Use setup.py
If you have a setup.py file, install the package directly:
# Install from source
$ python setup.py install5. Use yum (rpm packages)
When building a package with setup.py, you can create an RPM using the bdist_rpm option. $ python setup.py bdist_rpm Install the resulting RPM with:
# Using yum
$ yum install pkg
# Using rpm directly
$ rpm -ivh pkg6. Use pipenv
Within a pipenv virtual environment, install a package with:
$ pipenv install pkg7. Use poetry
If you manage dependencies with poetry, install a package using:
# Install a regular dependency
$ poetry add pkg
# Install as a development dependency
$ poetry add pytest --dev8. Use curl + pipe
Some third‑party tools can be installed by piping a script from a URL directly to Python: $ curl -sSL <url> | python For example, poetry can be installed this way:
$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | pythonThese eight methods cover most common ways to install Python packages, from legacy tools to modern environment‑aware installers.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
