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

No module named 'click'

jrcii opened this issue · comments

After following the instructions I get this error:

❯ python chatgpt.py
Traceback (most recent call last):
  File "/src/chatgpt-cli/chatgpt.py", line 4, in <module>
    import click
ModuleNotFoundError: No module named 'click'

I don't use python but I'm guessing I have to find/install a missing dependency. I'm not sure if there are more of these once I fix this one.

Did you run the following command?

pip install -r requirements.txt

If so, check if the "python" command on your system calls python2 or python3 and check which interpreter pip is connected to.

You may need to do something like this:

python3 -m pip install requirements.txt
python3 chatgpt.py

Same issue here. My solution is to make sure to use the same version of pip and python. (There's python3.9, 3.10 and 3.11 on my macOS, so I guess the "click" library was installed to another version of python.)
For example:

pip3.11 install -r requirements.txt
python3.11 chatgpt.py