Setup hebi robot on python - python

I have a question about runtime error.
#!/usr/bin/env python3
import hebi
from time import sleep
lookup = hebi.Lookup()
At lookup = hebi.Lookup(), the error below happened.
Traceback (most recent call last):
File "hello.py", line 1, in <module>
import hebi
.....
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\hebi\_internal\raw.py", line 394,
in _init_hebi_library
raise RuntimeError('HEBI Core library not found')
RuntimeError: HEBI Core library not found
I'm not sure why HEBI Core is not there. How and where do I install some tools for solving this problem?

Sorry about the issues that you are having.
I maintain the Python API at HEBI, and I am aware of this issue (although I just saw this issue now).
A solution to this is coming soon, but for the time being, please download and install the 64 bit version of Python 3 from Python's website ( https://www.python.org/downloads/windows/ ) or see the temporary workaround below. Please also note that the 64 bit version is the x86-64 version - NOT x86.
If you require the 32 bit Python (or just do not want to install the 64 bit version for whatever reason), you can replace the file at
C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\hebi\lib\win_x64\hebi.dll
with the file at
C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\hebi\lib\win_x86\hebi.dll
However, realize that you will not be able to run the API with a 64 bit Python executable this way.
If you are at all curious what is happening here, the (currently) faulty logic is attempting to load hebi.dll but fails to since it tries to load the x86-64 version and not the 32 bit (x86) version.

Related

exe generated from a python script with Py2exe does not work on xp

I have a python script that works fine on my computer (Python 2.7 32 bit installed). It has the following imports :
import mechanize
from bs4 import BeautifulSoup
from Tkinter import *
import json
import webbrowser
I wanted to distribute this to others so I found that we can create exe files using py2exe. I wrote a script like this:
from distutils.core import setup
import py2exe
setup(console=['notification.py'],
options = {'py2exe' : {
'packages' : ['bs4', 'mechanize','Tkinter', 'json', 'webbrowser']
}})
This works fine on my computer but when I run it on Windows XP, I get this error -
Traceback (most recent call last):
File "notification.py", line 3, in
File "Tkinter.pyc", line 38, in
File "FixTk.pyc", line 65, in
File "_tkinter.pyc", line 12, in
File "_tkinter.pyc", line 10, in __load
ImportError: DLL load failed: %1 is not a valid Win32 application.
I tried searching other threads but found none that has the same problem. So please help me fix this issue.
Maybe Tinkiter is a 64 bit version GUI, while Windows XP version you run it is 32bit.
Check it out and tell us if that's the case.
Reason I assume this is the line:
ImportError: DLL load failed: %1 is not a valid Win32 application.
combined with the fact that Tinkiter is 64 bit.
Python can be 32 bit. Works on both Operating Systems, 32 and 64 bit ones.
But Tinkiter is a GUI, something different than the language.
So Including a 64bit add-on, into a 32bit application... can cause some trouble. :)
Suggestion:
You can start by making the app work in console interface if possible.
Then you can use another GUI that can run in 32 bit.
For instance, you can get a 32bit version of THIS
Edit: Added a suggeston.
Well, I had installed both versions of Python 32 bit and 64 bit in my machine. When I was making it a stand alone probably some dlls were copied from the wrong library. So I completely uninstalled both versions and then installed 32 bit and it worked fine.

Problems using Metakit for Python on Windows

I'm having problems trying to use Metakit for Python on Windows. It always report this error:
Traceback (most recent call last):
File "<pyshell#86>", line 1, in <module>
import metakit
File "C:\Python27\lib\site-packages\metakit.py", line 22, in <module>
from Mk4py import *
ImportError: No module named Mk4py
I've already:
Downloaded metakit.py and Mk4py.dll from http://equi4.com/pub/mk/ (official release)
Copied metatkit.py to C:\Python27\lib\site-packages\
Copied Mk4py.dll to C:\Python27\DLLs\
I have installed Python 2.7.5 win32 version
Any idea to solve this problem?
I also had the same problem and couldn't get the system to work with the provided dlls. I also tried compiling metakit from source to make it work and installing it from an the official source via egg, which failed in the same way (as it compiles from source).
Using my older windows XP machine with visual studio 2002 I managed to build it from source and install it with just a minor change of the setup script (changing every instance of msvc60 to msvc70 in the setup script). However, copying those files to my windows 8 machine still failed, and even copying what appeared to be the changes were unsuccessful.
In the end I copied my entire python directory from the xp machine to the windows 8 machine and now it is working without issues.
Obviously i could provide my dlls but I doubt they would be any more successful than the provided ones.
My next step is to reduce my reliance on having to use metakit as it seems very poorly supported.

