Have you already a running Python installation? If not check this guide: https://realpython.com/installing-python Note: due to End-of-life for Python 2, Python 3.6+ is required.
On macOS and Linux, the installation via pip is recommended.
Best way is to install it for your user only:
pip3 install dhis2-pocket-knife --user --upgrade
if it failed, it might be that you are running pip
- repeat the same with pip
instead of pip3
.
If it is still not working you may not have an installed Python 3 version on your machine.
By providing the --user
argument you don't clutter your system installation (which might be really bad), but it
might be that you see a message like dhis2-pk could not be found
. To fix
this you need to modify your Python PATH - see below.
This guide applies to if you have installed it with the --user
flag only.
Open a terminal and paste the following
echo "export PATH=$(python3 -m site --user-base)/bin:${PATH}" >> ~/.bash_profile && source ~/.bash_profile && dhis2-pk
If it shows the dhis2-pk help page all is set. More info on installations to the User Site on packaging.python.org
pip3 show dhis2-pocket-knife
and compare it with the most recent release:
There is a changelog for each (recent) release too.
pip3 install dhis2-pocket-knife --user --upgrade
On Windows there are two options:
Either install it with pip
as well, but it requires to install Python 3.6+ first.
This guide can help.
Make sure you tick the box for "Add Python3.X to path" during the Python 3 installation process.
Alternatively, download and run an executable file.
- Download dhis2-pk.zip from the releases page > Assets.
- Extract the zip file
- In Windows, search for the app PowerShell or the Command Prompt and change (
cd
) to the directory where you downloaded and extracted the ZIP file. - In there you can run dhis2-pk, e.g.:
.\dhis2-pk.exe share --help
(see screenshot below)
Note: dhis2-pk share ...
will not work as it must related to the .exe downloaded, so the .\dhis2-pk.exe
is required.
In the command-line, do not use single apostrophes '
- use the PowerShell app OR
- use double apostrophes
"
OR - use no apostrophes at all (no problem when not having whitespaces in filters)