jbaiter / chdkptp.py

Python bindings for chdkptp
GNU General Public License v3.0
13 stars 14 forks source link

Can't install on raspberry pi 3b+ #11

Open bourbourg opened 4 years ago

bourbourg commented 4 years ago

Hi,

I tried to install on my raspberry pi but it can't finish the following command: sudo pip install chdkptp.py

I get this error: Failed to build wheel for chdkptp.py and then: Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e68krr/chdkptp.py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-nAn0pP/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-e68krr/chdkptp.py/

bourbourg commented 4 years ago

The first error is Building wheels for collected packages: chdkptp.py Running setup.py bdist_wheel for chdkptp.py ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e68krr/chdkptp.py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-sJZ9Zd --python-tag cp27:

appetito commented 4 years ago

@bourbourg make sure that Lua and libusb installed, or install sudo apt install lua5.2-dev libusb-dev

cosminonea commented 1 year ago

This error is probably because the patch command fails. I get this when I try to install it from source

root@raspberrypi:/home/pi/src/chdkptp-py# python setup.py install
running install
patching file Makefile
Hunk #1 FAILED at 119.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
patching file chdkptp.c
Hunk #1 FAILED at 2193.
Hunk #2 FAILED at 2262.
2 out of 2 hunks FAILED -- saving rejects to file chdkptp.c.rej
patching file include.mk
Hunk #1 FAILED at 8.
Hunk #2 FAILED at 16.
Hunk #3 FAILED at 24.
3 out of 3 hunks FAILED -- saving rejects to file include.mk.rej
Traceback (most recent call last):
  File "/home/pi/src/chdkptp-py/setup.py", line 21, in <module>
    setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/pi/src/chdkptp-py/setup.py", line 14, in run
    subprocess.check_call(['patch', '-f', '-d', CHDKPTP_PATH, '-i',
  File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['patch', '-f', '-d', '/home/pi/src/chdkptp-py/chdkptp/vendor/chdkptp', '-i', '/home/pi/src/chdkptp-py/chdkptp_module.diff', '-p', '1']' returned non-zero exit status 1.