Python error when running gm.py: No module named termios

2,552 views
Skip to first unread message

Osman Zakir

unread,
Nov 28, 2018, 10:41:56 AM11/28/18
to v8-users
When I tried to run gm.py x64.release, I got an ImportError: No module named termios.  I then tried to do pip install termios, but that didn't work (error:  Could not find a version that satisfies the requirement termios (from versions: )
No matching distribution found for termios).  Someone please help me out here.  

Ben Noordhuis

unread,
Nov 28, 2018, 12:59:43 PM11/28/18
to v8-u...@googlegroups.com
On Wed, Nov 28, 2018 at 4:41 PM Osman Zakir <osman...@gmail.com> wrote:
> When I tried to run gm.py x64.release, I got an ImportError: No module named termios. I then tried to do pip install termios, but that didn't work (error: Could not find a version that satisfies the requirement termios (from versions: )
> No matching distribution found for termios). Someone please help me out here.

termios is a core python module, i.e., it's built-in.

gm.py doesn't use it directly but it does use the pty module (another
built-in), which in turn uses termios. pty only works (reliably) on
Linux.

Jakob Kummerow

unread,
Nov 28, 2018, 2:23:50 PM11/28/18
to v8-u...@googlegroups.com
...and gm.py is careful to only use pty on Linux. On other platforms it has the "import" statement but doesn't do anything with it.

What platform (operating system, Python version) is this happening on? In my experience, gm.py works fine with the default Python installations on recent-ish Linux, Mac, and Windows systems. I'd be happy to accept patches to improve compatibility, as long as they're not too intrusive.


--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Osman Zakir

unread,
Nov 28, 2018, 3:08:40 PM11/28/18
to v8-users
I'm using Windows 10.  I have Python version 3.7 as well, but I've put Python 2.7 (which I also have) above it in the PATH so V8 will see it.  

Osman Zakir

unread,
Nov 28, 2018, 6:02:40 PM11/28/18
to v8-users
It's Python 3.5, not 3.7.  But even after I put it as the very first thing in the PATH, whenever I run "python --version", I still get "Python 2.7.15".  Why?  Any idea what I should do?

Osman Zakir

unread,
Nov 30, 2018, 8:42:49 AM11/30/18
to v8-users
I tried to generate project files to build V8 by following the instructions in this blog post on Medium: https://medium.com/dailyjs/how-to-build-v8-on-windows-and-not-go-mad-6347c69aacd4 .  When I ran the command python tools/dev/v8gen.py x64.release as documented there, I got this error:
Hint: You can raise verbosity (-vv) to see the output of failed commands.
Traceback (most recent call last):
  File "tools/dev/v8gen.py", line 304, in <module>
    sys.exit(gen.main())
  File "tools/dev/v8gen.py", line 298, in main
    return self._options.func()
  File "tools/dev/v8gen.py", line 166, in cmd_gen
    gn_outdir,
  File "tools/dev/v8gen.py", line 208, in _call_cmd
    stderr=subprocess.STDOUT,
  File "C:\v8\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['C:\\v8\\depot_tools\\win_tools-2_7_6_bin\\python\\bin\\python.exe', '-u', 'tools\\mb\\mb.py', 'gen', '-f', 'infra\\mb\\mb_config.pyl', '-m', 'developer_default', '-b', 'x64.release', 'out.gn/x64.release']' returned non-zero exit status 1

I need some help here.  Thanks in advance for any replies and help.  I'm using Windows 10 Home, with both Python 2.7 and Python 3.7.  The install of the former is placed higher and then I have the depot_tools higher than that (in the PATH variable). 

Jakob Kummerow

unread,
Dec 4, 2018, 2:43:11 PM12/4/18
to v8-u...@googlegroups.com
If some third-party article or blog post has instructions that don't work, you should probably contact the author of that post.

That said, building V8 on Windows is easy, just follow the instructions on v8.dev. In short: get depot_tools and put them in the path; fetch v8; cd v8; gclient sync; gn gen out\my_dir and adapt build parameters as desired; ninja -C out\my_dir d8

In other news, I can confirm that gm.py currently doesn't work on Windows. I'll fix it. That'll make the last two steps (gn gen + ninja -C) even more convenient.


--

Jakob Kummerow

unread,
Dec 18, 2018, 12:09:07 PM12/18/18
to v8-users
I finally got around to creating and landing this CL: https://chromium-review.googlesource.com/c/v8/v8/+/1382738

gm.py should now work on Windows.
Reply all
Reply to author
Forward
0 new messages