Comments (15)
from pi_ina219.
To install dependencies for Python 3 on Raspberry Pi, this need to be executed:
sudo python3 -m pip install git+git://github.com/chrisb2/pi_ina219.git
this fixes the import error above.
from pi_ina219.
Thank you so much!! I was really stumped before I found this.
from pi_ina219.
I'm not sure if I am doing something wrong or what but this is not fixing the issue for me? Everything works great if i us Python 2.7, but everything goes to pot when I try it on Python 3.6.
When I run pip list I get:
Adafruit-GPIO (1.0.3)
Adafruit-PureIO (0.2.1)
asn1crypto (0.22.0)
certifi (2017.4.17)
cffi (1.10.0)
chardet (3.0.4)
conda (4.3.29)
cryptography (1.9)
idna (2.5)
mock (2.0.0)
packaging (16.8)
pbr (3.1.1)
pi-ina219 (1.1.0)
pip (9.0.1)
pycosat (0.6.1)
pycparser (2.17)
pyOpenSSL (16.2.0)
pyparsing (2.2.0)
pytube (8.0.2)
requests (2.18.1)
RPi.GPIO (0.6.3)
ruamel.yaml (0.11.7)
setuptools (36.0.1)
six (1.10.0)
spidev (3.2)
urllib3 (1.21.1)
wheel (0.29.0)
from pi_ina219.
If you ran
pip list
then this gives you the packages install for Python 2, to see what is install for Python 3, you need:
pip3 list
Similarly to install the library for Python 3.6 you would need to use pip3. See INSTALLING PYTHON PACKAGES
What error are you getting?
Can you provide an example of the failing code?
regards,
Chris
from pi_ina219.
Similar to rhaejr above, this fix isn't working. I'm getting an error when I run that line:
Downloading/unpacking git+git://github.com/chrisb2/pi_ina219.git
Cloning git://github.com/chrisb2/pi_ina219.git to /tmp/pip-vplibbw8-build
fatal: unable to connect to github.com:
github.com[0: 192.30.253.113]: errno=No route to host
github.com[1: 192.30.253.112]: errno=No route to host
Complete output from command /usr/bin/git clone -q git://github.com/chrisb2/pi_ina219.git /tmp/pip-vplibbw8-build:
----------------------------------------
Cleaning up...
Command /usr/bin/git clone -q git://github.com/chrisb2/pi_ina219.git /tmp/pip-vplibbw8-build failed with error code 128 in None
Storing debug log for failure in /root/.pip/pip.log
I looked in the debug log that was mentioned, and here's the output:
------------------------------------------------------------
/usr/lib/python3/dist-packages/pip/__main__.py run on Sat Feb 24 22:28:30 2018
Downloading/unpacking git+git://github.com/chrisb2/pi_ina219.git
Cloning git://github.com/chrisb2/pi_ina219.git to /tmp/pip-1zn5nw2s-build
Found command 'git' at '/usr/bin/git'
Running command /usr/bin/git clone -q git://github.com/chrisb2/pi_ina219.git /tmp/pip-1zn5nw2s-build
Complete output from command /usr/bin/git clone -q git://github.com/chrisb2/pi_ina219.git /tmp/pip-1zn5nw2s-build:
----------------------------------------
Cleaning up...
Command /usr/bin/git clone -q git://github.com/chrisb2/pi_ina219.git /tmp/pip-1zn5nw2s-build failed with error code 128 in None
Exception information:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 290, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1198, in prepare_files
do_download,
File "/usr/lib/python3/dist-packages/pip/req.py", line 1361, in unpack_url
unpack_vcs_link(link, loc, only_download)
File "/usr/lib/python3/dist-packages/pip/download.py", line 344, in unpack_vcs_link
vcs_backend.unpack(location)
File "/usr/lib/python3/dist-packages/pip/vcs/__init__.py", line 240, in unpack
self.obtain(location)
File "/usr/lib/python3/dist-packages/pip/vcs/git.py", line 111, in obtain
call_subprocess([self.cmd, 'clone', '-q', url, dest])
File "/usr/lib/python3/dist-packages/pip/util.py", line 716, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command /usr/bin/git clone -q git://github.com/chrisb2/pi_ina219.git /tmp/pip-1zn5nw2s-build failed with error code 128 in None
Looks like I'm having issues cloning the repo. Any thoughts?
from pi_ina219.
It looks like from the error:
fatal: unable to connect to github.com
that github.com in not contactable by your machine, what happens if you do:
ping github.com
If this does not work, you may need to check your network setup.
Chris
from pi_ina219.
I think you're right, it seems to be a network issue. (I can connect to the internet via GUI apps or apt-get commands, but I can't ping or use git to clone)
In any case, I was able to install the package via sudo pip3 install pi-ina219
. Thanks for your help!
from pi_ina219.
Hi
I had this problem before and managed to fix it with
sudo python3 -m pip install git+git://github.com/chrisb2/pi_ina219.git
Adafruit_GPIO was indeed not listed on pip3 list.
Unfortunatelly I got some system upgrades and now the following error occurs again:
File "/home/pi/Desktop/python-lis3dh-master/LIS3DH_bus1.py", line 2, in <module> from Adafruit_GPIO import I2C ImportError: No module named 'Adafruit_GPIO'
but now when I checked the lists Adafruit_GPIO was present on both and installing dependecies for python 3 doesn't seem to work :/
Please help
from pi_ina219.
Try using pip3 to uninstall pi_ina219 and Adafruit_GPIO, check they are no longer listed by pip3 list, then re-install pi_ina219.
Chris
from pi_ina219.
Thanks for response. I tried what you suggested but it didn't work. Still got the same error.
from pi_ina219.
from pi_ina219.
from pi_ina219.
LIS3DH_bus1.py.gz
Manual installation didn't work. Do you think system reinstallation would work? Here is the file
from pi_ina219.
Did the same and now it works.
Thanks man, really appreciate this. Awesome helping you did here :)
from pi_ina219.
Related Issues (20)
- Calculation of "current" for negative "shunt_voltage" HOT 10
- Current overflow false positive HOT 7
- cannot import name INA219 HOT 5
- Citation HOT 1
- Use named logger instead of root HOT 5
- getting [Errno 121] Remote I/O error? HOT 8
- Unable to get ADC_16SAMP (or any of the others to work) HOT 2
- ImportError: cannot import name INA219 HOT 8
- improbable values returned?
- Convert from Adafruit_GPIO library (which is archived) to smbus2 library HOT 2
- Reading current samples from python while INA219 is connected to Arduino board HOT 1
- ina219.DeviceRangeError: Current out of range I have got exactly the same problem when trying to install Raspberry PI i52 UPS Plus HAT. Device is called EP-0136 HOT 1
- Problem with this on a Pi Pico HOT 7
- OSError: [Errno 121] Remote I/O error HOT 15
- Force library to use specified logging level HOT 1
- not working on raspberrypiOS 32 bit HOT 1
- No change in resolution or time when changing ADC samples and bit HOT 5
- Library depends on obsolete dependency
- [Solved] Needed version for Raspberry Pi 5 - PiOS Bookworm 64-bit - GoPiGo3 Robot
- Max Amps 3.2A not possible with Voltage Range 32V and Shunt 0.1 Ohm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi_ina219.