ilabsweden / pepperchat

A dialog system for the Aldebaran robots Pepper and Nao, based on ChatGPT.
MIT License
16 stars 6 forks source link

module_speechrecognition.py fails with ImportError #2

Open andanders opened 4 months ago

andanders commented 4 months ago

We are getting an error when running python module_speechrecognition.py --pip pepper.local on macOS.

I guess the problem is related to the dir /Library/Frameworks/Python.framework/Versions/2.7/Python, which does not exist. This is not the default path for python27, and there are no README instructions to create it.

ImportError: dlopen(/Users/birkthisted/Downloads/pynaoqi-python2.7-2.5.5.5-mac64/lib/python2.7/site-packages/_qi.so, 0x0002):
Library not loaded: /Library/Frameworks/Python.framework/Versions/2.7/Python

Referenced from: <D7C0A19A-7789-337C-98C1-7A2FB1E0E007> /Users/birkthisted/Downloads/pynaoqi-python2.7-2.5.5.5-mac64/lib/python2.7/site-packages/_qi.so

Reason: tried: '/Library/Frameworks/Python.framework/Versions/2.7/Python' (cannot link against a main executable '/Library/Frameworks/Python.framework/Versions/2.7/Python'), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/2.7/Python' (cannot link against a main executable '/Library/Frameworks/Python.framework/Versions/2.7/Python'), '/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file, not in dyld cache), '/python2.7' (no such file), '/Users/birkthisted/Downloads/pynaoqi-python2.7-2.5.5.5-mac64/lib/python2.7' (not a file), '/opt/anaconda3/envs/py27/bin/python2.7' (cannot link against a main executable '/opt/anaconda3/envs/py27/bin/python2.7'), '/System/Volumes/Preboot/Cryptexes/OS/opt/anaconda3/envs/py27/bin/python2.7' (no such file), '/opt/anaconda3/envs/py27/bin/python2.7' (cannot link against a main executable '/opt/anaconda3/envs/py27/bin/python2.7'), '/usr/local/lib/python2.7' (no such file), '/usr/lib/python2.7' (no such file, not in dyld cache)
erikbilling commented 1 month ago

This sounds like a clear import error for pynaoqi. Are you setting the path to NaoQi in the PYTHONPATH environment variable? Note that pynaoqi does of course has to run ni Python 2.7.

You should by able to test this by simply opening python 2.7 and do "import naoqi". If that works, your library at least imports correctly. It's a good pre-step before running the module itself.

BirkHintzeThisted commented 2 weeks ago

I got past this by swapping to Windows, which moved the ball:

File "C:\Users\user\pepperchat-master\pepperchat-master\pepperspeechrecognition\speechrecognition.py", line 22, in import numpy as np File "c:\Python27\lib\site-packages\numpy__init.py", line 142, in from . import core File "c:\Python27\lib\site-packages\numpy\core\init.py", line 23, in WinDLL(os.path.abspath(filename)) File "c:\Python27\lib\ctypes\init.py", line 366, in init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 193] %1 er ikke et gyldigt Win32-program

Any chance you could tell me exactly what version of numPy I should run?

BirkHintzeThisted commented 2 weeks ago

The answer was: numpy-1.16.6-cp27-cp27m-win32.whl

https://pypi.org/project/numpy/1.16.6/#files