tmo-monitor
tmo-monitor copied to clipboard
not seeing .env in 2.0.0beta 4
Running on a raspberry pi, It is not seeing the .env file when I run python3 bin/tmo-monitor.py
I put the .env in the bin folder, then second guessed myself and put in in the tmo-monitor-2.0.0-beta4 folder. No luck either way.
I had to help someone with this a few days ago. The .env should be in the main project folder, not the bin folder.
Try the following:
-
pip3 uninstall tmo_monitor
-
pip3 install .
If that does not work, I think the person finally resolved the issue with pip3 install -e .
instead, which is normally used in development mode to detect changes to files in the project.
ok good, the way I understood it was in the main project. Uninstall and re-install did not work, but using -e did the trick though thanks. May want to put some documentation in the Readme or the .env
Appreciate the quick help.
@danhausman thanks for confirming. I need to ensure this is setup correctly for seamless upgrades, I probably need to update setup.py
for it to behave correctly. Keeping your issue open for now.
Sounds good, if you need me to test or try anything let me know. I am happy to help.
I had the same problem on Windows.
pip3 uninstall tmo_monitor
pip3 install -e .
fixed the issue.
Note that the .env
file can be in both places, it doesn't matter. The module will go up the directory tree until it finds the first .env
file.
This issue should be caused by the fact we are now formally installing the script. The installed copy is not tied back to the cloned repository once installed unless done with the -e
flag.
Given that users will not throw a .env
file in the location the package is installed, resolving this issue requires some consensus around the most natural behavior that should be used here.
In the future, this package will be uploaded to PyPi (issue #15), in which case users will not have the repository cloned at all.
Some hypothetical search paths:
- user HOME directory or equivalent (probably would need a namespaced filename or a dot folder)
- current working directory
- specified by environment variable e.g.
TMO_MONITOR_ENV
Any thoughts here, @danhausman @AndrewPardoe?
@highvolt-dev This will probably not work for windows but /usr/local/share/etc or /usr/local/share/