My python-xbee-2.3.2.bb file contains:
SRC_URI="https://github.com/niolabs/python-xbee/archive/v2.3.2.tar.gz"
SRC_URI[md5sum] = "e74381e23f12159675d7ad92a06d8d0f"
DEPENDS += "${PYTHON_PN}-pytest-runner-native"
do_configure[noexec]="1"
inherit setuptools
RDEPENDS_${PN} += " \
${PYTHON_PN}-subprocess "
RDEPENDS_${PN} = "\
${PYTHON_PN}-fcntl \
${PYTHON_PN}-numbers \
${PYTHON_PN}-shell \
${PYTHON_PN}-stringold \
${PYTHON_PN}-io \
${PYTHON_PN}-logging \
${PYTHON_PN}-math \
${PYTHON_PN}-netclient \
${PYTHON_PN}-threading "
This is error getting when I compile bitbake python-xbee-2.3.2:
ERROR: python-xbee-2.3.2-1.0-r0 do_compile: 'python setup.py build '
execution failed. ERROR: python-xbee-2.3.2-1.0-r0 do_compile: Function
failed: do_compile (log file is located at
/home/chandra/yoctorpi/mender-raspberrypi/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/python-xbee-2.3.2/1.0-r0/temp/log.do_compile.15930)
ERROR: Logfile of failure stored in:
/home//build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/python-xbee-2.3.2/1.0-r0/temp/log.do_compile.15930
After that am getting log data follows:
can't open file 'setup.py':[Errno 2] No such file or directory.
/home//build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/python-xbee-2.3.2/1.0-r0/recipe-sysroot-native/usr/bin/python-native/python: can't open file 'setup.py' :[Errno 2] No such file or directory
ERROR: 'python setup.py build ' execution failed
ERROR: Function failed: do_compile (log file is located at /home//build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/python-xbee-2.3.2/1.0-r0/temp/log.do_compile.15930)
ERROR: Task (/home//build/../sources/poky/meta/recipes-support/python-xbee-2.3.2/python-xbee-2.3.2.bb:do_compile) failed with exit code '1'
You should inherit pypi bbclass as well since this deals with python package installation:
inherit pypi
As a side notes:
Check how you assign RDEPENDS_${PN}, it looks that you just override it instead of updating.
The name of recipe according to standard should python-xbee_2.3.2.bb - note the underscore (assuming your package supports only python2.X).
It's not recommended to hard-code version in SRC_URI, check in the above link as well.
Related
I have an issue globally on my iMac ( M1 incase it matters )
where the commands exit with import ansible module is missing
So I tried installing a tmp dir with virtual env and tried using Ansible from there w/o luck.
I'll start from the error:
$ ../venv/bin/ansible-inventory
ERROR: [Errno 21] Is a directory: '/private/tmp/testansible/z'
File structure is like this:
~/$ cd /tmp
tmp$ mkdir testansible && cd $_
testansible$ mkdir z
testansible$ virtualenv venv
testansible$ venv/bin/pip3 install ansible
Then in a different directory i'm trying to use it:
testansible$ cd z
z$ ../venv/bin/ansible-config init > ansible.cfg
Then running any ansible command gave me tons of errors:
ERROR: Invalid settings supplied for DEFAULT_GATHER_TIMEOUT
ERROR: Invalid settings supplied for DEFAULT_NULL_REPRESENTATION
ERROR: Invalid settings supplied for DEFAULT_REMOTE_PORT
ERROR: Invalid settings supplied for GALAXY_IGNORE_INVALID_SIGNATURE_STATUS_CODES
Which is strange by itself because their comments says that if there's no value - it will take some default from somewhere
Each one I "resolved" by commenting them out
Then the command worked:
z$ ../venv/bin/ansible-config init > ansible.cfg
But every other ansible command i'm trying to execute gives the same error:
z$ ../venv/bin/ansible -i inventory.hosts
ERROR: [Errno 21] Is a directory: '/private/tmp/testansible/z'
z$ ../venv/bin/ansible-inventory -i inventory.hosts
ERROR: [Errno 21] Is a directory: '/private/tmp/testansible/z'
Any ideas ?
Edit
Thanks to the comment below the issue was this line in the ansible.cfg file:
# (path) File to which Ansible will log on the controller. When empty logging is disabled.
log_path=
Commenting out this line - and the ansible commands started working.
I'm not sure , why across the file it says: When empty logging is disabled - but it's not disabled, it throws an exception. so as all the above variables, they don't really have a default value - they are just getting in the way
I'm currently trying to corss-compile scipy for open-embedded but the bitbake build failed with the error
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: python-scipy-1.0.0-r0 do_compile: python setup.py build execution failed.
ERROR: python-scipy-1.0.0-r0 do_compile: Function failed: do_compile (log file is located at /home/somewhere_in_my_home_folder/build_dir/tmp/work/core2-64-idp-linux/python-scipy/1.0.0-r0/temp/log.do_compile.2788)
ERROR: Logfile of failure stored in: /home/somewhere_in_my_home_folder/build_dir/tmp/work/core2-64-idp-linux/python-scipy/1.0.0-r0/temp/log.do_compile.2788
Log data follows:
| DEBUG: Executing shell function do_compile
| Traceback (most recent call last):
| File "setup.py", line 418, in <module>
| setup_package()
| File "setup.py", line 398, in setup_package
| from numpy.distutils.core import setup
| ImportError: No module named numpy.distutils.core
| ERROR: python setup.py build execution failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/somewhere_in_my_home_folder/build_dir/tmp/work/core2-64-idp-linux/python-scipy/1.0.0-r0/temp/log.do_compile.2788)
ERROR: Task (/home/somewhere_in_my_home_folder/recipes-ros/python-scipy/python-scipy_1.0.0.bb:do_compile) failed with exit code '1'
I already spend searching several hours for recipe which works, but without any success. The only thing I found about this error was here.
My recipe looks like this
DESCRIPTION = "SciPy"
SECTION = "devel/python"
LICENSE = "CLOSED"
PYPI_PACKAGE = "scipy"
inherit pypi setuptools distutils
DEPENDS_${PN} = "python-numpy python-setuptools python-distutils"
RDEPENDS_${PN} = "python-numpy python-setuptools python-distutils"
S = "${WORKDIR}/scipy-1.0.0"
SRC_URI[md5sum] = "53fa34bd3733a9a4216842b6000f7316"
SRC_URI[sha256sum] = "87ea1f11a0e9ec08c264dc64551d501fa307289460705f6fccd84cbfc7926d10"
Any ideas on how to crosscompile scipy oder on how to fix this error?
edit 1:
my changed my recipe to
DESCRIPTION = "SciPy"
SECTION = "devel/python"
LICENSE = "CLOSED"
PYPI_PACKAGE = "scipy"
DEPENDS_${PN} = "python-numpy python-setuptools python-distutils"
RDEPENDS_${PN} = "python-numpy python-setuptools python-distutils"
S = "${WORKDIR}/scipy-1.0.0"
PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy,"
SRC_URI[md5sum] = "53fa34bd3733a9a4216842b6000f7316"
SRC_URI[sha256sum] = "87ea1f11a0e9ec08c264dc64551d501fa307289460705f6fccd84cbfc7926d10"
FILES_python-scipy+="/usr/lib/* /usr/lib/python2.7/*"
FILES_python-scipy-dev+="/usr/share/pkgconfig /usr/lib/pkgconfig /usr/lib/python2.7/site-packages/*.la "
FILES_python-scipy-staticdev+="/usr/lib/python2.7/site-packages/*.a "
inherit pypi ${#bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)}
but now I get a error while building the main image
No package python-scipy available.
Error: Unable to find a match
That kind of recipe should be enough to get SciPy to work:
SUMMARY = "Scientific Library for Python"
SECTION = "devel/python"
HOMEPAGE = "https://pypi.python.org/pypi/scipy"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=d0db8f4148a3d5534cfb93be78f9287c"
PYPI_PACKAGE="scipy"
SRC_URI[md5sum] = "53fa34bd3733a9a4216842b6000f7316"
SRC_URI[sha256sum] = "87ea1f11a0e9ec08c264dc64551d501fa307289460705f6fccd84cbfc7926d10"
inherit pypi setuptools distutils
RDEPENDS_${PN} += "python-core python-numpy python-distutils"
DEPENDS += "python-numpy"
If it fails, you can try to replace
DEPENDS += "python-numpy" by DEPENDS += "python-numpy-native". And if it still fails, you should create an issue on SciPy github or try to patch setup files, you can see an example here.
My BUILD file is pretty simple, just
load("#protobuf_bzl//:protobuf.bzl", "py_proto_library")
py_proto_library(
name = "struct_py_pb2",
srcs = ["struct.proto"],
)
But bazel gives a bunch of baffling error messages like:
$ bazel build google/genomics/v1:all
ERROR: thomaswc//v1/BUILD:22:1: no such package '': BUILD file not found on package path and referenced by '//v1:struct_py_pb2'
ERROR: Analysis of target '//v1:struct_py_pb2' failed; build aborted: no such package '': BUILD file not found on package path
INFO: Elapsed time: 0.581s
FAILED: Build did NOT complete successfully (2 packages loaded)
currently loading: #protobuf_bzl//
I see other projects on github using bazel and py_proto_library, though, so I know it must be possible. Is there some WORKSPACE or .bzl magic that I need?
After a bunch of digging, I found a work-around: the default values of default_runtime and protoc are screwed up, so you need to override them:
py_proto_library(
name = "struct_py_pb2",
srcs = ["struct.proto"],
default_runtime = "#com_google_protobuf//:protobuf_python",
protoc = "#com_google_protobuf//:protoc",
)
I am trying to build RPM package for python setuptools-12.0.3 but getting wired error,
Its look like related to SPEC file %files -f INSTALLED_FILES but how to fix it? or is it a bug? I can see two files path in single line, how do i fix it?
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
This is the command i am using python2.7 setup.py bdist_rpm to build RPM
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
Bytecompiling .py files below /root/rpmbuild/SOURCES/setuptools-12.0.3/build/bdist.linux-x86_64/rpm/BUILDROOT/setuptools-12.0.3-1.x86_64/usr/lib/python2.6 using /usr/bin/python2.6
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: setuptools-12.0.3-1.noarch
error: Two files on one line: /usr/lib/python2.6/site-packages/setuptools/script
error: File must begin with "/": (dev).tmpl
RPM build errors:
Two files on one line: /usr/lib/python2.6/site-packages/setuptools/script
File must begin with "/": (dev).tmpl
error: command 'rpmbuild' failed with exit status 1
Solution
After spending couple hours i figure out what was wrong:
copy setuptools.spec file in my own rpmbuild environment at /root/rpmbuild/SPECS/
Change %files -f INSTALLED_FILES to %files
Run rpmbuild -ba setuptools.spec
It generate list of files which need to add in %files section, But in that list there was one file which space in filename Ouch!!
script (dev).tmpl
I have used wildcard to match all files and problem solved. somehow rpmbuild doesn't understand escap character ( Don't know if there is a better way)
%files
%defattr(-,root,root)
...
...
/usr/local/lib/python2.7/site-packages/setuptools/script*
...
I'm trying to run my Kivy app in Xcode (5.1). So far, I've managed to create an Xcode project, but it gets weird in build phase, throws an error like so:
+ echo '-> Compile to pyo'
-> Compile to pyo
+ /Users/onebit0fme/kivy-ios/tmp/Python-2.7.1/hostpython -OO -m compileall /Users/onebit0fme/kivy-ios/app-MyApp/YourApp
../tools/populate-project.sh: line 32: /Users/onebit0fme/kivy-ios/tmp/Python- 2.7.1/hostpython: No such file or directory
+ echo '-> Remove unused files (pyc, py)'
-> Remove unused files (pyc, py)
+ find /Users/onebit0fme/kivy-ios/app-MyApp/YourApp -iname '*.py' -exec rm '{}' ';'
+ find /Users/onebit0fme/kivy-ios/app-MyApp/YourApp -iname '*.pyc' -exec rm '{}' ';'
+ echo '-> Source code of MyApp updated.'
-> Source code of MyApp updated.
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
Now, most interesting are these lines:
+ /Users/onebit0fme/kivy-ios/tmp/Python-2.7.1/hostpython -OO -m compileall /Users/onebit0fme/kivy-ios/app-MyApp/YourApp
../tools/populate-project.sh: line 32: /Users/onebit0fme/kivy-ios/tmp/Python- 2.7.1/hostpython: No such file or directory
I installed latest version of Python (2.7.6) with 'port' and set it to be default. What I don't understand are:
1. Why it tries to find Python-2.7.1 ???
2. Why it looks in 'kivy-ios/tmp/' folder (I'm sure it's not there, and never was)???
This error comes from 'kivy-ios/populate_project.sh' line 32:
echo "-> Compile to pyo"
$HOSTPYTHON -OO -m compileall $YOURAPPDIR
and I don't know where '$HOSTPYTHON' is coming from and why it gets evaluated to '/Users/onebit0fme/kivy-ios/tmp/Python-2.7.1/hostpython'.
I'm completely lost and desperate, please help who has at least a hint of what is going on.
UPDATE:
Turns out, when I did 'tools/build-all.sh', it did its job and echoed 'BUILD SUCCEEDED', but then "tar: Unrecognized archive format". As the result, there's no "build/python/lib/python27.zip" in kivy-ios folder. So, I guess, it didn't finish Kivy-ios installation, again, no idea why...
Solved. Indeed, turns out kivy-ios did not built all the packages because Python package has been moved to a new location (that's why "tar: Unrecognized archive format" appeared and I ignored it unfortunately). The solution is to change python package http in 'tools/build-python.sh'.
Here's the link to solution: https://github.com/kivy/kivy-ios/issues/85