Skip to content

Forum in maintenance, we will back soon 🙂

OPenAPI Script Erro...
 
Notifications
Clear all

OPenAPI Script Errors

24 Posts
4 Users
7 Reactions
469 Views
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

Hi, I pasted the following code with my OpenAPI key and got errors, can anyone please help?

image
 
Posted : 04/24/2024 4:50 pm
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

I have successfully installed the OPenAPI module

 
Posted : 04/24/2024 4:51 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@google-rayazsiddiqi are you good now?

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

 
Posted : 04/24/2024 10:11 pm
(@husein)
Posts: 532
Member Moderator
 

@google-rayazsiddiqi Did you resolve the issue.

Plus, make sure not to show your API key, since people may start using it and therefore spending your credits. Delete the one in the code above and generate a new one.

 
Posted : 04/25/2024 4:01 pm
Hasan Aboul Hasan
(@admin)
Posts: 1253
Member Admin
 

Try creating a virtual environment

python -m venv venv

then activate it

venv/scripts/activate

then install openai in the venv

pip install openai

then run the script

 
Posted : 04/25/2024 4:31 pm
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

@ssadvisor no I need to understand why it's not working, why am I getting errors, what do I need to do to fix this

 
Posted : 04/25/2024 4:46 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@google-rayazsiddiqi does the solution @admin gave you work?

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

 
Posted : 04/25/2024 5:29 pm
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

@husein thanks done!

 
Posted : 04/25/2024 8:25 pm
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

@admin thanks I'll try it and let you know how it goes

 
Posted : 04/25/2024 8:26 pm
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

@admin getting this error:

PS D:\github repos> c:
PS C:\> python -m venv venv
PS C:\> venv/scripts/activate
venv/scripts/activate : File C:\venv\scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system. For more 
information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ venv/scripts/activate
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
PS C:\>
 
Posted : 04/26/2024 5:11 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@google-rayazsiddiqi in your power-shell you need to

# Asks if you want to run an unsigned script
Set-ExecutionPolicy -ExecutionPolicy AllSigned

# or unrestricted
Set-ExecutionPolicy -ExecutionPolicy Bypass

 

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

 
Posted : 04/26/2024 7:28 pm
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

@ssadvisor sorry what do you mean by powershell...and do I run both commands or only the top one?

 
Posted : 04/27/2024 3:21 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@google-rayazsiddiqi your command shell is Microsoft's Powershell by default. Choose one or the other, the first one is more restrictive the second one removes all restrictions.

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

 
Posted : 04/28/2024 1:46 am
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

@ssadvisor where do i set this pfrom, the windows prompt?

 
Posted : 04/29/2024 1:10 pm
(@google-rayazsiddiqi)
Posts: 95
Estimable Member
Topic starter
 

@ssadvisor @admin this is the error I get when I try and run the commands mentioned:

PS D:\github repos\test-repo> Set-ExecutionPolicy -ExecutionPolicy Bypass
Set-ExecutionPolicy : Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is
denied. To change the execution policy for the default (LocalMachine) scope, start Windows PowerShell with the "Run as administrator"
option. To change the execution policy for the current user, run "Set-ExecutionPolicy -Scope CurrentUser".
At line:1 char:1
+ Set-ExecutionPolicy -ExecutionPolicy Bypass
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand

And when i try and run form my Windows prompt I get this error:

Microsoft Windows [Version 10.0.19045.4291]
(c) Microsoft Corporation. All rights reserved.

C:\Users\rayaz>Set-ExecutionPolicy -ExecutionPolicy Bypass
'Set-ExecutionPolicy' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\rayaz>

 

 

 
Posted : 04/29/2024 5:26 pm
Page 1 / 2
Share: