Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyJs error #146

Open
clever-giraffe opened this issue Jun 29, 2024 · 1 comment
Open

PyJs error #146

clever-giraffe opened this issue Jun 29, 2024 · 1 comment

Comments

@clever-giraffe
Copy link

clever-giraffe commented Jun 29, 2024

1. PyJs Error

Running from python env
create env, activate, install requirements, create .env

Next step, run python main.py

$ python main py
Traceback (most recent call last):
  File "/Users/dev/TapSwapBot/main.py", line 4, in <module>
    from bot.utils.launcher import process
  File "/Users/dev/TapSwapBot/bot/utils/__init__.py", line 2, in <module>
    from . import launcher
  File "/Users/dev/TapSwapBot/bot/utils/launcher.py", line 9, in <module>
    from bot.core.tapper import run_tapper
  File "/Users/dev/TapSwapBot/bot/core/tapper.py", line 7, in <module>
    from aiocfscrape import CloudflareScraper
  File "/Users/dev/TapSwapBot/venv/lib/python3.12/site-packages/aiocfscrape/__init__.py", line 8, in <module>
    import js2py
  File "/Users/dev/TapSwapBot/venv/lib/python3.12/site-packages/js2py/__init__.py", line 72, in <module>
    from .base import PyJsException
  File "/Users/dev/TapSwapBot/venv/lib/python3.12/site-packages/js2py/base.py", line 2965, in <module>
    @Js
     ^^
  File "/Users/dev/TapSwapBot/venv/lib/python3.12/site-packages/js2py/base.py", line 165, in Js
    return PyJsFunction(val, FunctionPrototype)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dev/TapSwapBot/venv/lib/python3.12/site-packages/js2py/base.py", line 1377, in __init__
    cand = fix_js_args(func)
           ^^^^^^^^^^^^^^^^^
  File "/Users/dev/TapSwapBot/venv/lib/python3.12/site-packages/js2py/utils/injector.py", line 27, in fix_js_args
    code = append_arguments(six.get_function_code(func), ('this', 'arguments'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dev/TapSwapBot/venv/lib/python3.12/site-packages/js2py/utils/injector.py", line 121, in append_arguments
    arg = name_translations[inst.arg]
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 3

2. Docker image error

just run docker compose up

Response:


#9 [tapswap-bot 5/7] RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&     sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' &&     apt update &&     apt install -y google-chrome-stable &&     apt clean
#9 0.152 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
#9 0.938 OK
#9 0.944 
#9 0.944 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#9 0.944 
#9 1.037 Hit:1 http://deb.debian.org/debian bookworm InRelease
#9 1.044 Get:2 http://dl.google.com/linux/chrome/deb stable InRelease [1825 B]
#9 1.065 Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
#9 1.105 Hit:4 http://deb.debian.org/debian-security bookworm-security InRelease
#9 1.181 Get:5 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1089 B]
#9 1.186 Fetched 2914 B in 0s (12.3 kB/s)
#9 1.186 Reading package lists...
#9 1.493 Building dependency tree...
#9 1.590 Reading state information...
#9 1.605 33 packages can be upgraded. Run 'apt list --upgradable' to see them.
#9 1.605 W: http://dl.google.com/linux/chrome/deb/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
#9 1.607 
#9 1.607 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#9 1.607 
#9 1.609 Reading package lists...
#9 1.894 Building dependency tree...
#9 1.965 Reading state information...
#9 1.969 E: Unable to locate package google-chrome-stable
#9 ERROR: process "/bin/sh -c wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&     sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" > /etc/apt/sources.list.d/google-chrome.list' &&     apt update &&     apt install -y google-chrome-stable &&     apt clean" did not complete successfully: exit code: 100
------
 > [tapswap-bot 5/7] RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&     sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' &&     apt update &&     apt install -y google-chrome-stable &&     apt clean:
1.037 Hit:1 http://deb.debian.org/debian bookworm InRelease
1.044 Get:2 http://dl.google.com/linux/chrome/deb stable InRelease [1825 B]
1.065 Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
1.105 Hit:4 http://deb.debian.org/debian-security bookworm-security InRelease
1.181 Get:5 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1089 B]


1.894 Building dependency tree...
1.965 Reading state information...
1.969 E: Unable to locate package google-chrome-stable
------
failed to solve: process "/bin/sh -c wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&     sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" > /etc/apt/sources.list.d/google-chrome.list' &&     apt update &&     apt install -y google-chrome-stable &&     apt clean" did not complete successfully: exit code: 100

apt install -y google-chrome-stable returning code 100.

How i can launch your script?

$ uname -a
Darwin work-machine.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64

Python - 3.12

@sharifulgeo
Copy link

I am also facing same problem and with python 3.12 in darwin(mac) os!! Any solution so far?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants