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

No Module named 'openai' #117

Open
jsbrown88 opened this issue Jul 11, 2023 · 5 comments
Open

No Module named 'openai' #117

jsbrown88 opened this issue Jul 11, 2023 · 5 comments

Comments

@jsbrown88
Copy link

When running the latest update - 7 hours ago from writing - I see installation instructions have changed since last night :D

no more pip install -r requirements.txt but rather poetry install. Done all that and then when I come to run any type of promt I get the following

"PS D:\Development\SMOLAI\developer> poetry install
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: smol_dev (0.0.3)
PS D:\Development\SMOLAI\developer> python main.py a HTML/JS/CSS Tic Tac Toe Game
Traceback (most recent call last):
File "D:\Development\SMOLAI\developer\main.py", line 3, in
from smol_dev.prompts import plan, specify_file_paths, generate_code_sync
File "D:\Development\SMOLAI\developer\smol_dev_init_.py", line 1, in
from smol_dev.prompts import *
File "D:\Development\SMOLAI\developer\smol_dev\prompts.py", line 6, in
import openai
ModuleNotFoundError: No module named 'openai'
PS D:\Development\SMOLAI\developer> "

Still a bit of a noob but im guessing the poetry install , allthough confirming that openai is installed doesnt find it.

Great fan. Thanks so much for wat you are doing.

@joelmgallant
Copy link

You may need to prefix commands with poetry run
ie: poetry run python main.py --prompt "a test case"

or open a poetry shell to activate the environment

@Chaitanyjanmale2
Copy link

Chaitanyjanmale2 commented Jul 15, 2023

error got after running "poetry run py main.py "a test case""

==>
Traceback (most recent call last):
File "E:\SMOLAI\developer\main.py", line 3, in
from smol_dev.prompts import plan, specify_file_paths, generate_code_sync
File "E:\SMOLAI\developer\smol_dev_init_.py", line 1, in
from smol_dev.prompts import *
File "E:\SMOLAI\developer\smol_dev\prompts.py", line 7, in
from openai_function_call import openai_function
ModuleNotFoundError: No module named 'openai_function_call'

pip show openai
validates that openai is available on my system
but shows the above error as well

please assists!!!

@RohanSangle
Copy link

error got after running "poetry run python main_no_modal.py " "prompt.md"
(in prompt.md I had written ' a HTML/JS/CSS Tic Tac Toe Game ' )

==>
hi its me, �🐣the smol develope🐣🐣! you said you wan
a HTML/JS/CSS Tic Tac Toe Game
Traceback (most recent call last):
File "C:\Users\Kiran\Desktop\chrome extension\developer\v0\main_no_modal.py", line 232, in
main(prompt, directory, file)
File "C:\Users\Kiran\Desktop\chrome extension\developer\v0\main_no_modal.py", line 122, in main
filepaths_string = generate_response(
^^^^^^^^^^^^^^^^^^
File "C:\Users\Kiran\Desktop\chrome extension\developer\v0\main_no_modal.py", line 10, in generate_response
import openai
ModuleNotFoundError: No module named 'openai'

please help!

@szczesnypawel
Copy link

szczesnypawel commented Aug 20, 2023

error got after running "poetry run py main.py "a test case""

==> Traceback (most recent call last): File "E:\SMOLAI\developer\main.py", line 3, in from smol_dev.prompts import plan, specify_file_paths, generate_code_sync File "E:\SMOLAI\developer\smol_dev__init__.py", line 1, in from smol_dev.prompts import * File "E:\SMOLAI\developer\smol_dev\prompts.py", line 7, in from openai_function_call import openai_function ModuleNotFoundError: No module named 'openai_function_call'

pip show openai validates that openai is available on my system but shows the above error as well

please assists!!!

error got after running "poetry run py main.py "a test case""

==> Traceback (most recent call last): File "E:\SMOLAI\developer\main.py", line 3, in from smol_dev.prompts import plan, specify_file_paths, generate_code_sync File "E:\SMOLAI\developer\smol_dev__init__.py", line 1, in from smol_dev.prompts import * File "E:\SMOLAI\developer\smol_dev\prompts.py", line 7, in from openai_function_call import openai_function ModuleNotFoundError: No module named 'openai_function_call'

pip show openai validates that openai is available on my system but shows the above error as well

please assists!!!

I am having the same issue - openai_function_call cannot be imported. I've installed everything via poetry. pip list shows openai_function_call on the list. I cannot import it via python interactive shell either.

Any hints? What temporarily worked for me was copying init.py file from openai_function_call directory to the main directory of smol-ai and renaming it to "openai_function_call.py".

@EmpathicSage
Copy link

EmpathicSage commented Aug 20, 2023

I also received the same error "No module named 'openai_function_call" when first trying the project and resolved it.

NOTE: When we report bugs as a community, let's take the time to include the environment information to reproduce the bug, such as the name and version of the application, the version of the operating system, execution switches, etc. This aids in reproducing the error and understanding the specific circumstances. Otherwise, the messages may not be actionable.

Environment

  • smol-ai/developer commit fd77b4e
  • Windows 11 Pro 21H2 Build 22000.2295
  • i7-6800K CPU
  • 128 GiB RAM
  • NVIDIA GeForce 1080Ti GTX
  • NVIDIA Graphics Driver 531.14
  • NVIDIA CUDA Runtime 11.8
  • NVIDIA CUDA Runtime 12.1
  • Visual Studio Professional 2022 version 17.6.6
  • Git Bash version 2.41.0.2 (https://gitforwindows.org/)
  • pip 23.1.2 from C:\Python311\Lib\site-packages\pip (python 3.11)

Steps to Reproduce

  1. Right-click to launch the program "git-bash.exe" from the Windows GUI as an Administrator (Run as administrator)
  2. mkdir -p ~/git
  3. cd ~/git
  4. git clone https://github.com/smol-ai/developer.git
  5. cd developer
  6. pip install poetry
  7. poetry install
  8. py main.py --prompt "Create a bash script that plays blackjack interactively with the user."
  9. ERROR: No module named 'openai_function_call'

Steps to Resolve

  1. poetry shell
  2. export OPENAI_API_KEY=sk-XXXXX # add your Open AI API key
  3. py main.py --prompt "Create a bash script that plays blackjack interactively with the user."
  4. SUCCESS: file written to generated/blackjack.sh and generated/shared_deps.md

NOTE: I also used poetry run py main.py --prompt "Create a bash script that plays blackjack interactively with the user." successfully.

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

6 participants