Anaconda and Poppy Creatures

Dear all,
I am using the anaconda tool on my machine (Macintosh.)
When I try to do : from poppy.creatures import PoppyHumanoid

I got an error telling me that Poppy is not known :frowning:
I got the same error is I use normal Python scripts:

[0 sribas@sribas ~]% /usr/bin/python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

from poppy.creatures import PoppyHumanoid
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named poppy.creatures

I guess this error is known and I should just look at some documents :slight_smile: Can you point me to the right ones ?
sorry !!!
:slightly_smiling:

Did you try to check if poppy-creature is ok ?:
pip install poppy-creature

If it doesn’t work, can you paste here the result of :
pip search "poppy"

Yeap, thanks. You are right.

In fact, it used to work fine until I installed ANACONDA env. for a personal training :frowning:
since then I have an python 3.5 installed, and nothing under sites-packages.

I think I should either install everything back on ANACONDA or remove anaconda…

I keep you inform !

Here the results of the commmand “pip seach…”

[0 sribas@sribas ~/Documents/workspace/pypot]% pip search "poppy"
poppy-creature - Abstract Poppy Creature Software Library INSTALLED: 1.7.2 (latest)
poppy - Physical optics propagation (wavefront diffraction) for optical simulations particularly of telescopes.
poppy-ergo-jr - Poppy Ergo Jr Software Library
poppy-torso - Poppy Torso Software Library
poppy_inverse_kinematics - An inverse kinematics library aiming
performance and modularity
poppy-ergo - Poppy Ergo Software Library
poppy-4dof-arm-mini - Poppy 4 dof arm mini Software Library
poppy-humanoid - Poppy Humanoid Software Library

[0 sribas@sribas ~/Documents/workspace/pypot]% pip search "pypot"
pypotrace - potrace Python bindings
pypot - Python Library for Robot Control
INSTALLED: 2.10.1
LATEST: 2.11.0rc1

I tried to install pypot under the anaconda environment. I know that Anaconda is python 3.5 … but I tried anyway. I got now the following error :

[0 sribas@sribas ~/Documents/workspace/pypot]% python
Python 3.5.0 |Anaconda 2.4.0 (x86_64)| (default, Oct 20 2015, 14:39:26)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

from poppy.creatures import PoppyHumanoid
Traceback (most recent call last):
File “”, line 1, in
File “//anaconda/lib/python3.5/site-packages/poppy/creatures/init.py”, line 4, in
from .abstractcreature import AbstractPoppyCreature
File “//anaconda/lib/python3.5/site-packages/poppy/creatures/abstractcreature.py”, line 7, in
from pypot.robot import Robot, from_json, use_dummy_robot
File “/Users/sribas/Documents/workspace/pypot/pypot/robot/init.py”, line 1, in
from .robot import Robot
File “/Users/sribas/Documents/workspace/pypot/pypot/robot/robot.py”, line 5, in
from …dynamixel.controller import BaseDxlController
File “/Users/sribas/Documents/workspace/pypot/pypot/dynamixel/init.py”, line 4, in
from .io import DxlIO, DxlError
File “/Users/sribas/Documents/workspace/pypot/pypot/dynamixel/io.py”, line 34, in
class DxlIO(object):
File “/Users/sribas/Documents/workspace/pypot/pypot/dynamixel/io.py”, line 219, in DxlIO
def scan(self, ids=xrange(254)):
NameError: name ‘xrange’ is not defined

Either I remove Anaconda to go back to my normal python installation, either I try to correct the error… hum…

Add-on: I have removed the anaconda environment everything is borken now :wink: I can’t launch my python console anymore :wink: of course, it’s normal, I should change my bash script. Anyhow, I found that I could install anaconda with python 2.7 inside… hey hey ! I am trying right now. I keep you inform.

The error is here
[0 sribas@sribas ~/Documents/workspace/pypot]% python
You didn’t install pypot, you just tried to execute it from its folder. pypot use the module 2to3 to adapt the code for python3. If you don’t install it with the setup.py (python setup.py install) it won’t works in python 3.

"[0 sribas@sribas ~/Documents/workspace/pypot]%"
arrf, this line should not have been copied into the post. This folder was for me to test some github / sourcetree application :frowning:

I did the "python setup… " but my issue is that I broke my link to python 2.7 (I have 3.5 also).

Anyhow, I am going to reinstall everything as very well mentionned in the doc of pypot (not joking ! ) I am following the doc ! :slightly_smiling:I keep you inform (between some Mario Galaxy parties with my wife !).

I’m not sure you have well understood. Run pyton from outside the pypot directory an it will work.

So I followed your advice :slightly_smiling: it works but let me explain what I did :

  • I installed Anaconda for Python 2.7
  • I installed then ‘pypot’ using “pip install pypot poppy”.
  • I installed also ‘pip install poppy-creature’

I executed python console outside the pypot folder , in a terminal. I can now load the poppy robot in VREP, etc… exactly like before :slightly_smiling:

Big Thanks !
It’s really a pleasure to post my issue and see that I can count on the community. big thanks !!!

I have now an issue with my ipython notebook :frowning: some errors… grrrr…:

from pypot.vrep import from_vrep
from poppy.creatures import PoppyErgo

ImportError Traceback (most recent call last)
in ()
1 from pypot.vrep import from_vrep
----> 2 from poppy.creatures import PoppyErgo

ImportError: cannot import name PoppyErgo


it’s strange as if I replace PoppyErgo by PoppyHumanoid evrything is working fine and uploaded in VREP :slightly_smiling:

The error message ‘xrange’ is not defined would seem to indicate that you are trying to run a Python 2 codebase with Python 3 . In Python 2, an iterable object is often created with xrange() method , usually in a “for loop”, which behaves very similarly to a generator. In Python 3, range() method is implemented the same as the xrange() method , so there is no dedicated xrange(). So, if you use xrange() in Python 3, it will generate NameError:name ‘xrange’ is not defined error.