myo-python icon indicating copy to clipboard operation
myo-python copied to clipboard

live EMG

Open 250955967 opened this issue 4 years ago • 2 comments

Hi Niklas, I am a novice in Myo-python. Recently when I run the live_EMG.ipynb, this error came to me.


AttributeError Traceback (most recent call last) in 1 if name == 'main': ----> 2 main()

in main() 83 hub = myo.Hub() 84 listener = EmgCollector(512) ---> 85 with hub.run_in_background(listener.on_event): 86 Plot(listener).main()

AttributeError: 'Hub' object has no attribute 'run_in_background'

Would you please tell me how to solve this problem?

Thank you so much! Deng

250955967 avatar Dec 30 '20 08:12 250955967

Hello @250955967 , do you have the latest version of the library installed?

Try pip install --upgrade myo-python, or inspect the version number using python -c 'import myo; print(myo.__version__)'

NiklasRosenstein avatar Dec 30 '20 20:12 NiklasRosenstein

Hello Niklas,

Yes, I did not have the latest version. I have updated the version via your method. It works. However, it cannot load the library now. In the previous version, it can load the library.


OSError Traceback (most recent call last) in 1 if name == 'main': ----> 2 main()

in main() 80 def main(): 81 #myo.init() ---> 82 myo.init(r'D:\project\EMG\Myo\myo-sdk-win-0.9.0\bin') 83 hub = myo.Hub() 84 listener = EmgCollector(512)

~\anaconda3\lib\site-packages\myo_ffi.py in init(lib_name, bin_path, sdk_path) 236 237 global libmyo --> 238 libmyo = ffi.dlopen(lib_name) 239 240

~\anaconda3\lib\site-packages\cffi\api.py in dlopen(self, name, flags) 148 "or an already-opened 'void *' handle") 149 with self._lock: --> 150 lib, function_cache = _make_ffi_library(self, name, flags) 151 self._function_caches.append(function_cache) 152 self._libraries.append(lib)

~\anaconda3\lib\site-packages\cffi\api.py in _make_ffi_library(ffi, libname, flags) 830 def _make_ffi_library(ffi, libname, flags): 831 backend = ffi._backend --> 832 backendlib = _load_backend_lib(backend, libname, flags) 833 # 834 def accessor_function(name):

~\anaconda3\lib\site-packages\cffi\api.py in _load_backend_lib(backend, name, flags) 825 if first_error is not None: 826 msg = "%s. Additionally, %s" % (first_error, msg) --> 827 raise OSError(msg) 828 return backend.load_library(path, flags) 829

OSError: cannot load library 'D:\project\EMG\Myo\myo-sdk-win-0.9.0\bin': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'D:\project\EMG\Myo\myo-sdk-win-0.9.0\bin'

Thank you!

250955967 avatar Dec 31 '20 06:12 250955967