joshcho / ChatGPT.el

ChatGPT in Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chatgpt-init throwing python error

i-oliva opened this issue · comments

In doom emacs

python --version
Python 3.10.8

pip list shows chatGPT v0.3.6 installed

chatgpt-init error:

Traceback (most recent call last):
  File "/home/***/.emacs.d/.local/straight/repos/ChatGPT.el/chatgpt.py", line 3, in <module>
    from epc.server import EPCServer
  File "/home/***/.local/lib/python3.10/site-packages/epc/server.py", line 200
    print self.server_address[1]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

Process epc:server:2 exited abnormally with code 1

.doom.d/config.el

(use-package! chatgpt
  :defer t
  :config
  (unless (boundp 'python-interpreter)
    (defvaralias 'python-interpreter 'python-shell-interpreter))
  (setq chatgpt-repo-path (expand-file-name "straight/repos/ChatGPT.el/" doom-local-dir))
  (set-popup-rule! (regexp-quote "*ChatGPT*")
    :side 'bottom :size .5 :ttl nil :quit t :modeline nil)
  :bind ("C-c q" . chatgpt-query))

.doom.d/packages.el

(package! chatgpt
  :recipe (:host github :repo "joshcho/ChatGPT.el" :files ("dist" "*.el")))

I am not a python developer so apologies if it is something stupid :) Thanks!

It must be an upstream issue with epc. Can you try re-installing epc? If that doesn't work, as a short-term solution, try to edit .local/lib/python3.10/site-packages/epc/server.py line 200 and wrap the print call with parentheses, as noted in the stack trace.

Like so:
print(self.server_address[1])

It does seem like the epc package you have is for python 2, which is odd.

Reinstalling solved the issue, thanks