简体   繁体   English

如何使pycharm远程执行使用系统环境变量?

[英]How can I make pycharm remote execution use the system environment variables?

I'm using pycharm remote execution to run scripts on a remote server. 我正在使用pycharm远程执行来在远程服务器上运行脚本。 I saw that bash_profile (or other start up scripts) aren't executed - is there a way to make this happen? 我看到bash_profile(或其他启动脚本)没有被执行 - 有没有办法让这种情况发生?

preferably not in 'run configurations' which are needed for each script (I have many scripts) but in a shared configuration 最好不要在每个脚本所需的“运行配置”中(我有很多脚本)但是在共享配置中

The problem isn't actually related with Pycharm. 问题实际上与Pycharm无关。

You must add your environment variable to remote machine ~/.bashrc 您必须将环境变量添加到远程机器〜/ .bashrc

VAR="VALUE"
export VAR

You can read the from Why does an SSH remote command get fewer environment variables then when run manually? 您可以阅读以下内容为什么SSH远程命令会在手动运行时获得更少的环境变量?

if you use Vagrant you can use this too 如果您使用Vagrant,您也可以使用它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM