ERROR: 'python3 setup.py build ' execution failed. in yocto dunfell - python-3.7

I am trying to build core-image-minimal(rootfs) using yocto. yocto version :3.1.17"
Am using Poky dunfell branch. trying to build Local image with python3
but getting bellow issue:
Log data follows:
| DEBUG: Executing shell function do_compile
| Traceback (most recent call last):
| File "/home/ubuntu/project/build/tmp/work/x86_64-linux/meson-
native/0.53.2-r0/meson-0.53.2/setup.py", line 24, in <module>
| from setuptools import setup
| **ModuleNotFoundError: No module named 'setuptools'**
| ERROR: 'python3 setup.py build ' execution failed.
| WARNING: /home/ubuntu/project/build/tmp/work/x86_64-linux/meson-native/0.53.2-r0/temp/run.do_compile.33462:1 exit 1 from 'exit 1'
| ERROR: Execution of '/home/ubuntu/project/build/tmp/work/x86_64-linux/meson-native/0.53.2-r0/temp/run.do_compile.33462' failed with exit code 1
what may be root cause ?
I can see setup.py trying to import setuptools, but not finding it. also we have included python3-setuptools as dependency.

Related

Is there a way to fix this error? I'm trying to understand it but don't really know

ERROR: Command errored out with exit status 1:
command: 'C:\Users\panda\anaconda3\envs\dmodel\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\panda\AppData\Local\Temp\pip-req-build-0lhigfqj\bindings/torch\setup.py'"'"'; file='"'"'C:\Users\panda\AppData\Local\Temp\pip-req-build-0lhigfqj\bindings/torch\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\panda\AppData\Local\Temp\pip-pip-egg-info-h3yznucj'
cwd: C:\Users\panda\AppData\Local\Temp\pip-req-build-0lhigfqj\bindings/torch
Complete output (6 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\panda\AppData\Local\Temp\pip-req-build-0lhigfqj\bindings/torch\setup.py", line 41, in
raise RuntimeError("Could not locate a supported Microsoft Visual C++ installation")
RuntimeError: Could not locate a supported Microsoft Visual C++ installation
Building PyTorch extension for tiny-cuda-nn version 1.6
----------------------------------------
WARNING: Discarding git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Yocto Build Dependency on Debian Package

I am working on migrating from Debian to Yocto. As a result, many of the proprietary packages I am writing recipes for have dependencies on Debian libraries which do not appear to be available directly in Yocto. This might be a rookie question, but I'm trying to figure out how to do this.
Below, I have one of my recipe for a Makefile C project that was generated with recipetool create:
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
#
# The following license files were not able to be identified and are
# represented as "Unknown" below, you will need to check them yourself:
# debian/copyright
LICENSE = "Unknown"
LIC_FILES_CHKSUM = "file://debian/copyright;md5=some-hash"
SRC_URI = "git://git#my-project.git;protocol=ssh"
# Modify these as desired
PV = "1.0+git${SRCPV}"
SRCREV = "<...>"
S = "${WORKDIR}/git"
DEPENDS = "systemd"
# NOTE: this is a Makefile-only piece of software, so we cannot generate much of the
# recipe automatically - you will need to examine the Makefile yourself and ensure
# that the appropriate arguments are passed in.
do_compile () {
oe_runmake my-project
}
As you can see, I have specified a dependency on systemd. However, the dependency I really think I need is the Debian package libsystemd.
Whenever I bitbake this recipe, I get the following:
NOTE: Executing Tasks
ERROR: <recipe-name> do_compile: oe_runmake failed
ERROR: <recipe-name> do_compile: Execution of '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/temp/run.do_compile.13271' failed with exit code 1:
make[1]: Entering directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
CC file-name.c
../file-name.c:6:10: fatal error: systemd/sd-daemon.h: No such file or directory
6 | #include <systemd/sd-daemon.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:93: build/file-name.o] Error 1
make[1]: Leaving directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
make: *** [Makefile:72: some-recipe] Error 2
WARNING: exit code 1 from a shell command.
ERROR: Logfile of failure stored in: /home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/temp/log.do_compile.13271
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 24 my-project
| make[1]: Entering directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
| CC my-file.c
| ../my-file.c:6:10: fatal error: systemd/sd-daemon.h: No such file or directory
| 6 | #include <systemd/sd-daemon.h>
| | ^~~~~~~~~~~~~~~~~~~~~
| compilation terminated.
| make[1]: *** [Makefile:93: build/my-file.o] Error 1
| make[1]: Leaving directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
| make: *** [Makefile:72: my-project] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/temp/run.do_compile.13271' failed with exit code 1:
| make[1]: Entering directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
| CC my-file.c
| ../my-file.c:6:10: fatal error: systemd/sd-daemon.h: No such file or directory
| 6 | #include <systemd/sd-daemon.h>
| | ^~~~~~~~~~~~~~~~~~~~~
| compilation terminated.
| make[1]: *** [Makefile:93: build/my-file.o] Error 1
| make[1]: Leaving directory '/home/mitch/bin/yocto/project-name/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/recipe-name/1.0+gitAUTOINC+...-r0/git/src/core'
| make: *** [Makefile:72: my-recipe] Error 2
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/home/mitch/bin/yocto/project-name/layers/meta-project/recipes-main/my-recipe/my-recipe_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2166 tasks of which 2163 didn't need to be rerun and 1 failed.
To summarize, what this looks like is my project requires libraries provided by systemd. What am I missing here that would allow me to get this project to build? Is there a way to build it?
Okay, so I guess I was overthinking this. Yocto uses your system to compile the project. So, all I needed to do was provide the systemd header files on my host machine. Since I am running Ubuntu, installing libsystemd-dev on my host fixed the issue. I think that the DEPENDS on systemd will still be required for running on the Yocto system.

ERROR: Command errored out with exit status 1: python setup.py egg_info; update setuptools doesn't work

I'm trying to install a private python module with command: "pip install . -i "private url" "
I had this error:
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-rnoryb6e\
I uninstall Python 38 and reinstall it.
Pip is updated and setup_tools is also updated.
And now I have this error:
D:\L1\onelib\trx-5g>D:\L1\onelib\venv\Scripts\pip.exe install . -i https://artifactory-espoo1..com/artifactory/api/pypi/ulphy-pypi-prod-virtual/simple
Looking in indexes:
https://artifactory-espoo1..com/artifactory/api/pypi/ulphy-pypi-prod-virtual/simple,
https://artifactory-espoo2.***********.com/artifactory/ap
i/pypi/mn-l1-pz-int-lib-local/simple Processing d:\l1\onelib\trx-5g
ERROR: Command errored out with exit status 1:
command: 'd:\l1\onelib\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\se
tup.py'"'"';
file='"'"'C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(file);code=f.read().repla ce('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
egg_info --egg-base
'C:\Users\hwi_pi\AppData\Local\Temp\pip-pip-egg-info-zvlq1hsf'
cwd: C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz
Complete output (15 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\setup.py",
line 23, in
version=os.environ.get('CI_COMMIT_TAG', f'0.0.0+{get_local_version_label()}'),
File "C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\setup.py",
line 17, in get_local_version_label
commit_hash = subprocess.check_output(COMMAND.split()).decode('utf-8').strip()
File "C:\Users\hwi_pi\AppData\Local\Programs\Python\Python38\lib\subprocess.py",
line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\hwi_pi\AppData\Local\Programs\Python\Python38\lib\subprocess.py",
line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\hwi_pi\AppData\Local\Programs\Python\Python38\lib\subprocess.py",
line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\hwi_pi\AppData\Local\Programs\Python\Python38\lib\subprocess.py",
line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for
full command output.
Where the logs are located ?
I'm on Windows 10.
Python 3.8.5.
I launched this command via Pycharm and via cmd windows and same result.
I tried to run the command in administration mode; and same result.
I have tried every solution available on stackoverflow and nothing solves my error.
I tried to find C:\Users\hwi_pi\AppData\Local\Temp\pip-req-build-_4yae_lz\setup.py to see the file setup.py but foled pip-req-build-_4yae_lz doesn't exist.
I can access to https://artifactory-espoo1.************.com/artifactory/api/pypi/ulphy-pypi-prod-virtual/simple via firefox; but I can't download it in .zip for example
Someone to help please ?

BitBake recipe for custom setup.py

In my recipe I have to download git repository and run CMake. After CMake finish its work additional directory OUT is created which contain setup.py file that I like to run in do_install?
I have tried:
DEPENDS = "setuptools python"
do_install () {
python OUT/setup.py install
}
But it raise no setup.py found error.
Can anyone deal with such issue?
That's happen because bitbake doesn't know where setup.py is stored - You need to use ${S} variable generated by bitbake to provide full path to this script.
Please read about how do_install() task work - link
At the moment I have reorganized my recipe which looks like below:
LICENSE = "CLOSED"
BB_STRICT_CHECKSUM = "0"
inherit cmake setuptools pythonnative
DEPENDS = "boost udev python swig-native python-native python-setuptools-native cmake-native"
SRC_URI = " \
git://github.com/my_repo.git;name=my_name \
file://0001-system-install.patch \
"
SRCREV_my_name = "404ff3eeff0d79c15cbfdbc126c4bff2996baea6"
S = "${WORKDIR}/git"
PARALLEL_MAKEINST = ""
Project downloaded from git base on CMake which has install like that:
install(CODE "execute_process(COMMAND python \"${PROJECT_SOURCE_DIR}/python/setup.py\" \"install\")")
But when I call recipe to build (bitbake my_recipe) or build image which contains that recipe (bitbake my_image) i received such error:
ERROR: pc-ble-driver-git-r0 do_compile: python setup.py build execution failed.
ERROR: pc-ble-driver-git-r0 do_compile: Function failed: do_compile (log file is located at /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502)
ERROR: Logfile of failure stored in: /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502
Log data follows:
| DEBUG: Executing shell function do_compile
| ERROR: python setup.py build execution failed.
| /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/recipe-sysroot-native/usr/bin/python-native/python: can't open file 'setup.py': [Errno 2] No such file or directory
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502)
ERROR: Task (/build/yocto-fsl/sources/meta-slabs/recipes-external/pc-ble-driver/pc-ble-driver_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2195 tasks of which 2194 didn't need to be rerun and 1 failed.
P.S. On my PC when I build CMake project and call make install everything go as I assumed.
Any other suggestion how to deal with that?
Try add below command in your recipe file
distutils_do_compile() {
:
}
distutils_stage_headers() {
:
}
distutils_stage_all() {
:
}
distutils_do_install() {
:
}
and see more detail information below...
./poky/meta/classes/distutils-tools.bbclass

'no module named setuptools' but it is contained in the DEPENDS variable

This Problem regards Openembedded/Yocto.
I have source code which needs to be compiled by a custom python3 script.
That means, that some python3 script should run during the do_compile() process.
The script imports setuptools, therefore, I added DEPENDS += "python3-setuptools-native" to the recipe. As far as I understand the documentation, this should make the setuptools module available for the building process (native).
But when bitbake executes the do_compile() process, I get this error: no module named 'setuptools'.
Let me break it down to a minimal (non-)working example:
FILE: test.bb
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://test/LICENSE;md5=d41d8cd98f00b204e9800998ecf8427e"
DEPENDS += "python3-setuptools-native"
SRC_URI = "file://test.py \
file://LICENSE"
do_compile() {
python3 ${S}/../test.py
}
FILE: test.py
import setuptools
print("HELLO")
bitbaking:
$ bitbake test
ERROR: test-1.0-r0 do_compile: Function failed: do_compile (log file is located at /path/to/test/1.0-r0/temp/log.do_compile.8532)
ERROR: Logfile of failure stored in: /path/to/test/1.0-r0/temp/log.do_compile.8532
Log data follows:
| DEBUG: Executing shell function do_compile
| Traceback (most recent call last):
| File "/path/to/test-1.0/../test.py", line 1, in <module>
| import setuptools
| ImportError: No module named 'setuptools'
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /path/to/test/1.0-r0/temp/log.do_compile.8532)
ERROR: Task (/path/to/test.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 400 tasks of which 398 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
Summary: 1 task failed:
/path/to/test.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
Is my exepectation wrong, that DEPENDS += "python3-setuptools-native" makes the python3 module 'setuptools' available to the python3 script in do_compile()? How may I accomplish this?
Under the hood quite a bit more is needed to get working setuptools support. Luckily there's a class to handle that:
inherit setuptools3
This should be all that's need to package a setuptools based project with OE-Core. As long as your project has a standard setup.py you don't need to write any do_compile() or do_install() functions.
If you do need to look at the details, meta/classes/setuptools3.bbclass and meta/classes/distutils3.bbclass should contain what you need (including the rather unobvious way to call native python from a recipe).