đŠ Installation¶
This section describes how to install the PDS Deep Archive. Because the instructions vary markedly based on platform, itâs divided into two sections:
Unix and Unix-like systems, including Linux and macOS
Windows systems
Unix and Unix-Like Systems¶
Follow the instructions in this section to install the Deep Archive software onto Unix and Unix-like systems. This includes operating systems such as Linux, FreeBSD, OpenBSD, NetBSD, etc., as well as Apple Macintosh systems running macOS.
For users of Windows systems, see the next section, below.
Requirements¶
Prior to installing this software, ensure your system meets the following requirements:
Python 3. This software requires Python 3.9, 3.10, or 3.11. Python 2 will absolutely not work, and indeed Python 2 came to its end of life on the first of January, 2020. Run
python --version
, orpython3 --version
, to check what is installed.libxml2
version 2.9.2; later 2.9 versions are fine. Runxml2-config --version
to find out.libxslt
version 1.1.28; later 1.1 versions are OK too. Runxslt-config
to see.
Consult your operating system instructions or system administrator to install the required packages. For those without system administrator access and are feeling anxious, you could try a local (home directory) Python 3 installation using Miniconda.
Doing the Installation on Unix¶
Note
Some things to be aware of regarding examples below:
The octothorp characters
#
below indicate comments and need not be typed in.The location of where you choose to create a Python virtual environment is entirely your preference.
The examples below should be seen only as suggestions. Invoking command lines below are demonstrative.
Please consult your system documentation for the appropriate invocations for your operating system, command shell (or âterminalâ), and so forth.
The easiest way to install this software is to use Pip, the Python Package
Installer. If you have Python on your system, you probably already have Pip;
you can run pip --help
or pip3 --help
to check.
Itâs best install the PDS Deep Archive into a virtual environment so it wonât interfere withâor be interfered byâother packages. To do so:
# Example assumes bash command shell. For others, consult shell documentation.
mkdir -p $HOME/.virtualenvs
python3 -m venv $HOME/.virtualenvs/pds-deep-archive
source $HOME/.virtualenvs/pds-deep-archive/bin/activate
pip3 install pds.deeparchive
You can then run pds-deep-archive --help
or
pds-deep-registry-archive --help
to get a usage message and ensure
itâs properly installed.
Note
The above commands will install last approved release from the Python Package Index (âCheeseshopâ). The latest, cutting edge release is posted at the Test Package Index, but these releases may not be fully confirmed to be operational. If you like taking risks, run the following to create a new virtual environment and install the latest development version of the software:
mkdir -p $HOME/.virtualenvs
python3 -m venv $HOME/.virtualenvs/pds-deep-archive
source $HOME/.virtualenvs/pds-deep-archive/bin/activate
pip3 install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple`` pds.deeparchive
Windows Installation¶
To install the Deep Archive software on Windows comprises the following steps:
Installing Python 3.11 for Windows
Creating a âvirtual environmentâ to contain an isolated instance of Python 3.11
Installing LXML 4.9.0 for Python 3.11 into the virtual environment
Installing the PDS Deep Archive into the virtual environment
The remainder of this section details these steps.
Installing Python for Windows¶
Python 3.11 (and specifically Python 3.11âno later or earlier versions will work) will need to be installed onto your Windows system. There are several ways to get Python 3.11:
The âMicrosoft Storeâ app
Directly from https://python.org/
Using Anaconda
Using Miniconda
Use whatever is the most familiar to you. If youâre not sure, the Microsoft Store app is probably the easiest. To use the Microsoft Store to install Python 3.11, do the following:
In the Windows taskbarâs search box or Start Menu, open Microsoft Store.
In the search box at the top, type
Python 3.11
In the list of matching results, press the âGetâ button next to Python 3.11.
Tip
If youâre on a managed system, you may need to ask your system administrator to install Python 3.11 for you.
Next, confirm that itâs properly installed by opening Windows PowerShell and
starting Python 3.11 from the command-line. Use the Windows taskbar search
box or Start Menu to launch Windows PowerShell, then type python3.11
and
press Enter.
Note
If you installed Python from https://python.org/ or using Anaconda or
Miniconda, the command you enter may be python3
or even simply
python
instead of python3.11
.
Tip
If entering the python3
or python
commands opens the Microsoft
Store instead, you may need to turn off âapplication execution aliasesâ.
To do so, open the Settings app, choose Apps â Advanced App Settings â
App Execution Aliases. In this list, look for âApp Installer
python.exe
â and âApp Installer python3.exe
â and slide both
switches to âoffâ.
Once you see Pythonâs >>>
prompt, press CTRL+Z then press Enter to exit
Python.
Creating the âVirtual Environmentâ¶
Python supports the notion of âvirtual environmentsâ, which are small installations of Python that are isolated from the systemâs installation. This enables you to install software for different Python applications without interfering dependencies or conflicts. We recommend creating a virtual environment for the Deep Archive software.
To do so, open Windows PowerShell (as above) and at the prompt, type the following command (then press Enter):
python3.11 -m venv pds
Note
If you installed Python from https://python.org/ or using Anaconda or
Miniconda, you may need to replace python3.11
with python3
or
even simply python
.
This will create a subfolder in the current directory called pds
which
contains the virtual environment. Next, youâll need to âactivateâ the virtual
environment by entering the following command (then press Enter):
.\pds\Scripts\activate.ps1
Your PowerShell prompt will change to show (pds)
at the front, indicating
that the virtual environment is now active.
Installing LXML 4.9.0¶
Because the Deep Archive manipulates and parses XML files, the âLXMLâ API for
Python must now be installed into the virtual environment. In the same
Windows PowerShell with the (pds)
prompt, enter the following command
(then press Enter):
pip install https://download.lfd.uci.edu/pythonlibs/archived/lxml-4.9.0-cp311-cp311-win_amd64.whl
This will download and install LXML version 4.9.0 for Python 3.11 for 64-bit Intel/AMD processors for Windows.
Installing PDS Deep Archive¶
Finally, you can install the PDS Deep Archive. As of this writing, version
1.1.5 or later is recommended for Windows. To install it, enter the following
command in the same Windows PowerShell with the (pds)
prompt (then press
Enter):
pip install pds.deeparchive~=1.1.5
Feel free to change the version number in the command as needed.
You can then run pds-deep-archive --help
or
pds-deep-registry-archive --help
to get a usage message and ensure
itâs properly installed.
Upgrading the Software¶
To check and install an upgrade to the software, run the following command in your virtual environment (on Unix and Unix-like systems):
source $HOME/.virtualenvs/pds-deep-archive/bin/activate
pip install --upgrade pds.deeparchive
Or on Windows in PowerShell:
.\pds\Scripts\activate.ps1
pip install --upgrade pds.deeparchive
Note
The same admonitions mentioned earlier about command line invocations also apply to the above examples.