corbinbs / solarshed

A Python library to help monitor solar charge controllers typically used in off the grid applications.
MIT License
85 stars 24 forks source link

Failing to find module when run #8

Closed madmacks59 closed 5 years ago

madmacks59 commented 5 years ago

Odd thing, I installed the packages using the standard process (pip install solarshed, and pip3 install solarshed), and originally things worked fine. Was able to start the server process and then use your curl example to grab values from the Renogy control.

Now, I'm writing a small python program to try and access the values using the methods you provide (sample in your readme file).

I have an import as follows: from solarshed.controllers.renogy_rover import RenogyRover

when I try and run the code I get:

File "/home/pi/renogytest.py", line 2, in from solarshed import * ImportError: No module named 'solarshed'

I just reran the pip installs, which seem to have worked, but still have the same problem.

Any ideas? I'm currently looking at my paths and am also trying to find the installed packages, not any feedback would be appreciated...

madmacks59 commented 5 years ago

Never mind, I found the problem (user error). All the packages installed properly, and my python path was fine. Turned out to be the following. I have a Pi with a 7" touch display, and I also run VNC Viewer on my MacBook Pro. Because the window session on the Pi is defined to use the 7" touch display I set up a separate session on the Pi with a larger virtual display, and that is what I attach to from my MacBook. Anyway, I'd build everything out and installed the packages directly on the Pi but the second VNC session apparently didn't pick up the pathing or the packages. Once I new the paths were correct and that packages were installed properly I killed and restarted that second session, and apparently when the new bash environment started it cleared up the pathing problem. Anyway, problem resolved...

corbinbs commented 5 years ago

Hi @madmacks59 ,

Glad you were able to work this one out!

Thanks,

Brian