ilabsweden / pepperchat

A dialog system for the Aldebaran robots Pepper and Nao, based on ChatGPT.
MIT License
16 stars 6 forks source link

python module_dialogue.py not executing #6

Open udurand-nsu opened 1 month ago

udurand-nsu commented 1 month ago

Hello and apologies if I made an oversight. I want to say that the code is very well designed and coherent.

Following the instructions provided, there are (3) terminals that the user should run: the dialogueserver, the speechrecognition service, then the dialogue module. The first two run, the last one provided a lengthy syntax error.

user@user pepperchat-master % python module_dialogue.py --pip <pepper's ip> Traceback (most recent call last): File "module_dialogue.py", line 26, in from oaichat.oaiclient import OaiClient File "/Users/user/Downloads/pepperchat-master/oaichat/oaiclient.py", line 18, in from oairesponse import OaiResponse File "/Users/user/Downloads/pepperchat-master/oaichat/oairesponse.py", line 12, in import openai File "/Users/user/Library/Python/2.7/lib/python/site-packages/openai/init.py", line 30, in from openai.api_resources import # noqa File "/Users/user/Library/Python/2.7/lib/python/site-packages/openai/api_resources/init.py", line 1, in from openai.api_resources.completion import Completion File "/Users/user/Library/Python/2.7/lib/python/site-packages/openai/api_resources/completion.py", line 14 def create(cls, args, timeout=None, **kwargs): ^ SyntaxError: invalid syntax

udurand-nsu commented 1 month ago

I wasn't sure what was the issue and tried getting an AI to do code analysis. ChatGPT is confused as it will say this error is the result of running in python2 instead of py3, but if you run it with py3 you get an error with the verbiage of the script starting with "module_dialogue.py", line 49 except BaseException, err: ^^^^^^^^^^^^^^^^^^ SyntaxError: multiple exception types must be parenthesized" and the documentation stated python (python2) so i'm not sure what the root cause is.

BirkHintzeThisted commented 2 weeks ago

I'm pretty sure that error is from choosing the wrong interpreter, if you executed it in visual code studio instead of the terminal. Then you should make sure the interpreter (bottom right corner) is Python 2.7, then that error should disappear.

OR make sure that your terminal command is using python (2.7) and not python3

udurand-nsu commented 1 week ago

Thank you for reaching out to assist. I've made sure it was python2.7.18 64-bit, as in the instructions it mentioned the 3 running terminals would be: python3, python(py2), python(py2). I did try running the script in py3 though to see if it would help since the traceback error showed that its trying and failing to use openai which is py3 only. I've also confirmed this issue only happens when ran with python2, by using the step where you confirm you can import naoqi in python 2 and trying to import openai. Despite it not being listed in requirements.py2, the errors are identical.

BirkHintzeThisted commented 1 week ago

That’s really odd.

I can replicate the except BaseException, err:

SyntaxError: multiple exception types must be parenthesized”

If I run python 2 code through python 3.

I didn’t get past that point on mac, so I can’t really speak for the issues if the paths to the different pythons seems to be correct. I switched to windows. (Mind you I have not gotten the whole thing to run)