Ich würde gerne für die "top-level destination folders", wie "/bin und /sbin" alternative Pfade verwenden, um nicht mit aus den System-Repos per apt, rpm und Co. installierten Dateien in Konflikt zu geraten. Nach eingehendem Studium der pip - Doku meinte ich den passenden Parameter gefunden zu haben:
https://pip.pypa.io/en/stable/reference ... ion-prefix :
Das klappt auch eigentlich soweit:--prefix <dir>
Installation prefix where lib, bin and other top-level folders are placed
Code: Alles auswählen
~ # python3.6.3 -m pip install -v --prefix=/opt Sphinx
...
Installing collected packages: pytz, babel, MarkupSafe, Jinja2, imagesize, snowballstemmer, sphinxcontrib-websupport, alabaster, docutils, idna, urllib3, chardet, certifi, requests, Sphinx
Creating /opt/bin
changing mode of /opt/bin/pybabel to 755
changing mode of /opt/bin/chardetect to 755
changing mode of /opt/bin/sphinx-apidoc to 755
changing mode of /opt/bin/sphinx-autogen to 755
changing mode of /opt/bin/sphinx-build to 755
changing mode of /opt/bin/sphinx-quickstart to 755
Successfully installed Jinja2-2.10 MarkupSafe-1.0 Sphinx-1.6.5 alabaster-0.7.10 babel-2.5.1 certifi-2017.11.5 chardet-3.0.4 docutils-0.14 idna-2.6 imagesize-0.7.1 pytz-2017.3 requests-2.18.4 snowballstemmer-1.2.1 sphinxcontrib-websupport-1.0.1 urllib3-1.22
Cleaning up...
~ #
Code: Alles auswählen
~ # python3.6.3 -m pip freeze
decorator==4.1.2
ipython==6.2.1
ipython-genutils==0.2.0
jedi==0.11.0
parso==0.1.0
pbr==3.1.1
pexpect==4.3.0
pickleshare==0.7.4
prompt-toolkit==1.0.15
ptyprocess==0.5.2
Pygments==2.2.0
simplegeneric==0.8.1
six==1.11.0
stevedore==1.27.1
traitlets==4.3.2
virtualenv==15.1.0
virtualenv-clone==0.2.6
virtualenvwrapper==4.8.2
wcwidth==0.1.7
~ #
Code: Alles auswählen
~ # python3.6.3
Python 3.6.3 (default, Nov 6 2017, 20:15:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sphinx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sphinx'
>>>
Einfach so den PYTHONPATH ergänzen geht aber auch nicht, da wir Python2 und Python3 parallel betreiben.
Wie erreiche ich, das NUR solche Dateien die normal unter /bin oder /sbin landen würden in einer alternativen Prefixstruktur (/opt(/sbin, /bin)) landen, der Rest jedoch im normalen site-packages ?