Jan-24-2020, 04:21 AM
Hi
I am working with some sample code from ciscoAxl sdk
part of the sample code is this:
It looks like it is returning most of the environment path, but I dont know what it is looking for with the .env at the end.
Can anyone give any suggestions?
thanks
I am working with some sample code from ciscoAxl sdk
part of the sample code is this:
import os #for ciscoaxl sdk from ciscoaxl import axl #for ciscoaxl sdk from py_dotenv import read_dotenv dotenv_path = os.path.join(os.path.dirname(__file__), '.env') #orig read_dotenv(dotenv_path)however when I run that, I get the following error.
Error:Traceback (most recent call last):
File "C:\Users\itsMe\eclipsePython-workspace\PythonTestMod\Demo.py", line 4, in <module>
read_dotenv(dotenv_path)
File "C:\Users\itsMe\AppData\Local\Programs\Python\Python36-32\lib\site-packages\py_dotenv\dotenv.py", line 10, in read_dotenv
'Not loading {} - it doesn\'t exists'.format(file_path)
FileNotFoundError: Not loading C:\Users\itsMe\eclipsePython-workspace\PythonTestMod\.env - it doesn't exists
I tried it with quotes around the file "__file__" as suggested in a post somewhere but no luck.It looks like it is returning most of the environment path, but I dont know what it is looking for with the .env at the end.
Can anyone give any suggestions?
thanks