Search code examples
pippython-packaging

Bake target path into setup.py


I want to install a wheel into a folder, e.g. /opt

I'm well aware that this could be achieved by

pip install --install-option="--prefix=/opt" $wheel

For design reasons I would like to bake this into my wheel, so I could do

pip install $wheel

instead. I have studied the setup script documentation but have found no reference to such an option.


Solution

  • As far as I know, it is impossible. Even more so if the project is distributed in wheel format.

    Such tasks are better solved at the level of the system package manager of the Linux distribution. We are talking about Linux here, right? So my recommendation is to look into apt/deb, yum/rpm, pacman, etc.