error 'No such file or directory: 'build/lib.linux-x86_64-3.9/cytoolz/_version.py' when compiling a kivy app using web3.py, buildozer and colab - kivy

I am trying to create a simple app to test connection to WEB3 with web3.py and kivy.
Here is my main.py :
from kivymd.app import MDApp
from kivymd.uix.label import MDLabel
from web3 import Web3
class MainApp(MDApp):
def build(self):
bsc = 'https://bsc-dataseed.binance.org/'
web3 = Web3(Web3.HTTPProvider(bsc))
if (web3.isConnected()):
print("Connected!")
return MDLabel(text="OK connected ! ", halign="center")
else:
print("KO")
return MDLabel(text="KO ", halign="center")
MainApp().run()
and this is my requirements in buildozer.spec :
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements =
python3,
cython,
kivy,
kivymd,
pillow,
android,
attrdict,
certifi,
cffi,
chardet,
cytoolz,
eth-abi,
eth-account,
eth-accounts,
eth-hash,
eth-keyfile,
eth-keys,
eth-rlp,
eth-utils,
eth-typing,
hexbytes,
idna,
lru-dict,
openssl,
pycryptodome,
pyzbar,
raven,
requests,
rlp,
setuptools,
toolz,
web3
Compilation worked but when i run the app i have the following message with logcat :
08-22 08:36:31.065 16472 16505 I python : Traceback (most recent call last):
08-22 08:36:31.066 16472 16505 I python : File "/home/HelloWeb3/.buildozer/android/app/main.py", line 3, in <module>
08-22 08:36:31.066 16472 16505 I python : File "/home/HelloWeb3/.buildozer/android/platform/build-arm64-v8a/build/python-installs/helloweb3/arm64-v8a/web3/__init__.py", line 6, in <module>
08-22 08:36:31.066 16472 16505 I python : File "/home/HelloWeb3/.buildozer/android/platform/build-arm64-v8a/build/python-installs/helloweb3/arm64-v8a/eth_account/__init__.py", line 1, in <module>
08-22 08:36:31.066 16472 16505 I python : File "/home/HelloWeb3/.buildozer/android/platform/build-arm64-v8a/build/python-installs/helloweb3/arm64-v8a/eth_account/account.py", line 15, in <module>
08-22 08:36:31.066 16472 16505 I python : File "/home/HelloWeb3/.buildozer/android/platform/build-arm64-v8a/build/python-installs/helloweb3/arm64-v8a/cytoolz/__init__.py", line 1, in <module>
08-22 08:36:31.067 16472 16505 I python : ImportError: dlopen failed: "/data/user/0/org.test.helloweb3/files/app/_python_bundle/site-packages/cytoolz/itertoolz.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
08-22 08:36:31.067 16472 16505 I python : Python for android ended.
So i made custom recipes to compile toolz and cytoolz:
toolz
from pythonforandroid.recipe import CythonRecipe
class ToolzRecipe(CythonRecipe):
"""Build toolz"""
version = "0.12.0"
url = "https://github.com/pytoolz/toolz/archive/refs/tags/{version}.zip"
name = "toolz"
depends = ["setuptools"]
recipe = ToolzRecipe()
cytoolz
from pythonforandroid.recipe import CythonRecipe
class CytoolzRecipe(CythonRecipe):
"""Build cytoolz"""
version = "0.12.0"
url = "https://github.com/pytoolz/cytoolz/archive/refs/tags/{version}.zip"
name = "cytoolz"
depends = ["setuptools"]
recipe = CytoolzRecipe()
But this time compilation with buildozer failed with Errot '[DEBUG]: error: [Errno 2] No such file or directory: 'build/lib.linux-x86_64-3.9/cytoolz/_version.py'
':
[DEBUG]: error: [Errno 2] No such file or directory: 'build/lib.linux-x86_64-3.9/cytoolz/_version.py'
I don't know what to do. I'm new to linux with colab.
Any advice is appreciated.
Thanks.

Related

playwright._impl._api_types.Error: Host system is missing dependencies??

