Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Handle Python user base scripts directory #772

Closed
bryanburke opened this issue Feb 2, 2020 · 6 comments
Closed

[Request] Handle Python user base scripts directory #772

bryanburke opened this issue Feb 2, 2020 · 6 comments

Comments

@bryanburke
Copy link

bryanburke commented Feb 2, 2020

The Scoop manifest for Python (python.json) does not handle the Python user base scripts directory, so CLI scripts from packages installed in user mode (pip install --user) are not available on the PATH. Performing user installations of packages is considered best practice, and many packages (such as the popular Pipenv) recommend doing them.

Two possible solutions might be:

  1. Construct the user base scripts directory and add it to PATH. The path can be constructed as follows: Join-Path -Path (Split-Path -Path (python -m site --user-site) -Parent) -ChildPath Scripts
  2. Point the PYTHONUSERBASE environment variable to a directory within the Python install directory and persist it.

Related issue: ScoopInstaller/Versions#196

@TheRandomLabs
Copy link
Contributor

A fix for this would be nice.

@Witchilich
Copy link
Contributor

User scripts directory is actually (Split-Path -Parent (python -m site --user-site)) + "\Scripts"

@bryanburke
Copy link
Author

@restia666ashdoll The Join-Path call above joins the path output by Split-Path -Path (python -m site --user-site) -Parent and Scripts. It handles the OS-specific path separator (\ on Windows) and is safer than string concatenation to build paths.

dwettstein added a commit to dwettstein/Main that referenced this issue May 4, 2021
dwettstein added a commit to dwettstein/Main that referenced this issue May 20, 2021
dwettstein added a commit to dwettstein/Main that referenced this issue Jul 5, 2021
dwettstein added a commit to dwettstein/Main that referenced this issue Sep 9, 2021
dwettstein added a commit to dwettstein/Main that referenced this issue Sep 10, 2021
dwettstein added a commit that referenced this issue Sep 10, 2021
* python: persist user installed libs and scripts

Resolve #1680, #772

* python: remove bin entries to avoid duplicated exe

* python: add py.exe launcher

Close #2424, #377, #2181
@dwettstein
Copy link
Contributor

Installing Python using Scoop is already done on user-level (without --global flag) , so there is no need to additionally install packages using the --user flag.

If you still need to install packages on user-level and have them in the PATH, I suggest to create a PR. Paths are added to ENV using env_add_path.

env_add_path: Add this directory to the user's path (or system path if --global is used). The directory is relative to the install directory and must be inside the install directory.

"env_add_path": [

@stale
Copy link

stale bot commented Oct 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 27, 2021
@stale stale bot removed the stale label Oct 29, 2021
@rashil2000
Copy link
Member

Closed by #2144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants