5
Vote

Allow Environment Variable to be set for active python project

description

When I have a C++ Project in my solution (and active), I can right click on the project, go to properties and set the environment variables to be used when invoking that project.

Can we have the same thing for the Python project? We have experimental features that are activated by environment variable, and it'd be nice to not have to change the code or restart visual studio to change these.

This isn't a big deal, but I figured I'd mention it in case it were easy..

Thanks!

comments

dinov wrote Jun 26, 2012 at 9:10 PM

I've always wanted this feature for C# as well :)

This would actually be fairly easy for someone to implement - they just need to add the UI to the DefaultPythonLauncherOptions class and update the launcher to respect these - which should just be updating DefaultPythonLauncher.SetupEnvironment which sets the env vars for both debug and non-debug launches.

tmaslach wrote Aug 10, 2012 at 3:42 PM

I wouldn't mind attempting, but is it possible yet to build using Visual Studio Professional? I heard there was a plan to modularize the code in such a way that Ultimate wasn't always required....

Zooba wrote Aug 10, 2012 at 5:03 PM

Yep, that's done. The Build Instructions page (http://pytools.codeplex.com/wikipage?title=Build%20Instructions%20for%20PTVS) lists the options you have here. The easiest approach will be to switch the build platform to "Minimal" in VS. Then the only prerequisite you'll need is the VS SDK (and the strong name check registry keys in the Prerequisites folder).

pminaev wrote Jul 28, 2013 at 11:12 PM

This is in more demand now that the introduction of mixed-mode debugging made mixed-language solutions more interesting.

moigagoo wrote Oct 2, 2013 at 8:05 PM

Absolutely need this feature.

I store my Django's SECRET_KEY in an environment variable, as well as some other secrets that are not to be shared on a repo.

Please make it possible to set environment variables directly from VS.

Thanks!