enter image description here
root#f083f367b874:/app# vim test.py
root#f083f367b874:/app# python test.py
Traceback (most recent call last):
File "test.py", line 13, in
run(playwright)
File "test.py", line 3, in run
browser = playwright.chromium.launch(headless=False)
File "/usr/local/lib/python3.7/site-packages/playwright/sync_api/_generated.py", line 9449, in launch
firefoxUserPrefs=mapping.to_impl(firefox_user_prefs),
File "/usr/local/lib/python3.7/site-packages/playwright/_impl/_sync_base.py", line 103, in _sync
return task.result()
File "/usr/local/lib/python3.7/site-packages/playwright/_impl/_browser_type.py", line 90, in launch
raise e
File "/usr/local/lib/python3.7/site-packages/playwright/_impl/_browser_type.py", line 86, in launch
return from_channel(await self._channel.send("launch", params))
File "/usr/local/lib/python3.7/site-packages/playwright/_impl/_connection.py", line 36, in send
return await self.inner_send(method, params, False)
File "/usr/local/lib/python3.7/site-packages/playwright/_impl/_connection.py", line 54, in inner_send
result = next(iter(done)).result()
playwright._impl._api_types.Error: Host system is missing dependencies!
Missing libraries are:
libnss3.so
libnssutil3.so
libsmime3.so
libnspr4.so
libatk-1.0.so.0
libatk-bridge-2.0.so.0
libcups.so.2
libdrm.so.2
libdbus-1.so.3
libxkbcommon.so.0
libXcomposite.so.1
libXdamage.so.1
libXfixes.so.3
libXrandr.so.2
libgbm.so.1
libasound.so.2
libatspi.so.0
libxshmfence.so.1
How to solve this problem??
If you're using Playwright for Python, run: playwright install-deps
If you're using vanilla JS Playwright, run: npx playwright install-deps
Looks like you're using the Python version.
Try appending
# { pkgs ? import <nixpkgs> {} }:
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "kubelt";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
clojure
clojure-lsp
babashka
leiningen
nodejs-16_x
jdk
docker
google-chrome
chromedriver
act
docker
rustup
libuuid
act
wayland
google-chrome-dev
firefox-bin
]
APPEND_LIBRARY_PATH = "${lib.makeLibraryPath [ libGL libuuid wayland google-chrome-dev firefox-bin]}";
shellHook = ''
LD=$CC
export LD_LIBRARY_PATH="$APPEND_LIBRARY_PATH:$LD_LIBRARY_PATH"
'';
}

Using dc-app-performance-toolkit with Taurus on windows

