Mediapipe installation on Raspberry pi 4b+ - python

During the installation I followed the https://github.com/superuser789/MediaPipe-on-RaspberryPi guide on my Raspberry Pi 4b+ 4gb and running Raspberry Pi OS 32bit. All my packages are up to date.
I ran python3 setup.py gen_protos && python3 setup.py bdist_wheel and got this result:
ERROR: Traceback (most recent call last):
File "/home/diegos-pi/.cache/bazel/_bazel_diegos-pi/7f3a9a61ae329ba025208f264fd9a815/external/rules_cc/cc/private/rules_impl/compiler_flag.bzl", line 17, column 76, in <toplevel>
load("#bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
Error: file '#bazel_tools//tools/cpp:toolchain_utils.bzl' does not contain symbol 'use_cpp_toolchain' (did you mean 'find_cpp_toolchain'?)
ERROR: While resolving toolchains for target //mediapipe/modules/face_detection:face_detection_short_range_cpu: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '#bazel_tools//tools/cpp': in /home/diegos-pi/.cache/bazel/_bazel_diegos-pi/7f3a9a61ae329ba025208f264fd9a815/external/rules_cc/cc/defs.bzl: Extension file 'cc/private/rules_impl/compiler_flag.bzl' has errors
ERROR: Analysis of target '//mediapipe/modules/face_detection:face_detection_short_range_cpu' failed; build aborted: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '#bazel_tools//tools/cpp': in /home/diegos-pi/.cache/bazel/_bazel_diegos-pi/7f3a9a61ae329ba025208f264fd9a815/external/rules_cc/cc/defs.bzl: Extension file 'cc/private/rules_impl/compiler_flag.bzl' has errors
INFO: Elapsed time: 16.113s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 0 targets conf\
igured)

Related

why is python giving me errors while trying to install a third party module, openpyxl version 2.6.1?

