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

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

Related

enable BUILD_PYTHON in CMake

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?

autosklearn installation. Error: No module named 'sklearn.metrics.classification'

I'm trying to execute a script that uses Scikit and autosklearn on Ubuntu 20, python 3.8
I have followed the instructions to install sckit https://scikit-learn.org/stable/install.html and autosklearn installation https://automl.github.io/auto-sklearn/master/installation.html
However I'm getting
Exception ignored in: <function AutoML.__del__ at 0x7f37c6ee9160>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/autosklearn/automl.py", line 1380, in __del__
self._backend.context.delete_directories(force=False)
AttributeError: 'AutoMLClassifier' object has no attribute '_backend'
Traceback (most recent call last):
File "myscript.py", line 261, in <module>
import model_snow_magn_only_package
File "/myfolder/myscript.py", line 150, in <module>
clf = pickle.load(open(model_name, "rb"))
ModuleNotFoundError: No module named 'sklearn.metrics.classification'
I have tried other releases of these packages but without success.
Does anyone have an idea of which releases/packages to install to make it work?

What is the reasonf for "ModuleNotFoundError: No module named 'engine'" and how to fix it?

This error occurred when I try to run my code:
Traceback (most recent call last):
File "c:\Users\loveislife\Desktop\PyProject\J.A.R.V.I.S - Copy\script.py", line 83, in <module>
import pyttsx
File "C:\Users\loveislife\AppData\Local\Programs\Python\Python37\lib\site-
packages\pyttsx\__init__.py",
line 18, in <module>
from engine import Engine
ModuleNotFoundError: No module named 'engine'.
And this error occurred when I open cmd prompt to import engine:
C:\Users\loveislife>pip install engine
Collecting engine
ERROR: Could not find a version that satisfies the requirement engine (from versions: none)
ERROR: No matching distribution found for engine
How can I fix it?
From google, try installing and importing pyttsx3, which is the updated version for python 3, and it should 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