enable BUILD_PYTHON in CMake - python-3.x

I was trying to use Openpose from windows using https://github.com/CMU-Perceptual-Computing-Lab/openpose. But while I run a .py file it returned an error message
Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?
No module named 'pyopenpose'
An exception has occurred, use %tb to see the full traceback.
Traceback (most recent call last):
File "C:\Users\Santanu\Desktop\openpose\python\01_body_from_image.py", line 19, in <module>
raise e
File "C:\Users\Santanu\Desktop\openpose\python\01_body_from_image.py", line 16, in <module>
import pyopenpose as op
ModuleNotFoundError: No module named 'pyopenpose'
During handling of the above exception, another exception occurred:
SystemExit: -1
It has suggested from the error text to enable 'BUILD_PYTHON' in CMake and also said here. But I have never used CMake before. How to enable 'BUILD_PYTHON' in CMake?

Related

I was able to run ros by "roscore" . But now I am getting an error

I was able to run ros by "roscore" earlier. But now I am getting an error:
Traceback (most recent call last):
File "/usr/bin/roscore", line 36, in <module>
from rosmaster.master_api import NUM_WORKERS
ModuleNotFoundError: No module named 'rosmaster'
How to fix the issue?
This error is caused from not sourcing the setup file. Every time you open a new terminal make sure you run source /opt/ros/$ROS_DISTRO/setup.bash or make sure that command is added to your ~/.bashrc file

Build Error python library, version issue: cannot find my_package.version

I have setup.cfg, I am able to build when I specify specific version inside setup.cfg:
[metadata]
version = 0.0.1
But when I specify inside version as variable inside setup.cfg: I am getting build error: unable to find my_package
version = attr: my_package.VERSION
Error messages:
Traceback (most recent call last):
File "/tmp/build-env-_y8qqaje/lib/python3.10/site-packages/setuptools/config.py", line 419, in _parse_attr
return getattr(StaticModule(module_name), attr_name)
File "/tmp/build-env-_y8qqaje/lib/python3.10/site-packages/setuptools/config.py", line 27, in __init__
with open(spec.origin) as strm:
AttributeError: 'NoneType' object has no attribute 'origin'
During handling of the above exception, another exception occurred:
....
ModuleNotFoundError: No module named 'my_package'
Above is my project structure:
Any help would be helpful, this is my first time building a package

Installed script with tkinter module returns error

I tried to convert my tkinter.py script to the tkinter.exe file. I used PyInstaller and I am sure the command was right, so no questions about PyInstaller. When conversion had completed I tried to execute but get the error:
Traceback (most recent call last):
File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth__tkinter.py", line 25, in <module>
FileNotFoundError: Tcl data directory "C:\Users\sashk\AppData\Local\Temp\_MEI42002\tcl" not found.
This error is related to tkinter module exactly and I can't find any solutions on the Web, please help.
I've renamed to Demo.py and it's started to work.

ImportError: No module named darkflow.cli

I just want to do live object recognition from web-came using YOLO and while testing it, I am facing some issues. I am using Ubuntu os. Here is the error I get in terminal.
rajan#RGR:~/yolo setup/YOLO_Object_Detection-master$ ./flow --model cfg/yolo-new.cfg --load bin/yolo-new.weights --demo videofile.avi
Traceback (most recent call last):
File "./flow", line 4, in <module>
from darkflow.cli import cliHandler
ImportError: No module named darkflow.cli
Here is the link of the git repository which I am using as refenrece:
https://github.com/llSourcell/YOLO_Object_Detection

New error trying to compile pygame to exe

I have created a small game for my little boy using Python 3.4 and Pygame in Windows 7. It also works in Python 2.X, with some minor bugs.
Then I tried to create an .exe file using py2exe. I prepared a setup.py file copying the source I found at pygame2exe wiki (http://www.pygame.org/wiki/Pygame2exe?parent=CookBook) also trying to use the suggestions I found in other questions here and in python-forum. What I obtained was the following error:
C:\Python34>python setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in
origIsSystemDLL = py2exe.build_exe.isSystemDLL # save the orginal before we edit it
AttributeError: 'module' object has no attribute 'build_exe'
I have read all other posts on stackoverflow on pygame and exe but I haven’t found anything on this type of error on the web, is there anybody that can help me?
PS for those who prefer cx_freeze, I have tried it too, finding different problems and I will prepare soon another question on it
To give you more details, I am adding this new lines:
if I use the standard setup.py file instead, I have a dist directory with an .exe, but if I launch it I get an error window and in the log I find:
Traceback (most recent call last):
File "C:\Python34\lib\tokenize.py",
line 369, in find_cookie
line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte
During handling of the above exception, another exception occurred: etc....
And the first lines in the cmd are about 16 missing modules
if I try to use Python 2.6 instead of 3.4 I otain a Microsoft Visual C++ runtime error with the pygame2exe version, and a similar comment in the log if I use the 'short' py2exe version (Traceback (most recent call last):
File "Nomi_Animali_1.1p.py", line 100, in
basicFont = pygame.font.SysFont("FreeSansBold.ttf", 72)
File "pygame__init__.pyc", line 70, in getattr
NotImplementedError: font module not available
(ImportError: DLL load failed: Impossibile trovare il modulo specificato.))
I have tried in all cases to use as font: None, "Arial", "FreeSansBold.ttf"
Just import py2exe.build_exe again will work
>>> import py2exe
>>> py2exe.build_exe
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'build_exe'
>>> import py2exe.build_exe
>>> py2exe.build_exe
<module 'py2exe.build_exe' from 'C:\\Python34\\lib\\site-packages\\py2exe\\build_exe.py'>

Resources