picamera module not available

Asked 2 years ago, Updated 2 years ago, 74 views

I installed Python 2.7.10 on my initial raspberry pie.

$./configure&make&sudo make install
$ sudo apt-get install python-picamera

So far, I've felt that everything is going well, but I can't find picamera from Python
Maybe it's not working.

>>picamera
 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
 NameError: name 'picamera' is not defined

It will be

=sample.py =

File "sample.py", line 3, in <module>
    import picamera
 ImportError: No module named picamera

python-c "help('modules')" does not show picamera in the list

sudo apt-get install python-picamera still displays the message "latest".I also checked the installation log, but there seems to be no particular error. (It may look different...)

In this case, do I have to rewrite the path or change the destination of picamera?I've looked into it myself, but I've rarely touched Linux, so I'm stuck with it.I would appreciate it if someone could let me know.

Is the python installation method above recognized in the python 2.7 folder in /usr/local/lib/?
Where will the various modules be installed using the above installation method?
There are files that refer to them somewhere...
Would it be easier for amateurs to simply change the installation location of the picamera module?

(↓Up to these two have been successful.)

raspistill-oaaa.jpg
  gpicview aaa.jpg

·About dpk-L $dpkg-L python-picamera
          /usr/share/pyshared/picamera/camera.py

There is also a python 2.7 folder in usr/lib/.
 usr/lib/python 2.7/dist-packages/picamera/camera.py (marked like a shortcut)

·make install
 Downloading and installing python 2.7.10.
wget python.org/ftp/python/2.7.10/Python-2.7.10.tgz

·>>import sys
 >>sys.path
[', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/lib/python2.7/lib/lib/lothon2.7/lib/lib/lothon2.7/lib/lib/lib/lothon2.7/lib/lothon/lib/lothon/lothon2.7/lothon/loth

·python-c "help('modules')"
 Picamera was not displayed.

·=sample.py=
import sys
sys.path.append('/usr/share/pyshared/picamera/') ← I added it as a trial, but it didn't work
import picamera

I'm dented by the lack of progress.

python raspberry-pi

2022-09-30 21:11

1 Answers

import picamera will work if you boot to the full path like /usr/bin/python.


2022-09-30 21:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.