Pip and custom prefixes… again! This time it’s Ubuntu’s fault

I wanted to install a Python library to a custom location. Thanks to a long fight with Python on that issue (I can’t believe I haven’t blogged about this!), I know that --prefix does the trick for pip. So I run pip and this happens:

> pip3 install --prefix tmp/ boto3
ERROR: Can not combine '--user' and '--prefix' 
as they imply different installation locations

Alternatively the error is:

distutils.errors.DistutilsOptionError: can't combine user
with prefix, exec_prefix/home, or install_(plat)base

It seems to be an option that Ubuntu adds by default. The magic solution comes from a GNU bug tracker thread:

> pip3 install -U pip

Basically, this installs pip into my user directory (you can find it now in .local/bin/pip). pip3 still fail afterwards with a version mismatch:

> pip3 install --prefix tmp/ boto3
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'

But now I can call my local pip (which is a pip3):

> pip install --prefix tmp/ boto3
Collecting boto3
Successfully installed boto3-1.9.206 botocore-1.12.206

To force a re-install, even if the library is already installed somewhere else, use the flag --ignore-installed.

MacOSX Postinstall – Todo list

Just a list of steps to take after a clean mac os x install, maybe later will be ordered etc.

[ ] Install Little Snitch
Config on gdrive enc container
[ ] Install Little Flocker
Config on gdrive enc container
[ ] Install Launchbar
Config on gdrive enc container
[ ] Put ssh keys in ~/.ssh
[ ] Install gpg key in Mail.app
[ ] Install Firefox and Chrome
[ ] Install Filezilla
[ ] Install Pulse VPN
[ ] Install Remote Desktop Manager Free
Config on gdrive enc container
[ ] Install Skype for Business
[ ] Install Skype (not sure, needs way too much permissions etc.)
[ ] Install apps from AppStore
[ ] Unset natural scrolling
[ ] Install Shades
[ ] Install BTT (Better Touch Tool)
[ ] Install Dropbox
[ ] Install GDrive
[ ] Install OneDrive