Closed jayvdb closed 5 years ago
If another path needs to be added to the PATH, https://github.com/ofek/userpath is likely to be the solution. That is what pipx is using.
I thought sys.base_prefix
should be writable. In Linux, where does sys.base_prefix
points to?
https://docs.python.org/3/library/sys.html#sys.prefix
Maybe we should use something like:
path.os.dirname(shutil.which("vpip"))
Will try it. Sounds sane.
Hmm. Maybe wont work so well with python -m vpip
In case the vpip
CLI is not in the path, we can fallback to other methods. (Or, maybe we should warn the user and link nothing?)
On Unix, global installs of console scripts attempt to write to /usr/bin.
The script
story
is already installed in/home/jayvdb/.vpip/pkg_venvs/story/bin
, and the next step would be to be create a symlink in/home/jayvdb/.local/bin/
, but instead it is writing to/usr/bin/
which isnt allowed.install.py
includes# TODO: make pip support install_scripts
which may be referring to some part of this problem.However the comment also mentions https://github.com/pypa/pip/issues/3934 , which has a recent comment indicating it has been fixed indirectly, but not in a way that helps with a target-scripts-dir different from the target-dir.
I think it is a good idea to let the scripts be installed into the venv as normal, and then copy them to the
GLOBAL_SCRIPT_FOLDER
. And the global script directory for unix should be~/.local/bin
rather than/usr/bin