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

百度翻译出问题,请问下是什么原因啊 #2

Open
bieshuohua503 opened this issue Feb 21, 2023 · 5 comments
Open

百度翻译出问题,请问下是什么原因啊 #2

bieshuohua503 opened this issue Feb 21, 2023 · 5 comments

Comments

@bieshuohua503
Copy link

Traceback (most recent call last):
File ".\pre3.py", line 84, in
main()
File ".\pre3.py", line 78, in main
sign, acs_token = get_sign_and_token(query, gtk, lang)
File ".\pre3.py", line 53, in get_sign_and_token
sign = execjs.compile(baidu_js).call('e', query, gtk)
File "D:\python38\lib\site-packages\execjs_abstract_runtime_context.py", line 37, in call
return self._call(name, *args)
File "D:\python38\lib\site-packages\execjs_external_runtime.py", line 92, in _call
return self.eval("{identifier}.apply(this, {args})".format(identifier=identifier, args=args))
File "D:\python38\lib\site-packages\execjs_external_runtime.py", line 78, in eval
return self.exec
(code)
File "D:\python38\lib\site-packages\execjs_abstract_runtime_context.py", line 18, in exec

return self.exec(source)
File "D:\python38\lib\site-packages\execjs_external_runtime.py", line 88, in exec
return self._extract_result(output)
File "D:\python38\lib\site-packages\execjs_external_runtime.py", line 167, in _extract_result
raise ProgramError(value)
execjs._exceptions.ProgramError: TypeError: 'global' 未定义

@TRHX
Copy link
Collaborator

TRHX commented Mar 31, 2023

node 环境没配好吧

@wwfcnu
Copy link

wwfcnu commented Jun 25, 2023

我也遇到了,请问你解决了吗

@TRHX
Copy link
Collaborator

TRHX commented Jun 25, 2023

我也遇到了,请问你解决了吗

安装好 node,配置好环境

@wwfcnu
Copy link

wwfcnu commented Jun 26, 2023

我也遇到了,请问你解决了吗

安装好 node,配置好环境

我试了有道翻译,没有问题,环境应该没问题

@TRHX
Copy link
Collaborator

TRHX commented Jun 26, 2023

我也遇到了,请问你解决了吗

安装好 node,配置好环境

我试了有道翻译,没有问题,环境应该没问题

项目目录下打印一下 execjs.get().name 看看是不是 Node.js (V8)

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

3 participants