Forum in maintenance, we will back soon 🙂
OPenAPI Script Errors
Hi, I pasted the following code with my OpenAPI key and got errors, can anyone please help?
I have successfully installed the OPenAPI module
@google-rayazsiddiqi are you good now?
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
@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.
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
@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
@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
@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:\>
@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
@ssadvisor sorry what do you mean by powershell...and do I run both commands or only the top one?
@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
@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>
Â
Â