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

ProgramError when trying to get a 3x3x3 WCA Scramble #4

Closed
fer-hnndz opened this issue Apr 21, 2021 · 4 comments
Closed

ProgramError when trying to get a 3x3x3 WCA Scramble #4

fer-hnndz opened this issue Apr 21, 2021 · 4 comments

Comments

@fer-hnndz
Copy link

Error

>>> from pyTwistyScrambler import scrambler333
>>> scrambler333.get_WCA_scramble()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\site-packages\pyTwistyScrambler\__init__.py", line 8, in trimmed_func
    return func(*args, **kwargs).strip()
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\site-packages\pyTwistyScrambler\scrambler333.py", line 8, in get_WCA_scramble
    return _333_SCRAMBLER.call("scramble_333.getRandomScramble")
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\site-packages\execjs\_abstract_runtime_context.py", line 37, in call
    return self._call(name, *args)
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\site-packages\execjs\_external_runtime.py", line 92, in _call
    return self._eval("{identifier}.apply(this, {args})".format(identifier=identifier, args=args))
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\site-packages\execjs\_external_runtime.py", line 78, in _eval
    return self.exec_(code)
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\site-packages\execjs\_abstract_runtime_context.py", line 18, in exec_
    return self._exec_(source)
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\site-packages\execjs\_external_runtime.py", line 88, in _exec_
    return self._extract_result(output)
  File "C:\Users\A\AppData\Local\Programs\Python\Python39\lib\site-packages\execjs\_external_runtime.py", line 167, in _extract_result
    raise ProgramError(value)
execjs._exceptions.ProgramError: SyntaxError: Expected identifier, string or number

I've read the other issues and I see that reinstalling Node.js is the solution for this. Do I need Node.js to use this library? Because I just know Python lol.

@euphwes
Copy link
Owner

euphwes commented Apr 21, 2021

Hi! Yeah, you'll need a Javascript runtime installed. The Python library is just a wrapper around the underlying JS which does most of the heavy lifting.

Try installing NodeJS if you don't already have it installed. If you do, try reinstalling, that's helped others in the past.

Let me know if that helps!

@fer-hnndz
Copy link
Author

Alright, so I gotta install Javascript and Node.js, also I'm planning to export my code as a .exe file. Will there be any problems with the library once its exported?

@euphwes
Copy link
Owner

euphwes commented Apr 21, 2021

Honestly I've never used a packaging tool that packs Python scripts into executables. I doubt it will package the Javascript runtime with it though. You'll probably need to make sure wherever you're running your script/program has Node.js installed. If you distributing this with an installer, maybe your installer can you also check for and install Node.js?

@fer-hnndz
Copy link
Author

Alright, I'm going to google how to install Node.js and then try exporting it as a .exe to see if it works. Thanks!

I'm closing the issue now.

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