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

Failed integration with ZSH #582

Closed
aramacs opened this issue Jun 22, 2024 · 12 comments
Closed

Failed integration with ZSH #582

aramacs opened this issue Jun 22, 2024 · 12 comments

Comments

@aramacs
Copy link

aramacs commented Jun 22, 2024

Hey I tried to find a solution but not worked out. I'm trying to configure it shell integration.
image

@schwab
Copy link

schwab commented Jun 26, 2024

I get the same error in Ubuntu with ZSH. Any ideas on this one?

@aramacs
Copy link
Author

aramacs commented Jun 30, 2024

Not yet. Here I'm on arch.

@danjeltahko
Copy link

danjeltahko commented Jul 4, 2024

Can you have a look on what version you are using?

My only guess is that #544 change isn't included, but otherwise I don't know.

@aramacs
Copy link
Author

aramacs commented Jul 4, 2024

Here I'm on it

image

@danjeltahko
Copy link

Alright you have the latest version so i did some investigation, to cross check if the issue is because of the latest fix not being included you could run:
sed -n 67,87p /usr/local/lib/python3.10/dist-packages/sgpt/utils.py

or if you have installed it without sudo (at least for me):
sed -n 67,87p ~/.local/lib/python3.10/site-packages/sgpt/utils.py

if the printed code snippet shows "if shell == "/bin/zsh" instead of "if "zsh" in shell" you will need to uninstall sgpt with either
pip3 uninstall shell_gpt
or
sudo pip3 unisntall shell_gpt
depending on how you installed it.

I'm using pop_os without really any configuration so only sudo will have it on PATH. After that reinstall sgpt with:
sudo pip3 install git+https://github.com/TheR1D/shell_gpt@main
or without sudo if you have your home local in path.

If this doesn't solve the problem, then i actually don't know what the issue is.. Hope it works :)

@aramacs
Copy link
Author

aramacs commented Jul 4, 2024

image
I don't get that return in either of them. I installed using pipx perhaps I should do something different? 

@danjeltahko
Copy link

To see which directory you actually have your sgpt in, you could run :

> python3 -m pip show shell_gpt

Name: shell_gpt
Version: 1.4.3
Summary: A command-line productivity tool powered by large language models, will help you accomplish your tasks faster and more efficiently.
Home-page: https://github.com/ther1d/shell_gpt
Author:
Author-email: Farkhod Sadykov <[email protected]>
License:
Location: /opt/homebrew/lib/python3.11/site-packages
Requires: click, distro, instructor, openai, rich, typer
Required-by:

and in my case i have it in brew, so for me, as you can see above, i would print out the code with:
sed -n 67,87p /opt/homebrew/lib/python3.11/site-packages/sgpt/utils.py

But please try to unisntall and reinstall from github link pointing to latest commit on main branch. I think that will solve the problem.

@aramacs
Copy link
Author

aramacs commented Jul 4, 2024

I get that:

image

@danjeltahko
Copy link

Arch.. Well you can either create an environemnt and always have that activated, wait for the next release tag, or add a flag to you pip installation.

install the package for your user only, bypassing the system-wide restrictions.

sudo pip3 install --user git+https://github.com/TheR1D/shell_gpt@main

override the system package management and install the package directly

sudo pip3 install git+https://github.com/TheR1D/shell_gpt@main --break-system-packages

@aramacs
Copy link
Author

aramacs commented Jul 4, 2024

The installation work out. But when I refresh my terminal I get that error

image
image

@danjeltahko
Copy link

Try changing the line to:
bindkey '^l' _sgpt_zsh
If that doesn't work, please ask sgpt how to solve it..

@aramacs
Copy link
Author

aramacs commented Jul 4, 2024

Thanks for your help.

@aramacs aramacs closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants