Skip to content
site logo mobile

Forum in maintenance, we will back soon πŸ™‚

First connection wi...
 
Notifications
Clear all

First connection with ChatGPT

20 Posts
5 Users
10 Likes
539 Views
(@robert-dias)
Posts: 5
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Points: 202
Topic starter
 

Unable to make connection with ChatGPT, I still trying with Chat GPT help and still not working.



Β 

 
Posted : 07/30/2023 6:10 am
howardtw1984 reacted
Hasan Aboul Hasan
(@admin)
Posts: 804
Member Admin
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 13549
 

it is my_module, and not mymodule

please post your questions on the course's forum. you are a premium member.

 
Posted : 07/30/2023 9:27 am
SSAdvisor reacted
SSAdvisor
(@ssadvisor)
Posts: 699
Prominent Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 15611
 

@Hasan, is there a way to make this clearer in the course introduction?

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 07/30/2023 1:42 pm
Hasan Aboul Hasan
(@admin)
Posts: 804
Member Admin
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 13549
 

@ssadvisor I remember I mention how to get support, but I will double check and try to make it clearer.

 
Posted : 07/31/2023 1:21 pm
(@linda-scotti)
Posts: 7
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Points: 94
 

Hi Hasan,Β 

I tried to connect ChatGPT but the command pip was not recognised.

Can you help me?Β 

Thank you!


 
Posted : 10/31/2023 3:38 pm
SSAdvisor
(@ssadvisor)
Posts: 699
Prominent Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 15611
 

@linda-scotti what operating system are you using; Windows, Linux or MAC?

https://pip.pypa.io/en/stable/installation/

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 10/31/2023 6:25 pm
(@linda-scotti)
Posts: 7
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Points: 94
 

@ssadvisor I am using a MAC, MacBook Pro 2020

Thank you!

 
Posted : 11/01/2023 9:20 am
SSAdvisor
(@ssadvisor)
Posts: 699
Prominent Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 15611
 

@linda-scotti okay, great. Did you get PIP installed?

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 11/01/2023 2:09 pm
(@linda-scotti)
Posts: 7
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Points: 94
 

@ssadvisor no, I don't understand what I have to do.

 
Posted : 11/01/2023 5:32 pm
SSAdvisor
(@ssadvisor)
Posts: 699
Prominent Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 15611
 

@linda-scotti in your console try the following:

python3 -m ensurepip --upgrade

If that doesn't work then try downloading the script at https://bootstrap.pypa.io/get-pip.py and

python3 get-pip.py

Β Then in your virtual environment you should be able to:

pip install openai

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 11/02/2023 5:12 pm
Linda Scotti reacted
(@linda-scotti)
Posts: 7
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Points: 94
 

@ssadvisor Sorry, it might sound like a stupid question, but what is the console? I am not a developer, so I need instructions for "dummies". Even better with screenshots or video.

I tried to paste

python3 -m ensurepip --upgrade

in the Visual Studio Code Terminal and didn't work. I don't know what a virtual environment is as well. I feel a bit lost.

 
Posted : 11/03/2023 4:53 pm
(@linda-scotti)
Posts: 7
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Points: 94
 

@ssadvisor for some reason, I managed to install pip as you can see in the screenshot.

Β No idea how I did it, but it's there. I still get an error message for import openai. That's my next mystery to be solved.

 
Posted : 11/03/2023 5:08 pm
SSAdvisor
(@ssadvisor)
Posts: 699
Prominent Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 15611
 

@linda-scotti I would love to talk with you 1-on-1. It looks like you haven't installed the openai module with pip.

A virtual environment is recommended and a module you execute with python.

# virtual environment
python3 -m venv venv
source venv/bin/activate

# install openai
pip install openai

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 11/04/2023 2:26 pm
Linda Scotti reacted
(@linda-scotti)
Posts: 7
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Points: 94
 

@ssadvisor Your guidance was helpful! I asked for some help from ChatGPT and it seems I managed to create a virtual environment and install openai. It still doesn't appear to work in Visual Studio.

 
Posted : 11/09/2023 4:48 pm
Hasan Aboul Hasan
(@admin)
Posts: 804
Member Admin
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 13549
 

@linda-scotti what is the error you are getting?

 
Posted : 11/10/2023 12:20 pm
Linda Scotti reacted
(@linda-scotti)
Posts: 7
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Points: 94
 

@admin Hi Hasan, I kept getting an error because I had to change the interpreter in VS. Then I got another error that said I had to do an openai migration to upgrade my openai. Finally, after taking all these steps, I MADE it! I am so happy because I have zero programming knowledge and, with a lot of patience, determination and your help + ChatGPT advice, now it works!

 
Posted : 11/11/2023 11:40 am
DariDar
(@dari-dar)
Posts: 27
Eminent Member Customer
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
Power Member
Points: 17641
 

I am in step 25 - Lesson: Connect Python With OpenAI API

import openai

openai.api_key="my-api-key"

def generate_text_with_openai(user_prompt):
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": user_prompt}],
)
return completion.choices[0].message.content

# Example usage:

prompt = "Generate 5 catchy youtube titles about [email marketing tricks]"

response = generate_text_with_openai(prompt)

print(response)

Β 

Using the script from the lesson i get this error-message:

when having my first connection to chatgpt i have this error: You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

You can run `openai migrate` to automatically upgrade your codebase to use the 1.0.0 interface.

Alternatively, you can pin your installation to the old version, e.g. `pip install openai==0.28`

A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742 Β 

Β 

i tried to go along the migration guide but it didn't work out.

This post was modified 4 months ago by DariDar
 
Posted : 11/11/2023 6:07 pm
SSAdvisor
(@ssadvisor)
Posts: 699
Prominent Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 15611
 

@dario-rucci for following the course I would suggest the option to install the older version.

pip install --upgrade openai==0.28

You need the --upgrade option to remove the installed version and replace it with the specified version.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 11/12/2023 1:14 am
DariDar reacted
DariDar
(@dari-dar)
Posts: 27
Eminent Member Customer
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
Power Member
Points: 17641
 

@ssadvisor Thank you! I just did it. It works again!

 
Posted : 11/12/2023 2:42 pm
Hasan Aboul Hasan
(@admin)
Posts: 804
Member Admin
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
Points: 13549
 
I updated the course scripts to meet the latest openai updates.
 
Posted : 11/15/2023 11:36 am
DariDar reacted
Share: