Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28881

MongoDB failed to build due to ImportError: No module named typing

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Build
    • Labels:
      None
    • Environment:
      Windows Server 2012 R2 + VS2017 RTM + Python 2.7 + SCons 2.5.1

      Description

      I tried to build Mongodb with master barnch latest revision on Windows. It failed due to ImportError: No module named typing. This issue can be produced form master branch revision c776e095 (https://github.com/mongodb/mongo/commit/c776e095ac25d0426624f4a84c03f0094c3c661f)

      Some investigation on my side:
      It seems that module typing is supported from python 3.5. But SCons does not run under Python version 3.6.1. Python 3 and above are not yet supported. Is there any workaround for this issue? Thanks!

      You can repro the issue as the steps below:
      1. git clone -c core.autocrlf=true https://github.com/mongodb/mongo D:\MongoDB\src
      2. Open a VS 2015 x64 command prompt and browse to D:\MongoDB\src
      3. scons all -j4

      Error info:
      C:\tools\Python2\python.exe buildscripts/idl/idlc.py --base_dir build/opt --header build\opt\mongo\idl\unittest_gen.h --output build\opt\mongo\idl\unittest_gen.cpp src\mongo\idl\unittest.idl
      Traceback (most recent call last):
      File "buildscripts/idl/idlc.py", line 23, in <module>
      import idl.compiler
      File "D:\MongoDB\src\buildscripts\idl\idl\compiler.py", line 26, in <module>
      from typing import Any, List
      ImportError: No module named typing
      scons: *** [build\opt\mongo\idl\unittest_gen.cpp] Error 1

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              KarenHuang2017 KarenHuang [X] (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: