File tree Expand file tree Collapse file tree 3 files changed +13
-54
lines changed Expand file tree Collapse file tree 3 files changed +13
-54
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 77
77
<Compile Include =" Compute\Logging.cs" />
78
78
<Compile Include =" Convert\ToPython.cs" />
79
79
<Compile Include =" Modify\AddQuotesIfRequired.cs" />
80
- <Compile Include =" Create\VirtualEnvironment.cs" />
81
80
<Compile Include =" Query\VirtualEnv.cs" />
82
81
<Compile Include =" Query\VirtualEnvPythonExePath.cs" />
83
82
<Compile Include =" Query\VirtualEnvDirectory.cs" />
102
101
<Private >False</Private >
103
102
</ProjectReference >
104
103
</ItemGroup >
105
- <ItemGroup />
104
+ <ItemGroup >
105
+ <Folder Include =" Create\" />
106
+ </ItemGroup >
106
107
<ItemGroup >
107
108
<Content Include =" Python\src\python_toolkit\bhom\analytics.py" />
108
109
<Content Include =" Python\src\python_toolkit\bhom\anonymise_filepath.py" />
Original file line number Diff line number Diff line change @@ -35,7 +35,16 @@ public static partial class Query
35
35
[ Output ( "The virtual environment, if it exists." ) ]
36
36
public static PythonEnvironment VirtualEnv ( string envName )
37
37
{
38
- return new PythonEnvironment ( ) { Executable = VirtualEnvPythonExePath ( envName ) , Name = envName } ;
38
+ string exePath = Query . VirtualEnvPythonExePath ( envName ) ;
39
+ if ( File . Exists ( exePath ) )
40
+ {
41
+ return new PythonEnvironment ( ) { Name = envName , Executable = exePath } ;
42
+ }
43
+ else
44
+ {
45
+ BH . Engine . Base . Compute . RecordError ( $ "No environment could be found for { envName } . Use the appropriate InstallPythonEnv to install this environment.") ;
46
+ return null ;
47
+ }
39
48
}
40
49
}
41
50
}
You can’t perform that action at this time.
0 commit comments