1

I am trying to connect OCI with Python API. I created start script to start the Oracle Cloud instance. But getting error "Could not find config file at {},".enter image description here enter image description here Can someone help on this error, please? I am running python script in visual studio code. Thanks in advance.

Sanky Ach
  • 159
  • 1
  • 20

2 Answers2

0

Please take a closer look at the error message. This is the part to pay close attention to: error

Likely, the reason for the error is that the slashes in the path are facing two different directions / and \. Please update your code to use only \ in the file path and see if this resolves the issue.

If this still does not resolve the issue, please check that you have a config file saved at the path defined in your code: C:\Users\samukku\.oci\config

Joe
  • 2,377
  • 1
  • 12
  • 12
  • After running the script its not generating '.oci\config' under path C:\Users\samukku\. How can I manually set that path or do I need to create a folder .oci and copy the config.file from the OCI library to .oci path? – Sanky Ach Mar 20 '21 at 14:18
  • Thank you Joe for the reply. – Sanky Ach Mar 20 '21 at 14:22
  • I have the config file in C:\Users\samukku\.oci\config. This config file I copied from the path ".../Python39/LIB/OCI/config". – Sanky Ach Mar 22 '21 at 13:29
  • Hi Sanky - is your issue resolved then? – Joe Mar 22 '21 at 16:32
  • Greetings..! , Not resolved. I do not know how to fix this issue. After moving oci folder from the python LIB folder to my environment LIB/site-packages folder, still not resolved. Giving error "ConfigFileNotFound" error. – Sanky Ach Mar 23 '21 at 04:54
  • First time when installed OCI package it was installed in "C:\Users\Sanky\AppData\Local\Programs\Python\Python39\Lib\site-packages\". I copied the OCI folder and saved in my environment path. Still I am getting the same error. – Sanky Ach Mar 23 '21 at 05:02
  • Instead of us resolving this through the comments, can you update your original question to have your current code, your current error message, your current error message stack trace, the current location of your OCI config file, and the current contents of your OCI config file (with any values in it slightly changed to protect your privacy) – Joe Mar 23 '21 at 16:53
-1

The reason the config file isn't supplied is because it uses resource identifiers which need to be defined based on your tenancy and compartment.

Here please refer https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/configuration.html for configuring the Config file.

Also refer https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/pythonsdk.htm this doc shall help in setting up the API if you missed out anything.

Thanks!