i am reading the book Automate the boring stuff with python by AI Sweigart. i am on the chapter working with excel spreadsheets, and the its telling me to download a specific version of openpyxl. but when i try to download it to gives me a error. i attach the errors i got, i cut come of it out because its very long it looks like its looking for a specific file?? why is this?? i tried two commands,
pip install --user openpyxl==2.6.1 and pip install openpyxl==2.6.1. but both commands give me the same error???
`C:\Users\JO>pip install openpyxl==2.6.1
Collecting openpyxl==2.6.1
Using cached openpyxl-2.6.1.tar.gz (173 kB)
ERROR: Error [WinError 2] The system cannot find the file
specified while executing python setup.py egg_info
Preparing metadata (setup.py) ... error
ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\JO\AppData\Local\Packages \PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local- packages\Python310\site-packages\pip\_internal\utils\logging.py", line 177, in emit
self.console.print(renderable, overflow="ignore", crop=False, style=style)
---Snip---

Python exe runtime error: Fatal Python error: Py_Initialize: Unable to get the locale

I'm running Anaconda 64-bit, with Python 3.5.5, on Linux Mint Xfce 18.3, 64-bit. I want to use PyInstaller to create an executable. After struggling through the PyInstaller install (not trivial), I ran pyinstaller test_build.py, where test_built.py consists solely of
print("Hello, world!")
I don't get any warnings or errors that are unexpected (overwrites folder if I've done it before, of course). I cd into ./dist/test_build and run ./test_build, and I get the following errors:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
zipimport.ZipImportError: can't find module 'encodings'
Current thread 0x00007fe95dc36700 (most recent call first):
Aborted (core dumped)
Any ideas? Thanks so much for your time!

Bazel build and test after Tensorflow contribution

I have added functionality to tensorflow/tensorflow/python/ops/image_ops_impl.py and corresponding unit tests in tensorflow/tensorflow/python/ops/image_ops_test.py
I originally forked tensorflow from the master branch, made these changes on my local machine, rebased and commit.
Then I created and activated a virtualenv.
When running bazel test //tensorflow/python..., as recommended in the contribution guide I am recieving:
ERROR: /Users/isaacsultan/Code/tensorflow/third_party/python_runtime/BUILD:5:1: no such package '#local_config_python//': Traceback (most recent call last):
File "/Users/isaacsultan/Code/tensorflow/third_party/py/python_configure.bzl", line 308
_create_local_python_repository(repository_ctx)
File "/Users/isaacsultan/Code/tensorflow/third_party/py/python_configure.bzl", line 270, in _create_local_python_repository
_check_python_lib(repository_ctx, python_lib)
File "/Users/isaacsultan/Code/tensorflow/third_party/py/python_configure.bzl", line 213, in _check_python_lib
_fail(("Invalid python library path: %...))
File "/Users/isaacsultan/Code/tensorflow/third_party/py/python_configure.bzl", line 28, in _fail
fail(("%sPython Configuration Error:%...)))
Python Configuration Error: Invalid python library path: /usr/local/lib/python2.7/dist-packages
and referenced by '//third_party/python_runtime:headers'
ERROR: Analysis of target '//tensorflow/python:control_flow_util' failed; build aborted: Analysis failed
INFO: Elapsed time: 4.603s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (8 packages loaded)
FAILED: Build did NOT complete successfully (8 packages loaded)
currently loading: tensorflow/core ... (2 packages)
What could the source of my issue be please?
Since I am only changing the python functionality, there is no need to rebuild.
EDIT: After re-running ./configure:
(tensorflow) Isaacs-MacBook:tensorflow isaacsultan$ bazel clean --expunge
INFO: Starting clean.
(tensorflow) Isaacs-MacBook:tensorflow isaacsultan$ bazel test //tensorflow/python/...
Starting local Bazel server and connecting to it...
........................
ERROR: /private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/external/local_config_cc/BUILD:50:5: in apple_cc_toolchain rule #local_config_cc//:cc-compiler-darwin_x86_64: Xcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, try: "bazel clean --expunge" to re-run Xcode configuration
ERROR: Analysis of target '//tensorflow/python/eager:core' failed; build aborted: Analysis of target '#local_config_cc//:cc-compiler-darwin_x86_64' failed; build aborted
INFO: Elapsed time: 15.184s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (93 packages loaded)
FAILED: Build did NOT complete successfully (93 packages loaded)
currently loading: tensorflow/core ... (2 packages)
EDIT 2:
After running bazel clean --expunge then ./configure:
Isaacs-MacBook:Tensorflow isaacsultan$ bazel test //tensorflow/python/...
Starting local Bazel server and connecting to it...
...................
ERROR: /private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/external/local_config_cc/BUILD:50:5: in apple_cc_toolchain rule #local_config_cc//:cc-compiler-darwin_x86_64: Xcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, try: "bazel clean --expunge" to re-run Xcode configuration
ERROR: Analysis of target '//tensorflow/python:pywrap_tensorflow_import_lib_file' failed; build aborted: Analysis of target '#local_config_cc//:cc-compiler-darwin_x86_64' failed; build aborted
INFO: Elapsed time: 14.969s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (88 packages loaded)
FAILED: Build did NOT complete successfully (88 packages loaded)
currently loading: tensorflow/core ... (5 packages)
EDIT 3:
After following these steps:
Xcode version must be specified to use an Apple CROSSTOOL
4 warnings generated.
ERROR: /Users/isaacsultan/Code/tensorflow/tensorflow/BUILD:576:1: Executing genrule //tensorflow:tensorflow_python_api_gen failed (Exit 1)
/anaconda/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "/private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/tools/api/generator/create_python_api.py", line 27, in <module>
from tensorflow.python.tools.api.generator import doc_srcs
File "/private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 81, in <module>
from tensorflow.python import keras
File "/private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/keras/__init__.py", line 25, in <module>
from tensorflow.python.keras import applications
File "/private/var/tmp/_bazel_isaacsultan/0e2667ab20883652d759a6a805575b2d/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/keras/applications/__init__.py", line 21, in <module>
import keras_applications
ImportError: No module named keras_applications
INFO: Elapsed time: 57510.356s, Critical Path: 492.10s
INFO: 6867 processes: 6867 local.
FAILED: Build did NOT complete successfully
Is it possible you forgot to run ./configure before building?

ImportError: DLL load failed: The operating system cannot run %1

I want to build M2Crypto for Windows x64 to be used in python 2.7 in Windows x64.
I downloaded the library package named: "M2CryptoWin64-master" from: https://github.com/martinpaljak/M2Crypto
Then, I followed these steps from enter link description here:
In setup.py:
replace self.openssl = 'C:\pkg' by self.openssl =
'C:\grr-build\openssl' replace name = 'M2Crypto.__m2crypto' , by name
= '__m2crypto' Build:
set PATH=%PATH%;C:\grr-build\swigwin-2.0.9 C:\Python27\python.exe
setup.py build C:\Python27\python.exe setup.py install To get M2Crypto
to work for PyInstaller:
Rename C:\Python27\lib\site-packages\M2Crypto-0.21.1-py2.7-win32.egg
to C:\Python27\lib\site-packages\M2Crypto-0.21.1-py2.7-win32.egg.zip
extract M2Crypto-0.21.1-py2.7-win32.egg.zip into
C:\Python27\lib\site-packages\ without a
M2Crypto-0.21.1-py2.7-win32.egg sub directory remove
M2Crypto-0.21.1-py2.7-win32.egg.zip
When I test the library by going to Python.exe and type:
>>> import M2Crypto
I get this message:
Traceback (most recent call last): File "", line 1, in
File
"C:\Python27\lib\site-packages\m2crypto-0.22.3-py2.7-win-amd64.egg\M2Cryp
to__init__.py", line 22, in
import __m2crypto ImportError: DLL load failed: The operating system cannot run %1.
Can you please help me figure out how to solve the issue?
EDIT:
I also did the following to get M2Crypto to work for PyInstaller:
Rename C:\Python27\lib\site-packages\M2Crypto-0.21.1-py2.7-win32.egg to
C:\Python27\lib\site-packages\M2Crypto-0.21.1-py2.7-win32.egg.zip
extract M2Crypto-0.21.1-py2.7-win32.egg.zip into
C:\Python27\lib\site-packages\ without a
M2Crypto-0.21.1-py2.7-win32.egg sub directory remove
M2Crypto-0.21.1-py2.7-win32.egg.zip

Error Installing imgseek on Mac Os

I am trying to install imgseek- the server version (http://www.imgseek.net/) to do image analysis.I am able to install all the dependencies successfully using:
sudo port install swig
sudo port install swig-python
sudo easy_install twisted
sudo port install imagemagick
sudo easy_install epydoc
Then I download isk-daemon from the downloads(isk-daemon-0.9.3.tar.gz) and build and install it. Everything runs succesfully.
But when I run iskdaemon.py from the command prompt, i get the following error:
sk-daemon : WARNING | no config file (isk-daemon.conf) found. Looked at local dir, home user dir and /etc/iskdaemon. Using defaults for everything.
root : ERROR Unable to load the C++ extension "_imgdb.so(pyd)" module.
root : ERROR See http://www.imgseek.net/isk-daemon/documents-1/compiling
Traceback (most recent call last):
File "/Users/gghanakota/anaconda/lib/python2.7/site-packages/isk_daemon-0.9.3-py2.7-macosx-10.5-x86_64.egg/imgSeekLib/ImageDB.py", line 35, in
import imgdb
File "/Users/gghanakota/anaconda/lib/python2.7/site-packages/isk_daemon-0.9.3-py2.7-macosx-10.5-x86_64.egg/imgSeekLib/imgdb.py", line 28, in
_imgdb = swig_import_helper()
File "/Users/gghanakota/anaconda/lib/python2.7/site-packages/isk_daemon-0.9.3-py2.7-macosx-10.5-x86_64.egg/imgSeekLib/imgdb.py", line 20, in swig_import_helper
import _imgdb
ImportError: dlopen(/Users/gghanakota/anaconda/lib/python2.7/site-packages/isk_daemon-0.9.3-py2.7-macosx-10.5-x86_64.egg/_imgdb.so, 2): Symbol not found: __ZNSs4_Rep20_S_empty_rep_storageE
Referenced from: /Users/gghanakota/anaconda/lib/python2.7/site-packages/isk_daemon-0.9.3-py2.7-macosx-10.5-x86_64.egg/_imgdb.so
Expected in: dynamic lookup
Please help!
I had the same problem when I was trying to install iskdaemon on my Mac (osx yosemite).
The problem in my case was that when I was building it, the c++ compiler threw two errors on using min function in imgdb.cpp
The error was because the types of the variables in the min function were not the same. Consequently the build failed and the imgdb module wasn't produced.
I fixed it by adding a simple typecast to the variables passed to the min function:
I changed: min(sz, numres) to min(sz, (long int)numres) on line 1003,
and min((V.size()/2), numres) to min((int)(V.size()/2), numres) on line 1327
I built again and it is working now.
Check if you get any errors when you build, maybe you are facing the same issue.

Categories

Resources