Git Product home page Git Product logo

Comments (9)

NiklasRosenstein avatar NiklasRosenstein commented on July 17, 2024

Hi Lycos2,

I can not reproduce it here. Could you help me debug this please?

In the _ffi.py file, please modify the Hub.locking_policy setter function starting at line 488 so that it reads

  @locking_policy.setter
  def locking_policy(self, policy):
    print('@@@', repr(policy), type(policy), type(policy).__module__, LockingPolicy.__module__, type(policy) is LockingPolicy)
    if not isinstance(policy, LockingPolicy):
      raise TypeError('expected LockingPolicy')
    error = ErrorDetails()
    libmyo.libmyo_set_locking_policy(self._handle[0], int(policy), error.handle)
    error.raise_for_kind()

After that, run your Python script again and please paste the output in the console.

Please put any terminal output in code blocks like so:

```
Code here
```

from myo-python.

Lycos2 avatar Lycos2 commented on July 17, 2024

Hi Niklas,
thx for helping me, i did what you told me and this is the output:

runfile('C:/Users/ELYES/Desktop/myo_test/myo-python-master/01_hello_myo.py', wdir='C:/Users/ELYES/Desktop/myo_test/myo-python-master')
Traceback (most recent call last):

  File "<ipython-input-1-8c68dda46196>", line 1, in <module>
    runfile('C:/Users/ELYES/Desktop/myo_test/myo-python-master/01_hello_myo.py', wdir='C:/Users/ELYES/Desktop/myo_test/myo-python-master')

  File "C:\Users\ELYES\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 706, in runfile
    execfile(filename, namespace)

  File "C:\Users\ELYES\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 103, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/ELYES/Desktop/myo_test/myo-python-master/01_hello_myo.py", line 48, in <module>
    hub = myo.Hub()

  File "C:\Users\ELYES\Desktop\myo_test\myo-python-master\myo\_ffi.py", line 469, in __init__
    self.locking_policy = LockingPolicy.none

  File "C:\Users\ELYES\Desktop\myo_test\myo-python-master\myo\_ffi.py", line 490, in locking_policy
    print('@@@', repr(policy), type(policy), type(policy.__module__), LockingPolicy.__module__, type(policy) is LockingPolicy)

AttributeError: 'int' object has no attribute '__module__'

from myo-python.

NiklasRosenstein avatar NiklasRosenstein commented on July 17, 2024

Hm that is weird. Something seems to be wrong with the enumeration types. Can you tell me the exact version of Python you are using and the version of the nr library that is installed?

python --version
python -c "import nr; print(nr.__version__)"

from myo-python.

Lycos2 avatar Lycos2 commented on July 17, 2024

(base) C:\Users\ELYES>python --version
Python 3.6.5 :: Anaconda, Inc.

(base) C:\Users\ELYES>python -c "import nr; print(nr.version)"
1.3.5

from myo-python.

NiklasRosenstein avatar NiklasRosenstein commented on July 17, 2024

How did you install myo-python?

We require nr>=2.0.10 which should have been upgraded automatically when you installed it via Pip. 😕

pip install 'nr>=2.0.10'

should fix your problem.

from myo-python.

Lycos2 avatar Lycos2 commented on July 17, 2024

hi Niklas,
I updated nr to 'nr>=2.0.12' and i got that :
"""""
runfile('C:/Users/ELYES/Anaconda3/my_project/myo-python-master (1)/myo-python-master/01_hello_myo.py', wdir='C:/Users/ELYES/Anaconda3/my_project/myo-python-master (1)/myo-python-master')
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/ELYES/Anaconda3/my_project/myo-python-master (1)/myo-python-master/01_hello_myo.py', wdir='C:/Users/ELYES/Anaconda3/my_project/myo-python-master (1)/myo-python-master')

File "C:\Users\ELYES\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 706, in runfile
execfile(filename, namespace)

File "C:\Users\ELYES\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 103, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/ELYES/Anaconda3/my_project/myo-python-master (1)/myo-python-master/01_hello_myo.py", line 28, in
import myo

File "C:\Users\ELYES\Anaconda3\my_project\myo-python-master (1)\myo-python-master\myo_init_.py", line 26, in
from ._ffi import *

File "C:\Users\ELYES\Anaconda3\my_project\myo-python-master (1)\myo-python-master\myo_ffi.py", line 72, in
class Result(nr.enum.Enumeration):

AttributeError: module 'nr' has no attribute 'enum'
""""""

from myo-python.

NiklasRosenstein avatar NiklasRosenstein commented on July 17, 2024

Uhm and what happens if you type import nr.enum in your Python interpreter?

from myo-python.

Lycos2 avatar Lycos2 commented on July 17, 2024

I did that and it seems ok!!
""""""

(base) C:\Users\ELYES>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import nr.enum

"""""

from myo-python.

NiklasRosenstein avatar NiklasRosenstein commented on July 17, 2024

Could you come over to https://gitter.im/NiklasRosenstein/myo-python? I have some more questions regarding your environment.

from myo-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.