本文介绍了在哪里使用 virtualenvwrapper-win 定义 postactivate 钩子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 virtualenvwrapper-win 并且想使用 virtualenvwrapper 的 postactivate hook 来设置环境变量.但是,virtualenvwrapper-win 似乎不包含 postactivate 文件,而且我无法通过创建自己的文件来使其工作.有人知道如何让 postactivate 钩子与 virtualenvwrapper-win 一起工作吗?

I'm using virtualenvwrapper-win and want to use the postactivate hook of virtualenvwrapper to set environment variables. However it seems virtualenvwrapper-win doesn't include a postactivate file, and I haven't been able to get it to work by creating my own. Does anybody know how to get the postactivate hook to work with virtualenvwrapper-win?

我想将其包含在 postactivate 中以设置环境变量:SET APP_SETTINGS="example.setting"

I want to include this in postactivate to set an environment variable: SET APP_SETTINGS="example.setting"

推荐答案

其实是我自己解决的.您可以将任何环境变量放在 virtualenv 的 Scripts 文件夹中的 activate.bat 文件中.

I actually solved it myself. You can put any environment variables in the activate.bat file in the Scripts folder of your virtualenv.

这篇关于在哪里使用 virtualenvwrapper-win 定义 postactivate 钩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 13:25