Visual Studio Python Environment - What are they hiding and where is it?

370 views Asked by At

I am using VS 2017 and I have installed pythonnet. I created a VS project "Python Application". I have other code (C# .NET) I would like to access from this new Python application.

I should be able to: import clr

However, in VS 2017 all works fine. I know for certain it works as not only is the CLR being imported, but I am running the .Net code (can see console outputs). The issue I am having is when I do not run in VS 2017. The purpose of this Python application is to provide demonstration to Python coding colleagues as to how to run the .Net DLLs. Said coders do NOT have Visual Studio, so the "VS Environment" magic that is happening must be done manually (when they install the .Net libs).

If I run directly from cmd or use something else (like notepadd++) I get the ModuleNotFoundError: No module named 'clr'

Where is VS hiding the clr.pyd and Python.Runtime.dll? As I understand it, these files need to be in the run directory but I am not seeing them there. As noted all works fine in VS though so it seems VS is loading those modules for me from somewhere.

0

There are 0 answers