Can't import Pypot packages (I am a beginner)

Hello every one,

I installed on my MAC the pypot package sucesfully thanks to “PIP” line command.

I am now trying to test the installation using the command:
** python -c “import pypot”*

The console returns an error , it doesnt know “pypot”.

I also tried to do the same via my PYCHARM IDE … but in PyCharm, I can’t see the PyPot package in the browser. Note that my Pypot lib is installed in /user/local/python2.7/site-packages but python interpreter is launched from /Library/Frameworkds/python

Well, I am a bit lost. I think I may need to change my setup in the IDE and in my PATH on my mac?

Can you help a beginner like me :slight_smile:
regards.

From what you described, it seems that you have installed pypot using a custom Python (maybe the one from PyCharm?) and tried to run it with the system python. As they both define their custom PYTHONPATH, modules installed with one can not be seen by the other.

So basically you have to make sure that when running pip it uses the same Python as the one you will use for running pypot.

I would personally recommend using pyenv which allows you to easily switch from one Python to the other (e.g. from the system one to a custom one). (For the Mac users it integrates well with the brewed python).

A simple workaround would be to modify your PYTHONPATH to also point to /user/local/python2.7/site-packages. Yet, this is probably a bad idea as all compiled modules won’t work.

Oki :slight_smile: I will follow your advice and give you news depending on my progress.

So in the end, I unstalled PYTHON (BREW UNINSTALL PYTHON) then I BREW INSTALL PYTHON…
Everrything is working fine now, python is finding the pypot lib !!
:slight_smile:

I think the issue was that I have several differnt Python version and the brew software was linking to the wrong folders.

and yes you are right: PYCHARM uses another PATH !!

I stopped using PYCHARM … I will use my GEDIT like always (I program code for the sonic potion drum macine in C http://www.sonic-potions.com/ )

Hi @ribas and @Pierre !
How do you properly uninstall Pypot to properly reinstall it, I want to try with pyenv. I tried first the v-rep branch version of Pypot but I when I check my install with from pypot import vrep or when I try to execute herborist on Terminal I end with this error message :

  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python2.7/dist-packages/pypot-1.7.0-py2.7.egg/pypot/vrep/remoteApiBindings/lib/linux/64Bit/remoteApi.so: cannot open shared object file: Not a directory

Indeed there’s no such a directory… but no error message calling pypot.
Is there other straightforward solutions to uninstall than write a record text file when I run the setup.py in order to erase the created one listed in ? Thanks a lot !

It depends on how you installed it in the first place. You can try:

pip uninstall pypot

But this will work only if you install it with pip or easy_install.

Otherwise from a python console you can do:

import pypot
print pypot.__file__

to locate where pypot is installed and which folder you should remove.

Thank you for the tips ! It works for the moment, after having installed it uninstalled every possible ways and ended up installing with pip (downloads a tar.gz). I will do such clean up next time I encounter problems.

This topic was automatically closed after 24 hours. New replies are no longer allowed.