terry3041 / pyChatGPT

An unofficial Python wrapper for OpenAI's ChatGPT API
GNU General Public License v3.0
1.35k stars 255 forks source link

cannot import name 'ChatGPT' from 'pyChatGPT' #77

Closed n0kovo closed 1 year ago

n0kovo commented 1 year ago

After installing pyChatGPT in the following way:

git clone https://github.com/terry3041/pyChatGPT.git
cd pyChatGPT
python3 -m pip install -U .

and running a script with the following code:

from pyChatGPT import ChatGPT

api = ChatGPT(auth_type='openai', email=[REDACTED], password=[REDACTED],
               twocaptcha_apikey=[REDACTED],
               verbose=True,
               login_cookies_path='/tmp',
               proxy='http://127.0.0.1:8080',
               moderation=False)

I get the following error:

Traceback (most recent call last):
  File "/[REDACTED]/test.py", line 1, in <module>
    from pyChatGPT import ChatGPT
ImportError: cannot import name 'ChatGPT' from 'pyChatGPT' (unknown location)

I tried installing the module with pip install -U pyChatGPT as well, but the error persists.

n0kovo commented 1 year ago

Fixed by doing the following:

find $(python -c 'import site; print(site.getsitepackages()[0])') -iname "pychatgpt*" -exec rm -rf {} \;
pip install -U pyChatGPT