-
Notifications
You must be signed in to change notification settings - Fork 421
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
Idea: More robust detection of Visual Studio #560
Comments
One possible issue I see is that distutils doesn't support the Microsoft Visual C++ Compiler for Python 2.7. |
https://github.com/jaraco/setuptools/blob/master/setuptools/msvc9_support.py#L29 |
👍 |
+1 we will look into this. The other alternatives raised internally are to use the VS??COMNTOOLS environment variable, and/or the registry. |
This was improved by @patricksnape in #861 |
@msarahan Is this part of the latest release? I'm running
My VS 2015 is installed in a different folder. |
This will be part of the coming release. If you'd like to try a beta: conda install -c conda-team/labels/dev conda-build This will not fix things that are manually installed elsewhere - it just incorporates more of the different standard install locations (for the VS compiler for Python, for example) |
This was actually my main concern, because Visual Studio can be installed virtually anywhere. Mine is at |
Yeah, that's not fixed yet. Sorry. @groutr did some work on that. I'd be happy to review a PR if you want to work on it. This is something that needs fixing, I agree. Unfortunately I can't get to it right now. |
Here is one way to resolve it: def build_vcvarsall_vs_path(version):
"""
Given the Visual Studio version, returns the default path to the
Microsoft Visual Studio vcvarsall.bat file.
Expected versions are of the form {9, 10, 12, 14}
"""
return os.path.join(
os.environ["VS{0}0COMNTOOLS".format(version)],
'..\\..\\VC\\vcvarsall.bat'
) This replaces |
Seems fine. I'll try to work this in. |
Hi there, thank you for your contribution! This issue has been automatically locked because it has not had recent activity after being closed. Please open a new issue if needed. Thanks! |
I'm looking into the source code of
conda_build.windows.msvc_env_cmd()
:https://github.com/conda/conda-build/blob/master/conda_build/windows.py#L56
I've just implemented something similar, not realizing that such functionality already exists in
conda-build
(this is something worth mentioning in the documentation by the way). The only thing that concerns me a bit ismsvc_env_cmd()
assumes that Visual Studio is installed in Program Files rather than getting it from the registry. Perhaps you can refactor that by relying onsetuptools
:This code gives you the full path to
vcvarsall.bat
matching the version of the current Python interpreter and itsplat
argument. The generatedheader
can be inserted inbld.bat
. It needs to be executed using%PYTHON%
to produce correct results as it decides what version of Visual Studio to look for based on the version of the current interpreter.The text was updated successfully, but these errors were encountered: