Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Main Execution Block in interpreter.py 🐛 #40

Closed
drgutman opened this issue Sep 4, 2023 · 2 comments
Closed

Missing Main Execution Block in interpreter.py 🐛 #40

drgutman opened this issue Sep 4, 2023 · 2 comments

Comments

@drgutman
Copy link

drgutman commented Sep 4, 2023

🐛 Bug Report: Missing Main Execution Block in interpreter.py

Description

The interpreter.py script lacks the main execution block (if __name__ == "__main__":) which is necessary to initiate the script's execution when run from the command line. Due to this omission, the script exits silently without any output or error messages when executed with command-line arguments.

🚶 Steps to Reproduce

  1. Clone the repository and navigate to the directory containing interpreter.py.
  2. Run the script from the command line with the --local flag (or any other flag): python interpreter.py --local.
  3. Observe that the script exits silently without initiating the CLI or the chat process.

🤔 Expected Behavior

When the script is executed from the command line, it should initiate the CLI and subsequently the chat process, allowing the user to interact with the program.

😯 Actual Behavior

The script exits silently without any output or error messages, and the CLI or chat process is not initiated.

💡 Suggested Fix

Add the following block of code at the end of the interpreter.py script to initiate the script's execution when run as the main program:

"""
python
if name == "main":
interpreter = Interpreter()
interpreter.cli()
"""

@drgutman drgutman changed the title Missing Main Execution Block in interpreter.py Missing Main Execution Block in interpreter.py 🐛 Sep 4, 2023
@KillianLucas
Copy link
Collaborator

Hey @drgutman! I think the issue here might be running it with a command like interpreter.py --local instead of simply interpreter --local. The latter should use the script specified in pyproject.toml, which should put a script called "interpreter" in your default scripts folder when you pip install open-interpreter.

I'm not certain if this is always the case though. What happens if you try to run interpreter --local on your command line?

@jordanbtucker
Copy link
Collaborator

Closing as stale. @drgutman Feel free to re-open if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants