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

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"
'';
}

Related

Xonsh error while importing module PyPDF2

I am having trouble importing modules from within xonsh script that are installed in to the virtual environment.
I installed the virtual environment using vox
xontrib load vox
vox activate venv
pip install PyPDF2
Here is my minimal example
#!/usr/bin/env xonsh
import PyPDF2
If I run this from within the Python interpreter it works:
$ python
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyPDF2
>>>
If I try to run the xonsh script as a script I get the following:
$ ./minimaltest.x
sh
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
Traceback (most recent call last):
File "/usr/bin/xonsh", line 4, in <module>
main()
File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 24019, in main
_failback_to_other_shells(args, err)
File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 23983, in _failback_to_other_shells
raise err
File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 24017, in main
return main_xonsh(args)
File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 24060, in main_xonsh
run_script_with_cache(
File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 3043, in run_script_with_cache
run_compiled_code(ccode, glb, loc, mode)
File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 2948, in run_compiled_code
func(code, glb, loc)
File "./minimaltest.xsh", line 2, in <module>
import PyPDF2
ModuleNotFoundError: No module named 'PyPDF2'
Any thoughts about what might be wrong?
xonsh can only import modules that exist in the same venv that it is installed in. If you install xonsh into the same venv as PyPDF2 it should work.

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

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.

How can I fix this error and ingest data from Quandl? Thank you

When I try to run the command in my terminal, it raises an error
I'm using anaconda to install my packages and python 2.7.
$ zipline ingest -b quandl
Traceback (most recent call last):
File "/anaconda3/bin/zipline", line 6, in <module>
from pkg_resources import load_entry_point
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3241, in <module>
#_call_aside
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/anaconda3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'mock>=2.0' distribution was not found and is required by tables
It seems you need to install the mock package:
conda install mock
or, if the previous doesn't work:
conda install -c conda-forge mock

Airflow CLI command does not find the SQL_ALCHEMY_CONN variable in Docker

I am new to running airflow in docker. To run a airflow cli command, it used to be simply possible to run airflow trigger_dag etc. However, that clearly doesn't work anymore right away.
I found out I can get 'in' the container by docker exec -ti <container_name> bash. However, if I then try to run an airflow cli command, I get the following:
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 16, in <module>
from airflow import configuration
File "/usr/local/lib/python3.5/dist-packages/airflow/__init__.py", line 31, in <module>
from airflow import settings
File "/usr/local/lib/python3.5/dist-packages/airflow/settings.py", line 150, in <module>
configure_orm()
File "/usr/local/lib/python3.5/dist-packages/airflow/settings.py", line 136, in configure_orm
engine = create_engine(SQL_ALCHEMY_CONN, **engine_args)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/__init__.py", line 424, in create_engine
return strategy.create(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/strategies.py", line 50, in create
u = url.make_url(name_or_url)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/url.py", line 211, in make_url
return _parse_rfc1738_args(name_or_url)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/url.py", line 270, in _parse_rfc1738_args
"Could not parse rfc1738 URL from string '%s'" % name)
sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string ''
It looks like it doesn't take the SQL_ALCHEMY_CONN. However, if I run printenv it does show up.
Can anyone help me?
I ran into this issue. My setup is Docker using Ubuntu 16.04. I used Python3.
When i print ENV, i realized AIRFLOW__CORE__SQL_ALCHEMY_CONN was set to blank. Once i fixed that the issue was resolved.
You said SQL_ALCHEMY_CONN, Environment variable should be referred to as AIRFLOW__CORE__SQL_ALCHEMY_CONN
Make sure it is setup correctly. The order of precedence in airflow is a) Environment variables 2) Configuration in airflow.cfg file link

DSSP from Biopython throwing an error 'NameError: global name 'FileNotFoundError''

I'm trying to run DSSP through Biopython, a couple of months ago the code worked, however, I now get this erroe. Any help would be much appreciated.
>>>from Bio.PDB.PDBParser import PDBParser
>>>from Bio.PDB.DSSP import DSSP
>>>p=PDBParser(PERMISSIVE=1)
>>>st= p.get_structure('1bzq','1bzqK.pdb')
>>>model=st[0]
>>>dssp= DSSP(model,'1bzqK.pdb',dssp='dssp')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/rennes/akhila/.local/lib/python2.7/site-packages/Bio/PDB/DSSP.py", line 355, in __init__
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
I have checked the path of dssp also by
user#home:~/Documents/FR_distances$ mkdssp
mkdssp 2.2.1 options:
-h [ --help ] Display help message
-i [ --input ] arg Input file
-o [ --output ] arg Output file, use 'stdout' to output to screen
-v [ --verbose ] Verbose output
--version Print version
-d [ --debug ] arg Debug level (for even more verbose output)
I have also referred to this and changed the dssp path, but still it gives me the same error.
From source code:
Note that the recent DSSP executable from the DSSP-2 package was
renamed from dssp to mkdssp. If using a recent DSSP release, you
may need to provide the name of your DSSP executable:
>>> dssp = DSSP(model, '1mot.pdb', dssp='mkdssp')
Try replacing dssp= DSSP(model,'1bzqK.pdb',dssp='dssp') by:
dssp = DSSP(model, '1bzqK.pdb', dssp='mkdssp')

Resources