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

Self install to PATH of other shell profiles #2620

Closed
sceniclife opened this issue Jul 3, 2020 · 2 comments · Fixed by #3169
Closed

Self install to PATH of other shell profiles #2620

sceniclife opened this issue Jul 3, 2020 · 2 comments · Fixed by #3169
Labels
kind/feature Feature requests/implementations

Comments

@sceniclife
Copy link

Using a vanilla macOS Catalina v10.15.5. The default shell profile Terminal uses is zsh. (~/.zshrc)
Poetry does not automatically install to PATH for this type of set up (possibly others).
Could it be set up to handle the different types of shell profiles?

Example:
I installed poetry via curl:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

And I receive the message:

Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

$HOME/.poetry/bin

This path will then be added to your `PATH` environment variable by
modifying the profile files located at:

$HOME/.profile
$HOME/.zprofile

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing version: 1.0.9
  - Downloading poetry-1.0.9-darwin.tar.gz (10.46MB)

Poetry (1.0.9) is installed now. Great!

To get started you need Poetry's bin directory ($HOME/.poetry/bin) in your `PATH`
environment variable. Next time you log in this will be done
automatically.

To configure your current shell run `source $HOME/.poetry/env`

I do not have either $HOME/.profile or $HOME/.zprofile, after install I run poetry --version and receive:

zsh: command not found: poetry

The ticket #507 was opened before but was closed since the user found that you can manually modify ~/.zshrc and add export PATH="$HOME/.poetry/bin:$PATH" to get it to work. (verified it does work)

This ticket is to request the feature of having poetry automatically detect the shell profile and add to the PATH automatically.

@sceniclife sceniclife added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Jul 3, 2020
@abitrolly
Copy link
Contributor

zsh doesn't create .zprofile automatically - https://www.reddit.com/r/zsh/comments/fjcd35/theres_no_zprofile_file_in_my_home_directory_in/ It also doesn't use .profile because it may be not compatible. .zprofile is also not loaded by graphical terminals - https://askubuntu.com/questions/708924/zprofile-is-not-read-on-graphical-login-when-user-s-default-shell-is-zsh

I see the solution to add to .zshrc , because it is run for both login and non-login shells https://www.reddit.com/r/zsh/comments/e882c4/what_is_the_difference_between_zshrc_and_zprofile/

abitrolly added a commit to abitrolly/poetry that referenced this issue Oct 10, 2020
Because `.zprofile` is only run for login shells, it is not used
by graphical terminals. `.zprofile` is also not created by default.

Fixes python-poetry#2620
kasteph pushed a commit that referenced this issue Nov 2, 2020
Because `.zprofile` is only run for login shells, it is not used
by graphical terminals. `.zprofile` is also not created by default.

Fixes #2620
@jottr jottr mentioned this issue Mar 28, 2021
3 tasks
@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants