Closed lovedva closed 5 years ago
Sorry for delay in replying, I was ill last week.
So you initially ran the following and it succeeded?
sudo pip install pi-ina219
You can verify if this worked with:
pip list | grep ina219
It should return:
pi-ina219 (1.2.0)
I presume 'ina219.py' is a test program can you post the contents?
Python 2 or 3 should work, you just have to use the matching pip command 'pip' for Python 2 and 'pip3' for Python 3.
regards, Chris
Yes, I can install it by pip and it returns pi-ina219,but cannot import name.... I just copied the sample code to "ina219.py"
Sorry for delay in replying, I was ill last week.
So you initially ran the following and it succeeded?
sudo pip install pi-ina219
You can verify if this worked with:
pip list | grep ina219
It should return:
pi-ina219 (1.2.0)
I presume 'ina219.py' is a test program can you post the contents?
Python 2 or 3 should work, you just have to use the matching pip command 'pip' for Python 2 and 'pip3' for Python 3.
regards, Chris
I just give up . I copied your code file to my project and import works properly.
OK, good to hear you got it working.
I know this is closed, but in case anyone else ends up here with this error, the interpreter picked up his ina219.py as the module instead of his test program. Simply rename the test program to something like ina219_test.py and it should get well.
and I tried to pip3 install it but same error occurred. How can I fix it?