Comments (19)
To me this sounds more like a bug in Myo Connect, but of course it could be possible that I did something wrong with the bindings. For now, maybe you can try to work around this problem and create only one single Hub object for your application. If you want to pause the Hub, it should be possible to run it again after it stopped (returning False from a Listener or calling Hub.stop()
).
from myo-python.
Well, I tried the restarting some time ago (when it was still the bindings modified by Juharris), and I didn't get it to work successfully back then. Is there a specific restart method? Or do you just have to mess with the attributes/fields? Like Hub.running?
from myo-python.
Hi,
I have a problem with connecting. I dont see the myo.py module in this data
This is my first time with python so maybe it is an obvious mistake, and I would be very grateful if you could help me and explain how to connect to myo. Did I miss a step or something. I am in a good directory but it keeps saying that there is no module named myo. :/
from myo-python.
Hi Anelica,
If I had to guess, you probably missed the "pip install -e myo-python" step which adds the library to your Python path variable.
from myo-python.
I am doing it on mac OSX. Do I just type that in python console? Because it says invalid syntax
Very sorry to bother you with this stupid questions but I am just a beginner.
I have managed to install it but the same message shows again. Shouldnt there be a file named myp.py and that would be the modul I a m looking for? Or I am missing the point.
from myo-python.
I could be wrong, but you probably just need to add the myo sdk and the bindings to your path. There's some installation information on this Github:
$ git clone [email protected]:NiklasRosenstein/myo-python
$ virtualenv env --no-site-packages
$ source env/bin/activate
$ pip install -e myo-python
$ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(pwd)/myo-sdk-mac-0.8.1/myo.framework
$ python3 myo-python/examples/hello_myo.py
I don't really now OSX, but I figure this should be done in your Mac Console, not in your Python IDE.
If you don't have pip (I don't know if all Python versions automatically include it), you should install it.
Maybe this can help for that: http://stackoverflow.com/questions/17271319/installing-pip-on-mac-os-x
from myo-python.
You helped me a lot! thank you!
I hade to update software to be able to install this so it took me whole day.
And now when I tought I have it, another problem occured. :(
Seems like something is wrong with hub
when i type hub=libmyo.Hub() i get this:
Traceback (most recent call last):
File "", line 1, in
File "/Users/ANELA/Documents/modules/myo-python-master/myo/init.py", line 74, in init
self._hub = _myo.Hub()
File "/Users/ANELA/Documents/modules/myo-python-master/myo/lowlevel/ctyping.py", line 250, in init
lib.init_hub(byref(self), byref(error))
File "/Users/ANELA/Documents/modules/myo-python-master/myo/lowlevel/ctyping.py", line 59, in getattr
raise AttributeError(name)
AttributeError: init_hub
Do you maybe know what is the problem?
from myo-python.
@anelica Have you called libmyo.init()
before creating a Hub object?
from myo-python.
@NiklasRosenstein Yes! This is what I get
libmyo.init()
Traceback (most recent call last):
File "", line 1, in
File "/Users/ANELA/Documents/modules/myo-python-master/myo/lowlevel/ctyping.py", line 126, in init
self._lib = ctypes.cdll.LoadLibrary(lib_name)
File "/Users/ANELA/anaconda/lib/python2.7/ctypes/init.py", line 443, in LoadLibrary
return self._dlltype(name)
File "/Users/ANELA/anaconda/lib/python2.7/ctypes/init.py", line 365, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(myo, 6): no suitable image found. Did find:
myo: not a file
from myo-python.
Apparently you haven't set up the environment variables correctly. Did you add to DYLD_LIBRARY_PATH
the path to the myo.framework
folder inside the Myo SDK you downloaded? Please check the instructions again. You might need to adjust the path when the Myo SDK is not in the same directory as your current working directory (the example uses $(pwd)
to get the full path to the current working directory and reference the Myo SDK from there).
PS: Please create a new issue next time, you basically hijacked this thread ;-)
from myo-python.
Well, I tried the restarting some time ago (when it was still the bindings modified by Juharris), and I didn't get it to work successfully back then. Is there a specific restart method? Or do you just have to mess with the attributes/fields? Like Hub.running?
To be honest, I haven't really tried to restart the Hub yet. Hub.running
should be a read-only field so that shouldn't be the solution. I'll have to investigate if a simple Hub.stop(True)
and Hub.run(1000, listener)
doesn't do it.
from myo-python.
@NiklasRosenstein well I think I have!
It is in my documents under folder modules where the sdk folder is so I typed this
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/ANELA/Documents/modules/sdk/myo.framework
Is that ok?
I am so sorry, it is my first time on GitHub :D
from myo-python.
@NiklasRosenstein Now i have put the sdk folder into the myo-python-master folder so that they are in the same and added the path but it is still not working.
Could you just tell me if i am doing good.
1.downloaded myo-python-master
2.installed via terminal with pip install
3.downloaded myo sdk
4.sdk folder is in myo-python-master folder
5.than I export it:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/ANELA/Documents/modules/myo-python-master/sdk/myo.framework
or with the pwd
6.i launch spyder (python 2.7)
7. i type: import myo as libmyo
libmyo.init()
Is that it? Because I still get the same mistake over and over. I am sure that I am missing the obvious point here :S
from myo-python.
@anelica Looks OK to me right now. I'll check this out on my mac asap.
from myo-python.
@anelica Do you launch spyder from the terminal?
from myo-python.
@NiklasRosenstein no I launch it via launcher.app
from myo-python.
@anelica The DYLD_LIBRARY_PATH
you set up won't be visible to Spyder then. It's only inherited by the processes you start from the terminal. Not sure if it will work if you start it with open -a Spyder
.
from myo-python.
@maartendruwe Were you able to work around this for the moment? I didn't find the time to look into this yet, sorry.
from myo-python.
When I take the hello_myo.py
example and change it to
hub.set_locking_policy(libmyo.LockingPolicy.none)
hub.run(1000, Listener())
while True:
time.sleep(1.0)
hub.shutdown()
print("\nRestarting hub...")
hub.run(1000, Listener())
I get
Connecting to Myo ... Use CTRL^C to exit.
[0.9288330078125][-0.0797119140625][-0.14874267578125][-0.329833984375][<Pose: rest>][ ][ ][-54]54]
Restarting hub...
Traceback (most recent call last):
File "myo-python\examples\hello_myo.py", line 161, in <module>
main()
File "myo-python\examples\hello_myo.py", line 144, in main
hub.shutdown()
File "c:\users\niklas\repos\niklasrosenstein\myo-python\myo-python\myo\__init__.py", line 283, in shutdown
self._hub.shutdown()
File "c:\users\niklas\repos\niklasrosenstein\myo-python\myo-python\myo\lowlevel\ctyping.py", line 328, in shutdown
self._notnull()
File "c:\users\niklas\repos\niklasrosenstein\myo-python\myo-python\myo\lowlevel\ctyping.py", line 168, in _notnull
raise RuntimeError(message)
RuntimeError: Hub object is nullptr
But not the behaviour @maartendruwe described. Looking into myo.lowlevel.ctyping.Hub.shutdown()
, we can find
def shutdown(self):
"""
Shuts the Hub down if it is running. The object is not usable
after calling this function.
"""
self._notnull()
error = ErrorDetails()
result = lib.shutdown_hub(self, byref(error))
self.value = None
error.raise_on_error()
return result
If I remember correctly, it was documented in the Myo SDK that you can not re-use the hub once you shut it down (it's being deallocated). Creating a new lowlevel Hub
object after the old has been shut down will fix this.
from myo-python.
Related Issues (20)
- Error in on_pose() when myo is unsynced HOT 2
- UTC timestamps for myo data? HOT 1
- ResultError: (<Result.error_runtime: 3>, b'Unable to connect to Myo Connect. Is Myo Connect running?') HOT 1
- OSError: [Errno 0] Error: 'myo\\libmyo.h'
- Myo SDK Download HOT 1
- Running in macOS: did not manage to locate a library called 'myo' HOT 1
- How to use the vibration method? HOT 1
- Get Myo data in the time HOT 3
- error 0x7e. cannot load library HOT 6
- 'Hub' object has no attribute 'shutdown' HOT 1
- SDK HOT 1
- myo sdk HOT 1
- Do You Have An Archive of The Windows 10 SDK? HOT 1
- live EMG HOT 2
- 03_live_EMG HOT 9
- AttributeError: module 'time' has no attribute 'clock' in myo/utils.py HOT 1
- What unit is the data in? millivolts or volts? HOT 4
- unable to download the Myo-SDK HOT 1
- Error loading library HOT 1
- Data streaming keeps buffering at around 15 seconds
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from myo-python.