Pip (python) differences between `–install-option=’–prefix’` and `–root` and `–target`

First and obvious question: why don’t you just install the package from PyPI?

sudo pip install sphinx

If you want to install anything that has a setup.py file with pip you can use the --editable flag:

-e, --editable <path/url>

Install a project in editable mode (i.e. setuptools “develop mode”) from a local project path or a VCS url.

So you can just issue the command (prefix with sudo if necessary):

pip3 install -e /path/to/pkg

where /path/to/pkg is the directory where setup.py can be found (where you extracted the files).

To answer the other questions:

  1. --root <dir> is used to change the root directory of the file system where pip should install package resources, not to change where to find the package.

  2. --target is used to tell pip in which folder to install the package.

  3. --install-option is used to set some variables that will be used by setup.py, not to change where pip should look for the file.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)