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

Getting started + Requirements.txt #8

Open
sfxworks opened this issue Oct 4, 2022 · 3 comments
Open

Getting started + Requirements.txt #8

sfxworks opened this issue Oct 4, 2022 · 3 comments

Comments

@sfxworks
Copy link

sfxworks commented Oct 4, 2022

On first run:

Traceback (most recent call last):
  File "/home/sam/git/natbot/natbot.py", line 8, in <module>
    from playwright.sync_api import sync_playwright
ModuleNotFoundError: No module named 'playwright'

So, so far I know I need playwright, OpenAI

Traceback (most recent call last):
  File "/home/sam/git/natbot/natbot.py", line 11, in <module>
    import openai
ModuleNotFoundError: No module named 'openai'

Then I need to run this to prepare

playwright._impl._api_types.Error: Executable doesn't exist at /home/sam/.cache/ms-playwright/chromium-1024/chrome-linux/chrome
╔════════════════════════════════════════════════════════════╗
║ Looks like Playwright was just installed or updated.       ║
║ Please run the following command to download new browsers: ║
║                                                            ║
║     playwright install                                     ║
║                                                            ║
║ <3 Playwright Team                                         ║
╚════════════════════════════════════════════════════════════╝

and I also need an API key

openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = <API-KEY>', or you can set the environment variable OPENAI_API_KEY=<API-KEY>). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = <PATH>'. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email [email protected] if you have any questions.
@sfxworks
Copy link
Author

sfxworks commented Oct 4, 2022

After all this is done I can confirm it works :D

@Krasnomakov
Copy link

Screenshot 2022-12-03 at 22 07 35

I did everything but still have the error

@enorms
Copy link

enorms commented Dec 17, 2022

@Krasnomakov It does seem openai is installed but somehow it's not getting the value. Setting openai.api_key = "key" worked for me, as did injecting via console like OPENAI_API_KEY=key python natbot.py. What happens if you remove line 15 and run it. If that doesn't work, what happens if you revert to the original code for line 14 (and 15 still removed) and try running from console as above

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