[SERVER-28879] MongoDB failed to build due to ImportError: No module named typing. Created: 20/Apr/17 Updated: 28/Jul/17 Resolved: 28/Jul/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | KarenHuang [X] | Assignee: | Mark Benvenuto |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows Server 2012 R2 + VS2017 RTM + Python 2.7 + SCons 2.5.1 |
||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | Windows | ||||||||
| Participants: | |||||||||
| Description |
|
I tried to build MongoDB with master branch latest revision on Windows. It failed to build due to ImportError: No module named typing. This issue can be repro from revision c776e095 (https://github.com/mongodb/mongo/commit/c776e095ac25d0426624f4a84c03f0094c3c661f). Python module typing is supported from python 3.5. But SCons does not run under Python version 3.5. Python 3 and above are not yet supported. Could you please take a look at this? Thanks! You can repro this issue as the steps below: Error info: |
| Comments |
| Comment by KarenHuang [X] [ 21/Apr/17 ] |
|
Thanks for your quick response! Running command "pip.exe install -r buildscripts\requirements.txt" can install typing module. And this resolved my problem. Thank you again! |
| Comment by Mark Benvenuto [ 20/Apr/17 ] |
|
Yes, I could just import typing and yaml. These are the only two strictly needed, and I do not believe these requirements are going to grow any time soon. This would work as long as scons and the idl compiler use the same version of python. |
| Comment by Bernie Hackett [ 20/Apr/17 ] |
|
It looks like you could attempt to import all necessary modules in idl.py |
| Comment by Bernie Hackett [ 20/Apr/17 ] |
|
Can you import packages during the build process? Most of those requirements aren't actually needed to build the server. You could just try to import typing and re-raise ImportError with a more helpful error message if it's not available. |
| Comment by Mark Benvenuto [ 20/Apr/17 ] |
|
There are a few options: You could runl pip check if pip is installed and the user has a recent version (> 8.0 I believe is the minimum, 1.x does not work). This is also optional site-package. You would then either try to search for the pip executable or try to load the pip program into the current python interpreter. |
| Comment by Andrew Morrow (Inactive) [ 20/Apr/17 ] |
|
mark.benvenuto - Can we look into having SCons at startup probe the python environment for the requirements in the requirements.txt file and give a helpful error if they are not satisfied? |
| Comment by Mark Benvenuto [ 20/Apr/17 ] |
|
We have a python requirements file here: https://github.com/mongodb/mongo/blob/master/buildscripts/requirements.txt You can setup the necessary python modules for building by running: pip.exe install -r buildscripts\requirements.txt Also, please note that only VS 2015 is supported at this time. VS 2017 RTM is not supported by either SCons or the MongoDB source code. |