我試圖從虛擬環境中使用全球安裝版Jupyter運行Jupyter筆記本(使用virtualenvwrapper
,因爲我想管理已安裝軟件包的版本)。我不會用什麼來使用Anaconda。如何從虛擬環境中運行全局安裝的Jupyter?
問題是當我在virtualenv中運行jupyter notebook
時,它找不到安裝在env中的軟件包,它只發現全局安裝的軟件包。
如何設置Jupyter以檢查虛擬環境中安裝的軟件包而不是全局?
這裏是我所得到的,當我運行which python
和which jupyter
:
全球:
which python >>> /usr/local/bin/python
which jupyter >>> /usr/local/bin/jupyter
從的virtualenv中:
which python >>> /Users/brianclifton/.virtualenvs/test/bin/python
which jupyter >>> /usr/local/bin/jupyter
運行jupyter notebook
從的virtualenv中:
which python >>> /usr/local/bin/python
which jupyter >>> /usr/local/bin/jupyter
而且,這裏是我的.bash_profile
:
export VISUAL=vim
export EDITOR="$VISUAL"
export PS1="\\[\[\e[38;5;94m\][\u] \[\e[38;5;240m\]\w:\[\e[m\] \$(__git_ps1 '(%s)')$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export PATH=/usr/local/bin/python:/usr/local/bin:$PATH
alias ls='ls -GFh'
alias pserv="python -m SimpleHTTPServer"
alias ipynb="jupyter notebook"
export WORKON_HOME=/Users/brianclifton/.virtualenvs
export PROJECT_HOME=/Users/brianclifton/dev
source /usr/local/bin/virtualenvwrapper.sh
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
alias branch='git rev-parse --abbrev-ref HEAD'
function frameworkpython {
if [[ ! -z "$VIRTUAL_ENV" ]]; then
PYTHONHOME=$VIRTUAL_ENV /usr/local/bin/python "[email protected]"
else
/usr/local/bin/python "[email protected]"
fi
}