Getting Error in 'Run The Program' File Path Error

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 223
Благодарностей
685
Баллы
113
When running a Python script, I keep getting a path error. See attached images. The code works fine in command line out of the folder. Same error when using {Project.Directory
133604
133605
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 223
Благодарностей
685
Баллы
113
Okay, I put quotes around the path and now I'm getting another error only in zenno, not when I run the script from command line.


Warning: 'config.ini' not found. Attempting to load API key from environment variable (GEMINI_API_KEY).
An error occurred during Gemini API interaction: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'API key not valid. Please pass a valid API key.', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'API_KEY_INVALID', 'domain': 'googleapis.com', 'metadata': {'service': 'generativelanguage.googleapis.com'}}, {'@type': 'type.googleapis.com/google.rpc.LocalizedMessage', 'locale': 'en-US', 'message': 'API key not valid. Please pass a valid API key.'}]}}

The config.ini file is in the directory with the python script and like I said, the script runs fine with the command line. Somehow the run own program is messing it up. May avhe to go back to just running an autoexec.bat file.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 622
Благодарностей
5 962
Баллы
113
Hello,
I'm not sure python script is suppossed to be run this way in zenno.
This action is intended to run end applications.

Okay, I put quotes around the path and now I'm getting another error only in zenno, not when I run the script from command line.


Warning: 'config.ini' not found. Attempting to load API key from environment variable (GEMINI_API_KEY).
An error occurred during Gemini API interaction: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'API key not valid. Please pass a valid API key.', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'API_KEY_INVALID', 'domain': 'googleapis.com', 'metadata': {'service': 'generativelanguage.googleapis.com'}}, {'@type': 'type.googleapis.com/google.rpc.LocalizedMessage', 'locale': 'en-US', 'message': 'API key not valid. Please pass a valid API key.'}]}}

The config.ini file is in the directory with the python script and like I said, the script runs fine with the command line. Somehow the run own program is messing it up. May avhe to go back to just running an autoexec.bat file.
What is the path for config.ini file? perhaps it also needs to be formatted to be seen in zenno.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 223
Благодарностей
685
Баллы
113
I've run python scripts before from zenno. The config.ini file is in the directory with the template and the python script. It runs fine from the command prompt. Never had this problem before because I didn't need to hide my api key from other users before. I was trying to make the bot work to give away here in the forum. Having to save the pdf and then send it to an OCR site sucks.

My next option I guess is to put it into an autoexec.bat file and see if it runs that way.

Hopefully, the developers will get the chatgpt and Google Gemini api sdk's into zenno so we can use them from the Poster. I'm not a coder and have been trying for a week to get the gemini api to work in the c# action and also tried HTTP requests. Every example I've seen online and through the AI bots haven't worked
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)