匿名用户
1级
2017-10-30 回答
你可以看看 venv/bin/activate 文件
一般是和环境变量有关系 PYTHONPATH 或者 是 PATH 有关系
还有一种可能性是你创建虚拟环境的时候指定了某些参数,使用原有的 python
# This file must be used with "source bin/activate" *from bash*# you cannot run it directlydeactivate () { unset pydoc # reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH-}" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH unset _OLD_VIRTUAL_PATH fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME-}" ] ; then
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
export PYTHONHOME unset _OLD_VIRTUAL_PYTHONHOME fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" -o -n "${ZSH_VE