r-cute / rcute-ai

3 stars 6 forks source link

你好,安装rcute ai时候报错,查了很多资料,请求帮助; #11

Open todayjt opened 2 years ago

todayjt commented 2 years ago

ERROR: Command errored out with exit status 1: command: /Users/jintian/opt/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/rcute-ai_162436b91a3841eebf5ce203ce46f9c7/setup.py'"'"'; file='"'"'/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/rcute-ai_162436b91a3841eebf5ce203ce46f9c7/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-pip-egg-info-pe6dk1m9 cwd: /private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/rcute-ai_162436b91a3841eebf5ce203ce46f9c7/ Complete output (5 lines): Traceback (most recent call last): File "", line 1, in File "/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/rcute-ai_162436b91a3841eebf5ce203ce46f9c7/setup.py", line 19, in with open(requirements_path, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: './requirements.txt'

WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/3b/fb/884e4eff8b6818f74e1c83ad4fbdb83c0f56bd2235cf5fa1d3d8c6bed961/rcute-ai-0.1.1.tar.gz#sha256=105f98e4b701013775bed3db51c609313c1ae27ad7ad96e43d33a4059433b92e (from https://pypi.tuna.tsinghua.edu.cn/simple/rcute-ai/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Using cached https://pypi.tuna.tsinghua.edu.cn/packages/59/16/b4ebfe27fad23d08e08ae41b3ad72f09b25211f1954712a370f37d09ed6a/rcute_ai-0.1.0-py3-none-any.whl (16 kB) Requirement already satisfied: numpy in ./opt/anaconda3/lib/python3.8/site-packages (from rcute-ai) (1.20.1) Collecting pyaudio Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz (37 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: vosk in ./opt/anaconda3/lib/python3.8/site-packages (from rcute-ai) (0.3.31) Collecting face-recognition Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1e/95/f6c9330f54ab07bfa032bf3715c12455a381083125d8880c43cbe76bb3d0/face_recognition-1.3.0-py2.py3-none-any.whl (15 kB) Requirement already satisfied: opencv-python in ./opt/anaconda3/lib/python3.8/site-packages (from rcute-ai) (4.5.3.56) Requirement already satisfied: Pillow in ./opt/anaconda3/lib/python3.8/site-packages (from rcute-ai) (8.2.0) Requirement already satisfied: qrcode in ./opt/anaconda3/lib/python3.8/site-packages (from rcute-ai) (7.3.1) Requirement already satisfied: Click>=6.0 in ./opt/anaconda3/lib/python3.8/site-packages (from face-recognition->rcute-ai) (7.1.2) Requirement already satisfied: face-recognition-models>=0.3.0 in ./opt/anaconda3/lib/python3.8/site-packages (from face-recognition->rcute-ai) (0.3.0) Requirement already satisfied: dlib>=19.7 in ./opt/anaconda3/lib/python3.8/site-packages (from face-recognition->rcute-ai) (19.22.1) Requirement already satisfied: cffi>=1.0 in ./opt/anaconda3/lib/python3.8/site-packages (from vosk->rcute-ai) (1.14.5) Requirement already satisfied: pycparser in ./opt/anaconda3/lib/python3.8/site-packages (from cffi>=1.0->vosk->rcute-ai) (2.20) Building wheels for collected packages: pyaudio Building wheel for pyaudio (setup.py) ... error ERROR: Command errored out with exit status 1: command: /Users/jintian/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/pyaudio_48ca337aeebc495796a352a80fc089df/setup.py'"'"'; file='"'"'/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/pyaudio_48ca337aeebc495796a352a80fc089df/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-wheel-3t4eti8s cwd: /private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/pyaudio_48ca337aeebc495796a352a80fc089df/ Complete output (16 lines): running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.9-x86_64-3.8 copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.8 running build_ext building '_portaudio' extension creating build/temp.macosx-10.9-x86_64-3.8 creating build/temp.macosx-10.9-x86_64-3.8/src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/jintian/opt/anaconda3/include -arch x86_64 -I/Users/jintian/opt/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/jintian/opt/anaconda3/include/python3.8 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.8/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found

include "portaudio.h"

       ^~~~~~~~~~~~~

1 error generated. error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for pyaudio Running setup.py clean for pyaudio Failed to build pyaudio Installing collected packages: pyaudio, face-recognition, rcute-ai Running setup.py install for pyaudio ... error ERROR: Command errored out with exit status 1: command: /Users/jintian/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/pyaudio_48ca337aeebc495796a352a80fc089df/setup.py'"'"'; file='"'"'/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/pyaudio48ca337aeebc495796a352a80fc089df/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-record-jcetesl/install-record.txt --single-version-externally-managed --compile --install-headers /Users/jintian/opt/anaconda3/include/python3.8/pyaudio cwd: /private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/pyaudio_48ca337aeebc495796a352a80fc089df/ Complete output (16 lines): running install running build running build_py creating build creating build/lib.macosx-10.9-x86_64-3.8 copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.8 running build_ext building '_portaudio' extension creating build/temp.macosx-10.9-x86_64-3.8 creating build/temp.macosx-10.9-x86_64-3.8/src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/jintian/opt/anaconda3/include -arch x86_64 -I/Users/jintian/opt/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/jintian/opt/anaconda3/include/python3.8 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.8/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found

include "portaudio.h"

         ^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------

ERROR: Command errored out with exit status 1: /Users/jintian/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/pyaudio_48ca337aeebc495796a352a80fc089df/setup.py'"'"'; file='"'"'/private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-install-ogastbe5/pyaudio48ca337aeebc495796a352a80fc089df/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/n9/zbqn6dhn5qv72xfxxdxskxgw0000gn/T/pip-record-jcetesl/install-record.txt --single-version-externally-managed --compile --install-headers /Users/jintian/opt/anaconda3/include/python3.8/pyaudio Check the logs for full command output.

nshmyrev commented 2 years ago

src/portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found

sudo apt-get install -y portaudio19-dev

hyansuper commented 2 years ago

用pip安装吧,anaconda的安装包缺少requirements 文件

https://rcute-ai.readthedocs.io/zh_CN/latest/installation.html

或者你先分别安装requirements.txt文件里的各个依赖,哪个安装不上就取对应的官方文档看看如何安装或搜索相关问题。6-8行是声音相关的,portaudio的错误应该是安装这三个时发生的

todayjt commented 2 years ago

非常感谢你的帮助,按照你的指导已经解决了问题。最后发现是一个包用pip安装不上只能用其他的办法安装,安装后已经成功,接下来会慢慢研究。但还有一个问题需要您的帮助。我用家里的win10电脑,链接rcute链接不上,出现这个错误。

r.connect() Traceback (most recent call last): File "", line 1, in File "C:\Users\Today\AppData\Roaming\Python\Python38\site-packages\rcute_cozmars\robot.py", line 342, in connect asyncio.run_coroutine_threadsafe(AioRobot.connect(self), self._lo).result() File "C:\Program Files\Python38\lib\concurrent\futures_base.py", line 439, in result return self.get_result() File "C:\Program Files\Python38\lib\concurrent\futures_base.py", line 388, in get_result raise self._exception File "C:\Users\Today\AppData\Roaming\Python\Python38\site-packages\rcute_cozmars\robot.py", line 140, in connect self._ws = await websockets.connect(f'ws://{self._host}/rpc') File "C:\Users\Today\AppData\Roaming\Python\Python38\site-packages\websockets\legacy\client.py", line 650, in await_impl_timeout return await asyncio.wait_for(self.__await_impl__(), self.open_timeout) File "C:\Program Files\Python38\lib\asyncio\tasks.py", line 501, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError

hyansuper commented 2 years ago

Web界面能访问吗?如果可以connect('填入cozmars ip')试试。 如果不能是不是树莓派没连上Wi-Fi?

todayjt commented 2 years ago

可能是我家里的其他网络占用这个80端口冲突。 这两天在慢慢从基础研究这个机器人,很感兴趣。所以现在正单独了解每个库。 在了解adafruit-circuitpython-rgb-display这个库的时候遇到个问题。

这是我自己些的一段,想通过树莓派独立控制屏幕的代码;

import time import digitalio from adafruit_rgb_display import color565 from adafruit_rgb_display.st7789 import ST7789 """以下这段代码控制着 屏幕灯的背光""" import busio
from board import SCL, SDA, SCK, MOSI, MISO, CE0 from adafruit_pca9685 import PCA9685

"""以下是显示器背光控制""" i2c_bus = busio.I2C(SCL, SDA) # 创建i2c接口 pca = PCA9685(i2c_bus) # 创建create一个simple 的PCA9685类实例。 pca.channels[5].duty_cycle = 0xffff # 定义pca的通道 设置变量

"""显示器的引脚配置。这个引脚不是GPIO的也没定义,不知怎么写""" CS_PIN = CE0 DC_PIN = ????? DC_PIN = ????? BAUDRATE = 24000000

这里的引脚定义,DC_PIN = DC_PIN = 应该怎么填?因为我是初学,还不会.conf导入。而且我看你写的就是cs:8 dc:6 rst:5; 对照adafruit的,他没写关于 board的树莓派引脚定义,想请教下您;

hyansuper commented 2 years ago

https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/blob/main/examples/rgb_display_simpletest.py https://learn.adafruit.com/adafruit-mini-tft-0-dot-96-inch-180x60-breakout/python-wiring-and-setup