我正在尝试在我的Raspberry Pi Model B上运行GAE for Python 2.7,我正在完全按照教程,但每当我输入"dev_appserver.py"命令时,它都会返回:
bash:dev_appserver.py:找不到命令
要么
sudo:dev_appserver.py:找不到命令
是不是可以在Pi上运行它?
我已经按照SE上的教程以及从Hertaville和bootc尝试额外的步骤,但我仍然得到提示原始SE问题的错误.我很难过.
在得到错误之前,我进入了该过程的五个步骤:
sudo apt-get install git rsync cmake lib32z1 lib32ncurses5 lib32bz2-1.0
git clone git://github.com/raspberrypi/tools.git
export PATH=$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
. ~/.bashrc
arm-linux-gnueabihf-gcc -v
Run Code Online (Sandbox Code Playgroud)
错误:
arm-linux-gnueabihf-gcc: error while loading shared libraries:
libstdc++.so.6: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)
libstdc++.so.6在教程中提到的所有三个目录树中都存在./lib/x86_64-linux-gnu/libstdc++.so.6,但是在路径中添加相关的目录树没有帮助(见下文).我怀疑没有设置库路径,但我不知道那是什么.
我在运行Ubuntu 13.10的虚拟机中使用netbeans和其他工具,以及安装了LAMP堆栈.netbeans会很好地构建和运行C/C++可执行文件(显然IO可以从命令行执行相同的操作).
我试过的其他事情没有成功
export PATH=$PATH:$HOME/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/lib
Run Code Online (Sandbox Code Playgroud)
Hertaville建议添加32位架构:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6-i386 lib32stdc++6 zlib1g:i386
Run Code Online (Sandbox Code Playgroud)
而"构建必不可少"的包:
sudo apt-get install build-essential git
Run Code Online (Sandbox Code Playgroud)
这也没有帮助.我也重新启动以防万一.
我正在用运动传感器设置我的覆盆子pi.我正在使用modmypie中的一些简单代码python代码.我从终端窗口运行代码,但SyntaxError: invalid syntax
继续print (“Motion Detected!”).这是一个如此简单的路线,但无法弄清楚问题是什么.
# coding: utf-8
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
PIR_PIN = 7
GPIO.setup(PIR_PIN, GPIO.IN)
def MOTION(PIR_PIN):
print “Motion Detected!”
print “PIR Module Test (CTRL+C to exit)”
time.sleep(2)
print “Ready”
try:
GPIO.add_event_detect(PIR_PIN, GPIO.RISING, callback=MOTION)
while 1:
time.sleep(100)
except KeyboardInterrupt:
print “ Quit”
GPIO.cleanup()
Run Code Online (Sandbox Code Playgroud) 我提前为这些问题的一般性质道歉,但我不熟悉使用我的Pi.
我最近想到如何将我自己的一些文件作为.torrents提供,并且真的希望能够从Pi中做到这一点.
在某种程度上,这是一个多部分问题.
这可以完成吗?Pi甚至可以处理这种类型的负载吗?我是否需要做一些特殊的事情来让torrent服务器从外部USB驱动器读取文件?如果我遗失了什么,请发表评论,我会尽力澄清我想要完成的事情.在此先感谢您的帮助.
我最近按照Kivy网站上的说明在Raspberry Pi(使用Raspbian系统)上安装了Kivy.
我的意思是测试我写的程序.它在我的Linux Mint计算机上运行良好.然而,在Raspbian上,它崩溃了一个奇怪的错误,链接到Kivy自己的一个函数.
这是终端输出:
$ python main.py
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_15-01-10_6.txt
[INFO ] Kivy v1.9.0-dev
[INFO ] [Python ] v2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3]
[INFO ] [Factory ] 173 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_pygame (img_pil, img_ffpyplayer ignored)
[INFO ] [Window ] Provider: egl_rpi
[INFO ] [GL ] OpenGL version <OpenGL ES 2.0>
[INFO ] [GL ] OpenGL vendor <Broadcom>
[INFO ] [GL ] OpenGL renderer <VideoCore …Run Code Online (Sandbox Code Playgroud) 我正在写一个python脚本,它将具有一个ASCII菜单来设置游戏中时光倒流。并将图像发送到我的Web服务器或USB(如果服务器不可用)。
我正在执行线程脚本。所以我不确定是否是线程问题还是什么,但是我遇到了错误:TypeError: 'tuple' object is not callable。
我的代码(完整代码):
class timelaps(threading.Thread):
"""docstring for timelaps"""
def __init__(self, res, delay, numberOfImages):
super(timelaps, self).__init__()
self.delay = delay
if delay < 20:
self.delay = 20
pass
self.numberOfImages = numberOfImages
def run(self):
currentImage = 0
camera = picamera.PiCamera()
camera.resolution(2592, 1944)
Run Code Online (Sandbox Code Playgroud)
这是就行了camera.resolution(2592, 1944),我遇到了错误。根据Picamera Docs的说法,应该只有camera.resolution(2592, 1944)分辨率,并且分辨率应该设置为该分辨率。有什么建议么?
我为我的Python应用程序配备了日志记录功能,它在我的Windows系统上使用Python 3.4完美运行.但是当我使用Raspbian和Python 3.2在我的Raspberry Pi上部署应用程序时,我收到以下错误:
Traceback (most recent call last):
File "aurora/aurora_websocket.py", line 265, in <module>
logging.config.fileConfig('logging.conf')
File "/usr/lib/python3.2/logging/config.py", line 70, in fileConfig
formatters = _create_formatters(cp)
File "/usr/lib/python3.2/logging/config.py", line 106, in _create_formatters
flist = cp["formatters"]["keys"]
File "/usr/lib/python3.2/configparser.py", line 941, in __getitem__
raise KeyError(key)
KeyError: 'formatters'
Run Code Online (Sandbox Code Playgroud)
logging.conf文件(以UTF-8编码,无BOM):
[loggers]
keys=root,simpleExample
[handlers]
keys=screen
[formatters]
keys=simple,complex
[logger_root]
level=NOTSET
handlers=screen
[logger_simpleExample]
level=DEBUG
handlers=screen
qualname=simpleExample
propagate=0
[handler_screen]
class=StreamHandler
level=DEBUG
formatter=complex
args=(sys.stdout,)
[formatter_simple]
format=%(asctime)s - %(levelname)s - %(message)s
datefmt=
[formatter_complex]
format=%(asctime)s - %(levelname)-8s - <%(module)s : %(lineno)d> - …Run Code Online (Sandbox Code Playgroud) 我有两个运行python代码的Raspberry Pis来检索RFID标签的序列号.其中一个带有Wiegand接口的RFID阅读器连接到GPIO引脚,另一个带有RFID阅读器,其行为类似于通过USB连接的键盘.但是,当扫描相同的RFID标签时,我从两个阅读器获得不同的数字.
例如,对于一个标签,我使用Wiegand读取器从Raspberry Pi获得57924897,使用USB键盘读取器从Raspberry Pi获得0004591983.
sombody可以解释一下这个区别吗?这两位读者都是一样的吗?或者他们只是阅读一些不同的参数?
我正在制作ac程序,后来必须在raspberry pi上运行,程序从命令行获取一个参数,确定它的值是否介于0和15之间.如果是这样,将其转换为二进制并返回它.
如果没有,只打印错误信息.
这是代码:
#include <stdio.h>
#include <stdlib.h>
int convert(int dec)
{
if (dec == 0)
{
return 0;
}
else
{
return (dec % 2 + 10 * convert(dec / 2));
}
}
int main(int argc, char *argv[])
{
// argc is number of arguments given including a.out in command line
// argv is a list of string containing command line arguments
printf("the number is:%s \n", argv[2]);
int v = atoi(argv[2]);
int bin = 0;
if(v >= 0 && …Run Code Online (Sandbox Code Playgroud) 我正在学习如何使用汇编语言(顺便说一句在Raspberry Pi上),并且想知道使用gcc和as进行编译之间有什么区别。
到目前为止,我注意到的差异是:
as。as似乎比单独识别要好gcc。gcc在使用整数除法之类的指令之前,我必须告诉架构。gcc我可以很方便地在C标准库函数。我认为可以使用,as但我还没有弄清楚。我想坚持使用特定的编译器。我应该知道还有什么其他区别。使用这两种方法都有优点/缺点吗?
raspberry-pi ×10
python ×5
python-2.7 ×2
raspbian ×2
assembly ×1
c ×1
camera ×1
file ×1
gcc ×1
gpio ×1
keyerror ×1
kivy ×1
logging ×1
python-3.2 ×1
rfid ×1
server ×1
share ×1
tags ×1
ubuntu-13.10 ×1
wiegand ×1