Synology – Installing Python PIP package installer

A simple recipe for installing the pip utility that is needed to install Python packages/Modules:

This needs to be done with the user root so ssh to the Diskstation with that user.

1st) Install Python from the Package Installer Web interface. I have Python 2.7 installed

2nd) Connect to your Synology NAS through ssh.

3rd) Get the pip installer: wget

4th) Execute the installer: python It will take a while:

 # python 
Collecting pip
  Downloading pip-8.0.2-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 42kB/s 
Collecting setuptools
  Downloading setuptools-19.6-py2.py3-none-any.whl (472kB)
    100% |████████████████████████████████| 475kB 109kB/s 
Collecting wheel
  Downloading wheel-0.26.0-py2.py3-none-any.whl (63kB)
    100% |████████████████████████████████| 65kB 291kB/s 
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-8.0.2 setuptools-19.6 wheel-0.26.0

We can now execute the pip command:

# pip

  pip  [options]

  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  help                        Show help for commands.

Now we can install the modules that we need.

For example, installing paho-mqtt for MQTT support:

# pip install paho-mqtt
Collecting paho-mqtt
  Downloading paho-mqtt-1.1.tar.gz (41kB)
    100% |████████████████████████████████| 45kB 589kB/s 
Building wheels for collected packages: paho-mqtt
  Running bdist_wheel for paho-mqtt ... done
  Stored in directory: /var/services/homes/root/.cache/pip/wheels/97/db/5f/1ddca8ee2f9b58f9bb68208323bd39bb0b177f32f434aa4b95
Successfully built paho-mqtt
Installing collected packages: paho-mqtt
Successfully installed paho-mqtt-1.1

And we can use now the paho.mqtt module on our python programs.

11 thoughts on “Synology – Installing Python PIP package installer

  1. Are you installing pip on the default root administrator directory? I’m getting the following error after running wget:

    Connecting to||:443… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 1511867 (1.4M) [text/x-python] Permission denied
    Cannot write to ‘’ (Success).

  2. Thanks a lot for this information. Paho.mqtt runs now like a charm on my DS416play.
    Saudações de Holanda.

  3. This is nice, thanks. I used it and it worked for me.

    However, when the next DSM came down the line and I allowed my box to update, it seems to have wiped out ‘pip’ and the modules I’d previously downloaded. Is this unavoidable or did I do something incorrectly?

    1. It also happens to me, but I’m not sure if it happens with all updates, or only Python related ones.

  4. Just to add/mention something:
    I installed Python3 from Synology packages…
    the PIP install can be done with python3.5 but u won’t find something like pip3.5 its always 2.7
    you can find the correct pip binary at:

    I even don’t if pip is already installed with 3.5 I didn’t check that beforehand….

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.