shroominic / codeinterpreter-api

👾 Open source implementation of the ChatGPT Code Interpreter
https://discord.gg/Vaq25XJvvW
MIT License
3.76k stars 401 forks source link

1st run time good but 2nd attempts always fail #102

Open michael230811 opened 1 year ago

michael230811 commented 1 year ago

Could you please help me out on this issue?

1st run time good:

(venv) PS C:\Users\zhang\Downloads\codeinterpreter-api\examples> python show_ethereum_chart.py AI: Here is the Ethereum price chart for the year-to-date 2023. The x-axis represents the date and the y-axis represents the price in USD. Please note that the data is subject to the availability from the source. Exception ignored in: <function LocalBox.del at 0x00000266905C4860> Traceback (most recent call last): File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\codeboxapi\box\localbox.py", line 567, in del File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\codeboxapi\box\localbox.py", line 517, in stop OSError: [WinError 87] Parameter error.。

But I still got the exact chart from this command(python show_ethereum_chart.py) somehow.

But my 2nd attempt always failed even with SAME command line.

(venv) PS C:\Users\zhang\Downloads\codeinterpreter-api\examples> python show_ethereum_chart.py Traceback (most recent call last): File "C:\Users\zhang\Downloads\codeinterpreter-api\examples\show_ethereum_chart.py", line 19, in main() File "C:\Users\zhang\Downloads\codeinterpreter-api\examples\show_ethereum_chart.py", line 7, in main with CodeInterpreterSession(local=True) as session: File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\codeinterpreterapi\session.py", line 471, in enter self.start() File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\codeinterpreterapi\session.py", line 82, in start status = SessionStatus.from_codebox_status(self.codebox.start()) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\codeboxapi\box\localbox.py", line 107, in start self._connect() File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\codeboxapi\box\localbox.py", line 120, in _connect self.ws = ws_connect_sync(f"{self.ws_url}/kernels/{self.kernel_id}/channels") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\websockets\sync\client.py", line 289, in connect connection.handshake( File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\websockets\sync\client.py", line 85, in handshake raise TimeoutError("timed out during handshake") TimeoutError: timed out during handshake Exception ignored in: <function LocalBox.del at 0x000001545F734860> Traceback (most recent call last): File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\codeboxapi\box\localbox.py", line 567, in del File "C:\Users\zhang\Downloads\codeinterpreter-api\venv\Lib\site-packages\codeboxapi\box\localbox.py", line 514, in stop OSError: [WinError 6] Invalid handle

Thank you for your help in advance.

viscovich commented 1 year ago

I have the same problem on Windows

athrael-soju commented 11 months ago

Same Issue using Windows 11, but I was never able to get it to work.

CaptainDP commented 8 months ago

I also encountered the same problem on Win11.