I am trying to use https://github.com/atlassian/dc-app-performance-toolkit on windows 10
I have installed taurus from https://gettaurus.org/install/Installation/
jira is installed on my system and i can access it using http://localhost:2990/jira
However when i run bzt jira.yml i am getting below error.
14:43:35 INFO: Starting shell command: python util/post_run/jmeter_post_check.py←[0m
14:43:36 INFO: Starting shell command: python util/jtl_convertor/jtls-to-csv.py kpi.jtl selenium.jtl←[0m
←[33m14:43:36 WARNING: Errors for python util/jtl_convertor/jtls-to-csv.py kpi.jtl selenium.jtl:
Traceback (most recent call last):
File "util/jtl_convertor/jtls-to-csv.py", line 8, in <module>
import pandas
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\__init__.py", line 11, in <module>
__import__(dependency)
File "C:\Program Files\Taurus\pkgs\numpy\__init__.py", line 138, in <module>
from . import _distributor_init
File "C:\Program Files\Taurus\pkgs\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
←[0m
←[31m14:43:36 ERROR: Child Process Error: Test runner selenium (PyTestExecutor) has failed with retcode 1←[0m
←[31m14:43:36 ERROR: PyTestExecutor STDERR:
Traceback (most recent call last):
File "C:\Program Files\Taurus\pkgs\bzt\resources\pytest_runner.py", line 22, in <module>
import pytest
File "C:\Program Files\Taurus\pkgs\pytest\__init__.py", line 7, in <module>
from _pytest.assertion import register_assert_rewrite
File "C:\Program Files\Taurus\pkgs\_pytest\assertion\__init__.py", line 10, in <module>
from _pytest.assertion import rewrite
File "C:\Program Files\Taurus\pkgs\_pytest\assertion\rewrite.py", line 30, in <module>
from _pytest.assertion import util
File "C:\Program Files\Taurus\pkgs\_pytest\assertion\util.py", line 14, in <module>
import _pytest._code
File "C:\Program Files\Taurus\pkgs\_pytest\_code\__init__.py", line 2, in <module>
from .code import Code
File "C:\Program Files\Taurus\pkgs\_pytest\_code\code.py", line 29, in <module>
import pluggy
File "C:\Program Files\Taurus\pkgs\pluggy\__init__.py", line 16, in <module>
from .manager import PluginManager, PluginValidationError
File "C:\Program Files\Taurus\pkgs\pluggy\manager.py", line 11, in <module>
import importlib_metadata
File "C:\Program Files\Taurus\pkgs\importlib_metadata\__init__.py", line 623, in <module>
__version__ = version(__name__)
File "C:\Program Files\Taurus\pkgs\importlib_metadata\__init__.py", line 585, in version
return distribution(distribution_name).version
File "C:\Program Files\Taurus\pkgs\importlib_metadata\__init__.py", line 558, in distribution
return Distribution.from_name(distribution_name)
File "C:\Program Files\Taurus\pkgs\importlib_metadata\__init__.py", line 215, in from_name
raise PackageNotFoundError(name)
importlib_metadata.PackageNotFoundError: No package metadata was found for importlib_metadata←[0m
What am i doing wrong?
The error you're getting is about missing importlib-metadata package, you need to have all the packages listed under requirements.txt installed in order to be able to run these tests, it seems like you omitted Installation and set up chapter
So make sure to execute pip install -r requirements.txt prior to launching the Taurus test as Taurus doesn't take care of dependencies on its own.
More information:
Installing Python Package Dependencies
Navigating your First Steps Using Taurus
I had to remove python installed at
C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\
which was installed prior to bzt
To correct this, I have uninstalled taurus and installed it manually.
Installed python using python-3.8.5-amd64.exe. and not using python-3.8.5.exe

Drake installation issues on Mac

1) I built the visualizer but couldn’t launch it. Here is what I see:
(base) Taos-MacBook-Pro:drake taosun$ bazel build //tools:drake_visualizer //manipulation/util:geometry_inspector
INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 targets...
INFO: Elapsed time: 0.988s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
But when I tried to launch it, it didn't work:
(base) Taos-MacBook-Pro:drake taosun$ ./bazel-bin/tools/drake_visualizer
Traceback (most recent call last):
File "/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMR.py", line 5, in <module>
from .vtkIOAMRPython import *
ImportError: dlopen(/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMRPython.so, 2): Library not loaded: /usr/local/opt/hdf5/lib/libhdf5.103.dylib
Referenced from: /usr/local/opt/vtk#8.2/lib/libvtkIOAMR-8.2.1.dylib
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/drakevisualizerapp.py", line 3, in <module>
from director import mainwindowapp
File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/mainwindowapp.py", line 2, in <module>
from director.componentgraph import ComponentFactory
File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/componentgraph.py", line 2, in <module>
from director.fieldcontainer import FieldContainer
File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/fieldcontainer.py", line 1, in <module>
import vtk
File "/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtk.py", line 32, in <module>
all_spec.loader.exec_module(all_m)
File "/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtkmodules/all.py", line 67, in <module>
from .vtkIOAMR import *
File "/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMR.py", line 9, in <module>
from vtkIOAMRPython import *
ModuleNotFoundError: No module named 'vtkIOAMRPython'
2) I also tried python-binding. The cmake and make completed successfully. However, when I tried to import pydrake, I got the below error:
(base) Taos-MacBook-Pro:GitHub taosun$ cd drake-build
(base) Taos-MacBook-Pro:drake-build taosun$ python3 -c 'import pydrake; print(pydrake.__file__)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/drake/lib/python3.7/site-packages/pydrake/__init__.py", line 41, in <module>
from . import common
File "/opt/drake/lib/python3.7/site-packages/pydrake/common/__init__.py", line 1, in <module>
from ._module_py import *
ImportError: dlopen(/opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so, 2): Symbol not found: _PyThread_tss_alloc
Referenced from: /opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so
Expected in: flat namespace
in /opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so
For both of the above two issues, I doubt whether it is because I don’t set $PYTHONPATH correctly. This is what I set at the moment
(base) Taos-MacBook-Pro:drake-build taosun$ echo $PYTHONPATH
/opt/drake/lib/python3.7/site-packages
Thank you for the help!
For the VTK error, try adding --define="-DUSE_SYSTEM_VTK=OFF" at the end of your build command.
bazel build //tools:drake_visualizer //manipulation/util:geometry_inspector --define="-DUSE_SYSTEM_VTK=OFF"`

Issues installing Drake on Ubuntu 18.04

Followed through installation tips, but after typing
$ python underactuated/src/double_pendulum/simulate.py
I get
ImportError: dynamic module does not define init function (init_module_py).
If I run python3 I get
ImportError: cannot import name 'FindResource'.
After typing $ python3 -c 'import pydrake; print(pydrake.__file__)' I get /opt/drake/lib/python3.6/site-packages/pydrake/__init__.py
Edit:
Full output of running python3
Traceback (most recent call last):
File "underactuated/src/double_pendulum/simulate.py", line 5, in <module>
from underactuated import FindResource, PlanarSceneGraphVisualizer
ImportError: cannot import name 'FindResource'
And full output of running python (without3):
Traceback (most recent call last):
File "underactuated/src/double_pendulum/simulate.py", line 1, in <module>
from pydrake.all import (AddMultibodyPlantSceneGraph,
File "/opt/drake/lib/python3.6/site-packages/pydrake/__init__.py", line 32, in <module>
from . import common
File "/opt/drake/lib/python3.6/site-packages/pydrake/common/__init__.py", line 3, in <module>
from ._module_py import *
ImportError: dynamic module does not define init function (init_module_py)
Version of python after typing python -V is Python 2.7.15+
The fact that the print test succeeds suggests that drake is installed correctly.
Please post the full output of running simulate.py with python3.

Docker-compose start fail

I am trying to install and use docker-compose for the first time on my Ubuntu 14.04 machine, but I am failing :))
I have installed docker-compose via pip using
When I try to run docker-compose up I get this error trace:
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 7, in <module>
from compose.cli.main import main
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 41, in <module>
from . import errors
File "/usr/local/lib/python2.7/dist-packages/compose/cli/errors.py", line 10, in <module>
from docker.errors import APIError
File "/usr/local/lib/python2.7/dist-packages/docker/__init__.py", line 2, in <module>
from .api import APIClient
File "/usr/local/lib/python2.7/dist-packages/docker/api/__init__.py", line 2, in <module>
from .client import APIClient
File "/usr/local/lib/python2.7/dist-packages/docker/api/client.py", line 11, in <module>
from .build import BuildApiMixin
File "/usr/local/lib/python2.7/dist-packages/docker/api/build.py", line 9, in <module>
from .. import utils
File "/usr/local/lib/python2.7/dist-packages/docker/utils/__init__.py", line 2, in <module>
from .utils import (
File "/usr/local/lib/python2.7/dist-packages/docker/utils/utils.py", line 19, in <module>
from .. import tls
File "/usr/local/lib/python2.7/dist-packages/docker/tls.py", line 5, in <module>
from .transport import SSLAdapter
File "/usr/local/lib/python2.7/dist-packages/docker/transport/__init__.py", line 3, in <module>
from .ssladapter import SSLAdapter
File "/usr/local/lib/python2.7/dist-packages/docker/transport/ssladapter.py", line 22, in <module>
urllib3.connection.match_hostname = match_hostname
AttributeError: 'module' object has no attribute 'connection'
Eggs versions:
$pip freeze | grep -e urllib3 -e requests -e docker-py
docker-pycreds==0.2.1
requests==2.13.0
urllib3==1.14
I tried to export PYTHONPATH like this:
export PYTHONPATH=/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages
I guess you have more than one packages with different version.
request and urllib3 can both exist in /usr/lib/python2.7/dist-packages/ and /usr/local/lib/python2.7/dist-packages
In ssladapter.py, request.packages.urllib3 is priorly imported according:
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
If your requests.packages.urllib3 is too old, error will be raised.
So you have two ways to fix this problem
copy the newest urllib3 into requests/packages
remove the urllib3 in requests/packages so that docker-compose will use the urllib3 from pythonpath (your latest urllib3)
(You can get the path of requests by the interactive console:
>>> import requests
>>> requests
<module 'requests' from '/usr/lib/python2.7/dist-packages/requests/__init__.pyc'>
)

Resources