Reputation: 407
I am trying to set up the environment variable to point to following however it gives me error
os.environ["PATH"]= "C:\APPS\ORACLE\product\12.1.0\Client_64\Instantclient"
I get the error "Invalid character or identifier"
I am able to navigate the above path so not sure what is failing.
Upvotes: 1
Views: 243
Reputation: 20490
You need to escape the 1
in 12
import os
os.environ["PATH"] = "C:\APPS\ORACLE\product\\12.1.0\Client_64\Instantclient"
print(os.environ['PATH'])
#C:\APPS\ORACLE\product\12.1.0\Client_64\Instantclient
Upvotes: 2
Reputation: 3001
Try passing it as a raw string (no need to escape backslashes or anything else then):
os.environ["PATH"]= r"C:\APPS\ORACLE\product\12.1.0\Client_64\Instantclient"
Note the prefixed r
before the string.
Upvotes: 8