Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not seeing .env in 2.0.0beta 4 #59

Open
danhausman opened this issue Feb 4, 2022 · 7 comments
Open

not seeing .env in 2.0.0beta 4 #59

danhausman opened this issue Feb 4, 2022 · 7 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@danhausman
Copy link

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.

@highvolt-dev
Copy link
Owner

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:

  1. pip3 uninstall tmo_monitor
  2. 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.

@danhausman
Copy link
Author

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.

@highvolt-dev highvolt-dev added bug Something isn't working documentation Improvements or additions to documentation labels Feb 4, 2022
@highvolt-dev
Copy link
Owner

@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.

@danhausman
Copy link
Author

Sounds good, if you need me to test or try anything let me know. I am happy to help.

@AndrewPardoe
Copy link
Contributor

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.

@highvolt-dev
Copy link
Owner

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?

@danhausman
Copy link
Author

@highvolt-dev This will probably not work for windows but /usr/local/share/etc or /usr/local/share/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants