marcolardera / chatgpt-cli

Simple yet effective command line client for chatting with ChatGPT using the official API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

command not found after following installation instructions

ttop opened this issue · comments

I was successfully running an earlier version of chatgpt-cli, but revisited here and followed the instructions to install the latest version. But the installation doesn't seem to have worked successfully on my system (MacOS 13.4.1).

ttop@tsudio sources % pip install -U pip 
Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (23.3.1)
ttop@tsudio sources % pip install git+https://github.com/marcolardera/chatgpt-cli
Collecting git+https://github.com/marcolardera/chatgpt-cli
  Cloning https://github.com/marcolardera/chatgpt-cli to /private/var/folders/83/bcy3yyl95f7cn5kdlq8g5yb00000gn/T/pip-req-build-wq_3z1gc
  Running command git clone --filter=blob:none --quiet https://github.com/marcolardera/chatgpt-cli /private/var/folders/83/bcy3yyl95f7cn5kdlq8g5yb00000gn/T/pip-req-build-wq_3z1gc
  Resolved https://github.com/marcolardera/chatgpt-cli to commit b39eceb70346b10516821f37735adfe3fa2e96ff
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
ttop@tsudio sources % chatgpt-cli
zsh: command not found: chatgpt-cli
ttop@tsudio sources % which chatgpt-cli
chatgpt-cli not found
ttop@tsudio sources % 

I can't locate any executable on my system named chatgpt-cli.

The only hit here is the local dir where I cloned the source:

ttop@tsudio sources % find ~ / -name chatgpt-cli 2>/dev/null
/Users/ttop/sources/chatgpt-cli
^C # aborted after a very long time passed
ttop@tsudio sources % find ~ /usr /opt -name chatgpt-cli 2>/dev/null
/Users/ttop/sources/chatgpt-cli
ttop@tsudio sources % 

Apologies if I have done something incorrectly.

I have a similar problem. I have followed the installation documentation and then I get this “zsh: command not found: chatgpt-cli“

I have the same problem. This is a big one -- it broke scripts dependent on this repo. @marcolardera

I merged #53

However, I was not able to reproduce this in a venv on my local machine. (Linux, Python 3.10, Setuptools 59.6.0). I guess it was introduced by the latest versions of Setuptools.

Can you try again @ttop @giacman after that fix?

I'm also thinking about removing setup.cfg and switching to a pure pyproject.toml setup. I'm experimenting it in other projects and it seems the correct, modern way to package.

Hi, I pulled the latest main but I stil have the same error: zsh: command not found: chatgpt-cli

Did you run "pip install git+https://github.com/marcolardera/chatgpt-cli" again?

@marcolardera I was able to successfully pull, install, and then execute chatgpt-cli(I got the "Configuration file not found" message, but that is expected).

No I didn't, sorry! I have done it now and I also get:
"ChatGPT CLI
Configuration file not found"

I have added my API key in the config.yml file in the chatgpt-cli folder, I'm not sure what to do next.

config.yaml is created in the XDG config folder (usually ~/.config/chatgpt-cli) after the first execution. If you put your api-key in there, then you can launch chatgpt-cli again and it should work.

There are also other two methods to provide the api key: setting the OPENAI_API_KEY env var or using the -k option.

Perhaps the README requires more clarifications about that, in particolar regarding the creation of the config file during the first execution (the "Configuration file not found" may be confusing)...

it works thank you!

config.yaml is created in the XDG config folder (usually ~/.config/chatgpt-cli) after the first execution. If you put your api-key in there, then you can launch chatgpt-cli again and it should work.

Oh yes, I know that about the config -- I read the README. 😄 I was basically using the first execution to see if it would run and to get the config stub created.

No I didn't, sorry! I have done it now and I also get: "ChatGPT CLI Configuration file not found"

I have added my API key in the config.yml file in the chatgpt-cli folder, I'm not sure what to do next.

This is an issue I ran into as well, and is fixed by this PR:

#54

This can be closed, thanks all!