简体   繁体   English

为什么我的virtualenv继承了系统的旧环境变量?

[英]Why does my virtualenv inherit the system's old environment variables?

When I created my virtual environment, it inherited all of the environment variables that were currently on my Windows machine. 创建虚拟环境时,它继承了Windows计算机上当前存在的所有环境变量。 I have since changed many of those variables, and my virtual environment is now stuck with the old values. 从那以后,我已经更改了许多这些变量,而我的虚拟环境现在被旧值卡住了。 How can I change the environment variables within my virtual environment? 如何在虚拟环境中更改环境变量?

I discovered that the reason my virtual environment's environment variables were keeping their previous values was because I was still in the same terminal session. 我发现我的虚拟环境的环境变量保持其先前值的原因是因为我仍在同一终端会话中。 Restarting my terminal fixed the issue. 重新启动终端可以解决此问题。

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

相关问题 为什么virtualenv从我的shell继承$ PYTHONPATH? - Why does virtualenv inherit $PYTHONPATH from my shell? Python Fabric-在virtualenv的postactivate中读取环境变量 - Python Fabric - read environment variables in virtualenv's postactivate 如何在virtualenv中设置环境变量 - How to set environment variables in virtualenv 为什么GAE python SDK在virtualenv中使用系统的python? - Why is the GAE python SDK using the system's python while in a virtualenv? 为什么清除 Python virtualenv 使用系统 Python 库? - Why does clear Python virtualenv use system Python library? 为什么我的 virtualenv python3 在我的本地机器上工作正常,但当我将 virtualenv 上传到服务器时却不行? - Why does my virtualenv python3 work fine on my local machine but not when I upload the virtualenv to the server? 在virtualenv中设置环境变量(Python,Windows) - Setting environment variables in virtualenv (Python, Windows) Windows中virtualenv / virtualenvwrapper-win中的环境变量 - Environment variables on Windows in virtualenv/virtualenvwrapper-win Fabric:无法在virtualenv中获取环境变量 - Fabric: unable to get environment variables within virtualenv 需要在VirtualEnv会话中重置环境变量 - Needing to Reset Environment Variables in VirtualEnv Session
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM