Tal Nidam
03/19/2025, 9:20 AMkapa.ai
03/19/2025, 9:20 AMkapa.ai
03/19/2025, 9:21 AMedr command in your environment. This is a common issue when trying to run Elementary Data's CLI commands through subprocess. ## Why this happens The FileNotFoundError: [Errno 2] No such file or directory: 'edr' error occurs because: 1. The edr command isn't in your system's PATH 2. Elementary Data might not be properly installed in the environment where your subprocess is running ## How to fix it Based on similar issues from the Elementary community, here are some solutions: ### 1. Use the full path to the edr executable Instead of just using 'edr' in your subprocess command, try using the full path to the edr executable: python # Find where edr is installed import shutil edr_path = shutil.which('edr') # Then use the full path in your subprocess result = subprocess.run([edr_path, 'monitor', 'send-report', ...]) ### 2. Make sure Elementary is installed in the correct environment Several users have reported similar issues when Elementary wasn't properly installed in their environment: python # Install Elementary in your environment first subprocess.run(['pip', 'install', 'elementary-data[snowflake]']) ### 3. For Airflow/Prefect environments, use a virtual environment approach As seen in the community discussions, many users solved this by properly setting up a virtual environment: python # Example approach for running in a specific directory with environment setup subprocess.run([ 'bash', '-c', 'cd /path/to/your/project && source /path/to/venv/bin/activate && edr monitor send-report ...' ]) ### 4. Check if dbt is properly installed Elementary requires dbt to be installed and accessible. Make sure dbt is installed in the same environment where you're running the subprocess command [Slack forum user question](https://slack.com/archives/C02CTC89LAX/p1674765605663069). ## Additional troubleshooting If you're still facing issues, you might want to: 1. Verify Elementary is installed: pip list | grep elementary 2. Check if the edr command is available: which edr 3. Try running a simple edr command directly in your terminal to confirm it works outside of subprocess This is a common issue in the Elementary community, especially when running in containerized environments or automation platforms like Airflow and Prefect. I hope this helps resolve your issue! I'm here to help if you need further assistance with Elementary Data. I'm here to help if you need further assistance with Elementary Data.Tal Nidam
03/19/2025, 3:07 PMwhich edr not works