How to fix pip no such option: -U

Problem:

You want to install a python library using, for example

example.sh
pip -U install ansicolors

However the library does not install and you instead see the following error message:

example.txt
Usage:   
  pip <command> [options]

no such option: -U

Solution

You need to put -U afterinstall:

example.sh
pip install -U ansicolors

 


Check out similar posts by category: Python