question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile is success, but js2py won't run, ValueError

See original GitHub issue

File “F:\GithubProject\EraTranslatorBuild\Application.dist\js2py\base.py”, line 3011, in <module js2py.base> File “F:\GithubProject\EraTranslatorBuild\Application.dist\js2py\base.py”, line 2990, in define_error_type File “F:\GithubProject\EraTranslatorBuild\Application.dist\js2py\base.py”, line 164, in Js File “F:\GithubProject\EraTranslatorBuild\Application.dist\js2py\base.py”, line 1383, in init File “F:\GithubProject\EraTranslatorBuild\Application.dist\js2py\utils\injector.py”, line 29, in fix_js_args ValueError: TypeError requires closure of length 0, not 1

test python code

import js2py js2py.eval_js(‘console.log( “Hello World!” )’)

compile command python -m nuitka --standalone --follow-imports --plugin-enable=numpy test.py

Error message

Traceback (most recent call last): File “F:\GithubProject\ERATranslateHelper\test.dist\test.py”, line 1, in <module> File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 967, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 668, in _load_unlocked File “<frozen importlib._bootstrap>”, line 638, in load_backward_compatible File "F:\GithubProject\ERATranslateHelper\test.dist\js2py_init.py", line 72, in <module js2py> File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 967, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 668, in _load_unlocked File “<frozen importlib._bootstrap>”, line 638, in _load_backward_compatible File “F:\GithubProject\ERATranslateHelper\test.dist\js2py\base.py”, line 3011, in <module js2py.base> File “F:\GithubProject\ERATranslateHelper\test.dist\js2py\base.py”, line 2990, in define_error_type File “F:\GithubProject\ERATranslateHelper\test.dist\js2py\base.py”, line 164, in Js File “F:\GithubProject\ERATranslateHelper\test.dist\js2py\base.py”, line 1383, in init File “F:\GithubProject\ERATranslateHelper\test.dist\js2py\utils\injector.py”, line 29, in fix_js_args ValueError: TypeError requires closure of length 0, not 1

And I’m using python 3.7.2, with VS studio cpp compiler.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mammothridercommented, May 15, 2019

Add a example

0reactions
junbaibai0719commented, Apr 21, 2022

I got Type Error:arg 5 (closure) expect cell, found compiled_cell. six.get_function_closure return a compiled_cell after compiled,but js2py need a cell, I think the error needs to be solved by the developers of js2py.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can I not run javascript (Js2Py) in Python (Streamlit)?
I am using Streamlit to build a simple app. In this app I made a ... To integrate JS in Python I am...
Read more >
RunCellpose Plugin Installation - Usage & Issues
I can see multiple new plugins have appeared, but alas RunCellPose is not one of them. Any idea how i can fix this?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found