What I've done:
1. Had bot scripted through visual studio code (using python script)
2. Created VM instance, opened SSH and upload my file "bot.py" into SSH.
What had happened:
1. When i run script on CMD, it does not have any issue.
2. When i run script on SSH it appears error (e.g. Unable to locate my excel file
Which vm you are using? It's Linux or windows
By checking chatgpt. It seems like error cause its linux
Hello @rfrz,
Welcome to Google Cloud Community!
If you are using Linux, the file path format is wrong and will only work in Windows.
Thanks
I was also facing same issue with one of my agency site: https://schoenhalde.de/online/ after experts analyze we found its solution. All you have to do is upload and run your script on an SSH connection, you need to ensure that all the required files, including your Excel file, are available within the SSH environment. Here's a step-by-step guide on how to upload and run your script on SSH:
Establish an SSH connection to your VM instance using a terminal or SSH client.
Navigate to the directory where you want to upload your script. For example, if you want to upload it to the home directory, you can use the following command:
3. Use a file transfer method such as SCP (Secure Copy) or SFTP (Secure File Transfer Protocol) to upload your script and any associated files to the remote server. Here's an example using SCP:
4. Replace path-to-bot.py with the local path of your script and username@your-server-ip with the SSH login credentials for your VM instance.
5. Once the files are uploaded, you can access them in the SSH environment. Navigate to the directory where you uploaded your script:
5. Now you can run your script using the Python interpreter. For example:
Make sure you have the necessary dependencies and packages installed on the server.
Note: Ensure that the file paths in your script are updated to reflect the correct paths in the SSH environment. Since the SSH environment may have a different file system structure, you might need to modify the file paths in your script accordingly.
By following these steps, you should be able to successfully upload and run your script on SSH, provided that your SSH connection is properly configured and you have the necessary permissions to execute the script.