<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:4.0pt;
        margin-left:0in;
        font-size:10.0pt;
        font-family:"Tahoma",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Tahoma",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Tahoma",sans-serif;}
.MsoPapDefault
        {mso-style-type:export-only;
        margin-bottom:8.0pt;
        line-height:107%;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’ve been trying to convince Cmake 15.1 to use the python installation in my virtual anaconda environment rather than the anaconda base installation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’m using this to find python:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">set(Python3_FIND_VIRTUALENV "FIRST")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">find_package(Python3 3.6.8 EXACT COMPONENTS Development NumPy)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">First, I’m using Anaconda Prompt to execute the commands. I `activate testenv`, to activate my environment.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">When I then run `cmake .. -G "Visual Studio 14 2015 Win64"`, I get this output:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Selecting Windows SDK version  to target Windows 10.0.16299.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- The C compiler identification is MSVC 19.0.24215.1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe – works<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Detecting C compiler ABI info<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Detecting C compiler ABI info – done<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Detecting C compile features<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Detecting C compile features - done
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Found Git: C:/app/tools/Git/cmd/git.exe (found version "2.17.1.windows.2")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Could NOT find Python3: Found unsuitable version "3.6.4", but required is exact version "3.6.8" (found C:/app/anaconda3/libs/python36.lib)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Configuring done <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Generating done<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-- Build files have been written to: D:/src/project/vsbuild<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I would expect cmake rather to find the python in C:/app/anaconda3/envs/testenv/… since this is the active environment and according to the<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">HINT I set it to be favored over other python installations (as documented in
</span><a href="https://cmake.org/cmake/help/v3.15/module/FindPython3.html">https://cmake.org/cmake/help/v3.15/module/FindPython3.html</a>).<span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Additional info:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">$ which python<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">C:/app/anaconda3/envs/testenv/python.exe<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">$ python –version<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Python 3.6.8 :: Anaconda, Inc.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’m working on Windows 10. Any ideas what is going wrong?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt"><span lang="DE" style="font-size:11.0pt">Kind regards/Viele Grüße<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt"><span lang="DE" style="font-size:11.0pt">Sebastian Müller<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
</div>
</body>
</html>