fix(cli): load .env from user's CWD when run as console script
load_dotenv() with no arguments walks up from site-packages instead of the user's CWD, so the installed tradingagents console script silently misses the project's .env. Pass find_dotenv(usecwd=True) so the search starts from CWD; same treatment for .env.enterprise. #726 #755 #612 #747 #743 #753 #729 #728 #751
This commit is contained in:
1 parent
7e9e7b83c7
commit
db7e0a67e2
2 files changed
+8
-7
No files matched your search
@@ -1,10 +1,9 @@
|
||||
from tradingagents.graph.trading_graph import TradingAgentsGraph
|
||||
from tradingagents.default_config import DEFAULT_CONFIG
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from dotenv import find_dotenv, load_dotenv
|
||||
|
||||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
load_dotenv(find_dotenv(usecwd=True))
|
||||
|
||||
# Create a custom config
|
||||
config = DEFAULT_CONFIG.copy()
|
||||
|
||||
Reference in new issue
Block a user