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

The documentation lacks too many words (before my eyes) about the parameters for working with the source and recipients. pip

I experienced weird things installing Sphinx with pip3and playing with the options available, apparently to allow me to install it exactly where I wanted (for some reason, I want to have each thing in its own directory). I say "play", not that I did not read the document and did not try --help, but because it pip3 help installdid not help, and the official pip install page documentation is too short and actually says no more than that pip3 help install.

Here are the experiments and observations.

First case with --root

I downloaded the current Sphinx repository tarball , unpacked it, got into the newly created directory and did:

pip3 install --root /home/<user-name>/apps/sphinx -e .

Although it will be the same as, --prefixsince there was no option --prefix, apparently available. To my surprise, he installed the commands in the binPython3 directory (which is also installed locally in his own directory) along with some things in his library directory and strange, instead of the directory /home/<user-name>/apps/sphinx, I get /home/<user-name>/apps/sphinx/home/<user-name>/apps/sphinx/…: he added the specified path to himself.

How especially does the last paragraph make sense? What is the purpose --root?

Second case with --target

Then, if it is not --root, this may be --targetwhy I did (after cleaning):

pip3 install --target /home/<user-name>/apps/sphinx -e .  

This did not work complaining of an unrecognized option --home.

--home ( ), , --target?

--install-option='--prefix=…'

- StackOverflow :

pip3 install --install-option='--prefix=/home/<user-name>/apps/sphinx' -e .

, .pth, - PYTHONPATH, :

export PYTHONPATH=/home/<user-name>/apps/sphinx/lib/python3.4/site-packages
pip3 install --install-option='--prefix=/home/<user-name>/apps/sphinx' -e .

PYTHONPATH , - , ( /t pip PYTHONPATH) , , ).

, , .

:

--editable --src?

# 1

, , .

pip3 install --install-option='--prefix=<install-dir>' -e <repository-dir>

repository-dir Sphinx, Sphinx install-dir, pip3 list, .

,

pip3 install --install-option='--prefix=<install-dir>' Sphinx

, pip3 , Sphinx install-dir, python, pip3 list .

, , .

, ( , , ).

# 2

--root - ( , Debian -). , , , - , , .

+29
1

: PyPI?

sudo pip install sphinx

- setup.py pip, --editable:

-e, --editable <path/url>

(.. setuptools " " ) URL- VCS.

, ( sudo ):

pip3 install -e /path/to/pkg

/path/to/pkg - , setup.py ( ).

:

0

All Articles