Giter Site home page Giter Site logo

Comments (15)

chrisb2 avatar chrisb2 commented on May 25, 2024 2

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 25, 2024 1

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.

Losaccoj avatar Losaccoj commented on May 25, 2024

Thank you so much!! I was really stumped before I found this.

from pi_ina219.

rhaejr avatar rhaejr commented on May 25, 2024

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.

chrisb2 avatar chrisb2 commented on May 25, 2024

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.

david-harkey avatar david-harkey commented on May 25, 2024

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.

chrisb2 avatar chrisb2 commented on May 25, 2024

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.

david-harkey avatar david-harkey commented on May 25, 2024

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.

GawiQ avatar GawiQ commented on May 25, 2024

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.

chrisb2 avatar chrisb2 commented on May 25, 2024

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.

GawiQ avatar GawiQ commented on May 25, 2024

Thanks for response. I tried what you suggested but it didn't work. Still got the same error.

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 25, 2024

from pi_ina219.

chrisb2 avatar chrisb2 commented on May 25, 2024

from pi_ina219.

GawiQ avatar GawiQ commented on May 25, 2024

LIS3DH_bus1.py.gz
Manual installation didn't work. Do you think system reinstallation would work? Here is the file

from pi_ina219.

GawiQ avatar GawiQ commented on May 25, 2024

Did the same and now it works.
Thanks man, really appreciate this. Awesome helping you did here :)

from pi_ina219.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.