File: installation.rst

package info (click to toggle)
python-internetarchive 5.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,048 kB
  • sloc: python: 8,208; makefile: 180; xml: 180
file content (84 lines) | stat: -rw-r--r-- 3,572 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.. _install:

Installation
============

Installing ``internetarchive`` with ``pipx``
--------------------------------------------
The ``internetarchive`` library is a Python tool for interacting with the Internet Archive, allowing you to search, download, and upload files. To make it easy to use, we recommend installing it with ``pipx``, a tool that installs Python applications in isolated environments.

**Note**: If you only need the command-line tool and don’t plan to use the Python library, you can download a binary instead. See the :ref:`binaries` section below for more information.

What is ``pipx``?
~~~~~~~~~~~~~~~
``pipx`` is a tool for installing and running Python applications in isolated environments. It ensures that the tools you install don’t interfere with other Python projects or system-wide packages. It’s perfect for CLI tools like ``internetarchive``.

Prerequisites
~~~~~~~~~~~~~
Before installing ``internetarchive``, you’ll need:

1. **Python 3.9 or later**: Python 3.9 is the oldest version still officially supported by the Python development team (as of October 2023). You can check your Python version by running:
   ::

     python --version

   If Python is not installed, download it from `python.org <https://www.python.org/downloads/>`_.
   On MacOS, you can install a `supported version of Python <https://devguide.python.org/versions/>`_ with `Homebrew <https://brew.sh/>`_ (e.g. ``brew install python3``).

2. **`pipx`**: If you don’t have ``pipx`` installed, please refer to the `pipx documentation <https://pipx.pypa.io/stable/installation/>`_ for installation instructions.

Installing ``internetarchive``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Once ``pipx`` is installed, you can install ``internetarchive`` with a single command:
::

  pipx install internetarchive

This will download and install the ``internetarchive`` library in an isolated environment, making it available as a command-line tool.

Verifying the Installation
~~~~~~~~~~~~~~~~~~~~~~~~~~
To confirm that ``internetarchive`` is installed correctly, run:
::

  ia --version

If the installation was successful, this will display the version of ``internetarchive``.

Upgrading ``internetarchive``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To upgrade ``internetarchive`` to the latest version, use:
::

  pipx upgrade internetarchive

Uninstalling ``internetarchive``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you no longer need ``internetarchive``, you can uninstall it with:
::

  pipx uninstall internetarchive

Troubleshooting
~~~~~~~~~~~~~~~
If you encounter any issues:

- **Permission Errors**: Ensure you’re not using ``sudo`` with ``pipx``. It’s designed to work without elevated permissions.
- **Command Not Found**: Restart your terminal after installing ``pipx`` or run ``pipx ensurepath`` again.
- **Python Version Issues**: Ensure you’re using Python 3.9 or later.

For further assistance with ``pipx``, refer to the `pipx documentation <https://pipx.pypa.io/stable/>`_.

.. _binaries:

Binaries
--------

Binaries are also available for the ``ia`` command-line tool::

    $ curl -LOs https://archive.org/download/ia-pex/ia
    $ chmod +x ia

Binaries are generated with `PEX <https://github.com/pantsbuild/pex>`_. The only requirement for using the binaries is that you have a `supported version of Python <https://devguide.python.org/versions/>`_ installed on a Unix-like operating system.

For more details on the command-line interface please refer to the `README <https://github.com/jjjake/internetarchive/blob/master/README.rst>`_, or ``ia help``.