Quote from: bourbourg on 27 / April / 2020, 11:36:45Quote from: waterwingz on 26 / April / 2020, 10:24:27You might want to check out this forum thread.. CHDKPTP based Photobooth I put a bunch of detail in the fifth post.I tried to use it, but it's not in Python and i got too much error when i wanted to compile and run it.It was a quick & dirty program written in generic C. It was never intended to compile under Python.
Quote from: waterwingz on 26 / April / 2020, 10:24:27You might want to check out this forum thread.. CHDKPTP based Photobooth I put a bunch of detail in the fifth post.I tried to use it, but it's not in Python and i got too much error when i wanted to compile and run it.
You might want to check out this forum thread.. CHDKPTP based Photobooth I put a bunch of detail in the fifth post.
Thanks i succeed to install it, but now i get an error when i try to import it:i tried import chdkptp :does'nt work,I tried to change my python command startup : python photobooth_control.py by python3 photobooth_control.py still get the error:File "photobooth_control.py", line 7, in <module> import chdkptp_pyModuleNotFoundError: No module named 'chdkptp'
import chdkptp
Quote from: bourbourg on 28 / April / 2020, 03:01:01Thanks i succeed to install it, but now i get an error when i try to import it:i tried import chdkptp :does'nt work,I tried to change my python command startup : python photobooth_control.py by python3 photobooth_control.py still get the error:File "photobooth_control.py", line 7, in <module> import chdkptp_pyModuleNotFoundError: No module named 'chdkptp'It should beCode: [Select]import chdkptpnot chdkptp_py
Thanks, yes i still get the error, something is wrong with the module python, like it was not installed but i got the message that it was installed...
import syssys.path
pi@raspberrypi:~ $ pythonPython 2.7.16 (default, Oct 10 2019, 22:02:15)[GCC 8.3.0] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import sys>>> sys.path['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-arm-linux-gnueabihf', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/pi/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0']>>> quit()
pi@raspberrypi:/ $ sudo pip install https://github.com/5up3rD4n1/chdkptp.py/releases/download/v0.1.4/chdkptp.py-0.1.4.tar.gzLooking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting https://github.com/5up3rD4n1/chdkptp.py/releases/download/v0.1.4/chdkptp.py-0.1.4.tar.gz Downloading https://github.com/5up3rD4n1/chdkptp.py/releases/download/v0.1.4/chdkptp.py-0.1.4.tar.gz (1.5MB) 100% |████████████████████████████████| 1.5MB 80kB/sRequirement already satisfied: lupa>=1.1 in /usr/local/lib/python2.7/dist-packages (from chdkptp.py==0.1.4) (1.9)Building wheels for collected packages: chdkptp.py Running setup.py bdist_wheel for chdkptp.py ... done Stored in directory: /root/.cache/pip/wheels/d9/15/26/318c64e58d643efe9c575cecca308be93b2d2df5aa19327caaSuccessfully built chdkptp.pyInstalling collected packages: chdkptp.pySuccessfully installed chdkptp.py-0.1.4
pi@raspberrypi:/ $ sudo pythonPython 2.7.16 (default, Oct 10 2019, 22:02:15)[GCC 8.3.0] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import chdkptpTraceback (most recent call last): File "<stdin>", line 1, in <module> File "chdkptp.py", line 1 ^SyntaxError: I/O error while reading>>>
The error says "I/O error", which sounds like some file is missing, or there's a permission problem (but root shouldn't have those) or there was a real I/O error. Again, look at the files and try to figure out what's actually going on.FWIW, https://github.com/5up3rD4n1/chdkptp.py says"NOTE: if you installed the package and you are inside the repo dir and try to import chdkptp, it will probably throw an error because python is loading the local dir module not the installed one."So if you had some leftover files sitting around from previous attempts, that might cause a problem.It also says:"Before installation make sure you are running python3.6"I don't know if this is related to your problem, but you can use python3 to run python 3.x, instead of the 2.x you are using now. They use separate packages, so you'd need to install with pip3 rather than pip. Or use a venv.
sudo apt-get updatesudo apt-get install liblua5.2-devsudo apt-get install build-essential libusb-dev libreadline-devsudo apt autoremovepip install lupa --install-option='--no-luajit'sudo pip install https://github.com/5up3rD4n1/chdkptp.py/releases/download/v0.1.4/chdkptp.py-0.1.4.tar.gz
pip uninstall chdkptp.pypip install --no-cache-dir --verbose chdkptp.py
sudo chmod 664 /usr/lib/gvfs/gvfs-gphoto2-volume-monitorsudo chmod -x /usr/lib/gvfs/gvfs-gphoto2-volume-monitorsudo chmod -x /usr/lib/gvfs/gvfsd-gphoto2
pi@raspberrypi:~ $ pythonPython 2.7.16 (default, Oct 10 2019, 22:02:15)[GCC 8.3.0] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import chdkptp>>> chdkptp.list_devices()[DeviceInfo(model_name='Canon PowerShot A2200', bus_num='001', device_num='012', vendor_id=1193, product_id=12842, serial_num='12A16CC3FA404E0586B1F13D55679506', chdk_api=(2, 8))]>>> dev = chdkptp.ChdkDevice(chdkptp.list_devices()[0])>>> dev.switch_mode('record')>>>
Started by zeno General Discussion and Assistance
Started by sas4740 Script Writing
Started by jmonty General Help and Assistance on using CHDK stable releases
Started by rmackay9 General Discussion and Assistance
Started by 74prof CHDK Releases