Beginner, Error in python regarding site-packages/celltool/numerics/fitpack/_fitpack.so

I'm doing some image analysis for my research, and it involves using CellTool (http://pantheon.yale.edu/~zp2/Celltool/), Python, and numpy. I'm on a OS X 10.8.3. On my old laptop that crashed, I was able to run my commands fine, but I got a new one and things are not going as smoothly!
I believe I have CellTool and numpy installed correctly, and I'm just using Python 2.7.2 that's standard on Mac. But when I try to run this python script "calculate_distances.py" command, I get this error:
Yuxins-MacBook-Pro:Modified_Contours yuxinsun$ python calculate_distances.py
Traceback (most recent call last):
File "calculate_distances.py", line 24, in <module>
normals = contours[n-1].inward_normals()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/contour/contour_class.py", line 384, in inward_normals
import celltool.numerics.fitpack as fitpack
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/numerics/fitpack/__init__.py", line 1, in <module>
from fitpack import *
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/numerics/fitpack/fitpack.py", line 34, in <module>
import _fitpack
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/numerics/fitpack/_fitpack.so, 2): Library not loaded: /usr/local/lib/libgfortran.2.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/numerics/fitpack/_fitpack.so
Reason: image not found
And I have no idea what any of it means...I only need to run this python script and get the file that it spits out.
Am I just missing the "fitpack" whatever that is? If so, how do I install it? Or what can I do to fix this problem.
You need to make sure you have those installed per installation requirements:
If one of the above binary installers did not suit your needs,
please install Celltool from the source code.
This depends on only three things:
1.Python (version 2.3 or later).
2. NumPy 1.0.4 or later.
3. Working C/C++ and Fortran compilers.
and it looks like your Fortran compiler libs are not installed.
This might be helpful: https://scicomp.stackexchange.com/questions/2469/how-should-i-install-a-fortran-compiler-on-a-mac-os-x-10-x-x-4

maya2008 win32api 64 bit python

How is it possible to run import win32api successfully on a 64bit maya version 2008?
The following error occurs:
Error: No module named win32api
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named win32api
I need to get mouse cursor position in python so that I can place window exactly in that position. Is there any other way to get it?
Best regards,
kNish
Maya uses its own Python installation. You need to add the path where pywin32 is installed by one way or another ... you can create a .pth file in
C:\Program
Files\Autodesk\Maya2009\Python\Lib\site-packages\
Also, like Adam pointed out, make sure you have the 64 bit pywin32 installed.
Here's an article talking about this subject:
http://www.rtrowbridge.com/blog/2008/11/27/maya-python-import-scripts/
Edit:
Yeah indeed I think they don't provide PyWin32 for Python25 x64:
Available for AMD64 versions of
Windows for Python 2.6 and later
(support for Python 2.5 is just too
hard, sorry). Lots of help from
Roger, Steve Yin and Sidnei da
Silva.
http://sourceforge.net/project/shownotes.php?release_id=603349

import serial error occured in Python

I wrote
import serial
There message are occured.
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/serial/__init__.py", line 20, in ?
from serialposix import *
File "/usr/lib/python2.4/site-packages/serial/serialposix.py", line 13, in ?
import sys, os, fcntl, termios, struct, select, errno
ImportError: No module named termios
What's wrong?
termios has been in the Python standard library since 2.0 at least (I'm not very familiar with older Python versions), but it's always been a Unix-only module. Your 2.4 should be fine, IF you're running under any Unix flavor -- i.e., anything but Windows, more or less. The problem you're seeing suggests either a faulty Python install, or that you're on a non-Unix platform (and if it's not Windows I'm very curious to learn what it IS).
Edit: OP has clarified that they're on Debian -- which has a long history of removing some crucial pieces from upstream components and hiding them in hard-to-locate packages, a history that has long hurt their Python packaging in particular.
I tried several package search engines but I can't find out where they hid termios for Python in particular (for any version) so all I can suggest are workarounds (unless the debian tag I just added attracts debian experts who can help) as well of course as asking on debian-specific forums (clarifying exactly what versions are in use, of course).
Maybe installing another Python (a REAL Python, not the "cleverly packaged", i.e. mangled into pieces and with pieces missing, Debian travesty) might help -- for example, if both sticking with Python 2.4 and using .deb are important constraints to the OP, PYTHON2.4_2.4.6-1UBUNTU3_I386.DEB (not sure how cleanly it and its dependencies install on the OP's specific Debian version, of course); or else, one might as well go with a more recent and complete Python, see for example here (specifically for Debian Etch, but hopefully it can be adapted for the OP's exact version).

Categories