magico13 / PyEmVue

Python Library for the Emporia Vue Energy Monitor
MIT License
185 stars 36 forks source link

Issue with setup.py #46

Open bicarbonate opened 1 year ago

bicarbonate commented 1 year ago

So Ill admit, I'm not so great with Python apps, I did not see the appropriate usage of the setup.py file so I cat'd it. Look like it's trying to open README.md, however after cloning the repo the file is all lowercase. So I renamed it, set the setup file to executable and tried. I get the following errors:

skeer@spektr  /home/git/PyEmVue   master ●  ./setup.py ./setup.py: 1: import: not found ./setup.py: 3: try:: not found ./setup.py: 4: Syntax error: "(" unexpected ✘ skeer@spektr  /home/git/PyEmVue   master ● 

Took a look at the requirements.txt file and there were two truncated characters at the beginning of line 1. I removed those and replaced them with the '^@' like all the other lines, same errors.

Is there a document I missed with regards to dealing with that file in order to use your application?

Thanks!

magico13 commented 1 year ago

This is a Python module, not a full application, so it only really provides methods for use in other Python scripts/applications. There's generally not a reason to clone this repository unless you need to make changes to the module itself. What's your end goal and I can maybe help you get there?

setup.py isn't meant to be run manually, it's for building the release to PyPi, the Python package manager. Normally you would use pip to install this module and then import pyemvue in your Python script to use it, as the readme file shows. You can technically run the module directly since it's got a default script built in but that's more of a quick test than anything useful.

bicarbonate commented 1 year ago

my ignorance has entered the chat

Seriously though, thanks for the explanation, I was totally lost. So installing via pip, that's something I can handle. I found this repo while looking for a better way to get information from my Emporia, perhaps the readme or wiki could do with a section for dullards like myself?

ajk1982 commented 1 year ago

I am having a little trouble too. In pycharm after running pip install . to install the package with setup.py I try import pyemvue vue = PyEmVue() and I get Unresolved reference 'PyEmVue'. What am I doing wrong?

Edit: Ok looks like you have to do from pyemvue.pyemvue import PyEmVue