久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何解決anaconda和virtualenv沖突的問(wèn)題

How to solve the issue of the conflict of anaconda and virtualenv(如何解決anaconda和virtualenv沖突的問(wèn)題)
本文介紹了如何解決anaconda和virtualenv沖突的問(wèn)題的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我一直在使用 virtualenv,然后我還安裝了 anaconda.剛才我嘗試使用source activate helloworld之類的anaconda方式激活虛擬環(huán)境.(事實(shí)上??,我不記得這是否正是我輸入的命令).然后環(huán)境就被激活了.但是當(dāng)我嘗試運(yùn)行筆記本時(shí),有人說(shuō)即使我已經(jīng)在那個(gè)環(huán)境中安裝了一些庫(kù)也不存在.直到那時(shí)我才意識(shí)到我激活了錯(cuò)誤的環(huán)境.然后我關(guān)閉選項(xiàng)卡和 cdhellowworld 并執(zhí)行 source bin/activate.但是為時(shí)已晚.我把它作為輸出 prepending/home/lcc/anaconda3/envs/bin 到 PATH 并且環(huán)境未按預(yù)期激活.你知道如何解決這個(gè)問(wèn)題嗎?謝謝!

I was using virtualenv all the time and then I had also installed anaconda. Just now I tried to activate a virtual environment using the way of anaconda like source activate helloworld. (Indeed I don't remember if this is exactly the command I typed in). And then the environment had been activated. But when I tried to run the notebook, it was said that some libraries didn't exist even if I had installed them already in that environment. Not until then did I realize I had activated the wrong environment. And then I close the tab and cd to hellowworld and did source bin/activate. But it was too late. I got this as the output prepending /home/lcc/anaconda3/envs/bin to PATH and the environment was not activated expectedly. Do you know how to solve this issue? Thanks!

這里是/hello/worldactivate文件的完整內(nèi)容:

Here is the full content of the activate file under /hello/world:

#!/bin/bash

# Determine the directory containing this script
if [[ -n $BASH_VERSION ]]; then
    _SCRIPT_LOCATION=${BASH_SOURCE[0]}
    SHELL="bash"
elif [[ -n $ZSH_VERSION ]]; then
    _SCRIPT_LOCATION=${funcstack[1]}
    SHELL="zsh"
else
    echo "Only bash and zsh are supported"
    return 1
fi
_CONDA_DIR=$(dirname "$_SCRIPT_LOCATION")

if [ $# -gt 1 ]; then
    (>&2 echo "Error: did not expect more than one argument.")
    (>&2 echo "    (Got $@)")
    return 1
fi

case "$(uname -s)" in
    CYGWIN*|MINGW32*|MSYS*)
        EXT=".exe"
        ;;
    *)
        EXT=""
        ;;
esac

# Export whatever PS setting we have, so it is available to Python subprocesses
export PS1

# Ensure that this script is sourced, not executed
# Also note that errors are ignored as `activate foo` doesn't generate a bad
# value for $0 which would cause errors.
if [[ -n $BASH_VERSION ]] && [[ "$(basename "$0" 2> /dev/null)" == "activate" ]]; then
    (>&2 echo "Error: activate must be sourced. Run 'source activate envname'
instead of 'activate envname'.
")
    "$_CONDA_DIR/conda" ..activate $SHELL$EXT -h
    exit 1
fi

"$_CONDA_DIR/conda" ..checkenv $SHELL$EXT "$@"
if (( $? != 0 )); then
    return 1
fi

# Ensure we deactivate any scripts from the old env
#   Note: this empties $@.  Preserve a copy.
args=$@
source "$_CONDA_DIR/deactivate"

_NEW_PATH=$("$_CONDA_DIR/conda" ..activate $SHELL$EXT "$args")
if (( $? == 0 )); then
    export CONDA_PATH_BACKUP="$PATH"
    # export this to restore it upon deactivation
    export CONDA_OLD_PS1=$PS1

    export PATH="$_NEW_PATH"
    # Get first path (should be full path prefix of our env)
    # inner string extraction pulls off first path
    # outer string removes /bin if present (on Unix)
    firstpath=${PATH%%:*}
    export CONDA_DEFAULT_ENV="$(echo ${firstpath} | sed "s|/bin$||")" &>/dev/null
    # Legacy support: CONDA_DEFAULT_ENV used to be either env name or full path if given as path.
    #    CONDA_DEFAULT_ENV is now always full path.
    #    Keep CONDA_ENV_PATH around, and have it mirror CONDA_DEFAULT_ENV.
    #    Last date of change: 2016-04-18
    export CONDA_ENV_PATH=$CONDA_DEFAULT_ENV

    export PS1="$( "$_CONDA_DIR/conda" ..setps1 $SHELL$EXT "$args" )"

    # Load any of the scripts found $PREFIX/etc/conda/activate.d AFTER activation
    _CONDA_D="${CONDA_DEFAULT_ENV}/etc/conda/activate.d"
    if [[ -d "$_CONDA_D" ]]; then
        IFS=$(echo -en "
")&>/dev/null  && for f in $(find "$_CONDA_D" -iname "*.sh"); do source "$f"; done
    fi
else
    return $?
fi

if [[ -n $BASH_VERSION ]]; then
    hash -r
elif [[ -n $ZSH_VERSION ]]; then
    rehash
else
    echo "Only bash and zsh are supported"
    return 1
fi

推薦答案

從您的問(wèn)題中不清楚您希望激活"做什么.是激活 virtualenv,還是激活 conda 環(huán)境.

It's not clear from your question what you expect "activate" to do. Is it activating a virtualenv, or is it activating a conda environment.

安裝 miniconda 或 anaconda 時(shí),您可以選擇將其添加到 PATH.如果你這樣做,那么它可能總是出現(xiàn)在你的 virtualenv 激活腳本之前.您可以重命名一個(gè)或另一個(gè),或?yàn)?virtualenv 創(chuàng)建一個(gè)別名,該別名使用激活腳本的絕對(duì)路徑調(diào)用它.您也可以移動(dòng) Anaconda,使其附加而不是前置,但將始終使用 virtualenv activate 而不是 conda(絕對(duì)路徑除外).

When you install miniconda or anaconda, you are given an option to add it to PATH. If you do so, then it probably always comes before your virtualenv activate script. You can rename one or the other, or create an alias to the virtualenv one that calls it with an absolute path to the activate script. You can also move Anaconda so that it's appended rather than prepended, but then the virtualenv activate will always be used rather than the conda one (barring absolute paths).

要附加 conda 的路徑,請(qǐng)查看 ~/.bashrc 或 ~/.bash_profile 并更改

To append conda's path, look in ~/.bashrc or ~/.bash_profile and change

export PATH=<anaconda path>:$PATH

export PATH=$PATH:<anaconda path>

這篇關(guān)于如何解決anaconda和virtualenv沖突的問(wèn)題的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to install Selenium in a conda environment?(如何在 conda 環(huán)境中安裝 Selenium?)
get the CUDA and CUDNN version on windows with Anaconda installe(使用 Anaconda installe 在 Windows 上獲取 CUDA 和 CUDNN 版本)
How can I download Anaconda for python 3.6(如何下載適用于 python 3.6 的 Anaconda)
Using two different Python Distributions(使用兩個(gè)不同的 Python 發(fā)行版)
How can I install Anaconda aside an existing pyenv installation on OSX?(除了 OSX 上現(xiàn)有的 pyenv 安裝之外,如何安裝 Anaconda?)
Permanently set Python path for Anaconda within Cygwin(在 Cygwin 中為 Anaconda 永久設(shè)置 Python 路徑)
主站蜘蛛池模板: 国产探花在线精品一区二区 | 国产精品一区二区福利视频 | 国产精品jizz在线观看老狼 | 在线天堂免费中文字幕视频 | 淫片专区| 国产成人福利视频在线观看 | 91社区在线观看高清 | 人人干超碰 | 精品福利在线 | 日日摸夜夜爽人人添av | 国产电影一区二区在线观看 | 亚洲精彩视频在线观看 | 做a的各种视频 | 国产精品3区 | 波多野结衣一区二区 | 国产一区二区三区四区 | 国产欧美一区二区三区另类精品 | 夜夜av| 国产精品日日摸夜夜添夜夜av | 久久精品欧美视频 | 国内激情av片 | 一区二区三区日本 | 亚洲欧美日韩在线 | 农村黄性色生活片 | 久久国产精品精品国产色婷婷 | 免费爱爱视频 | 亚洲欧美一区二区三区视频 | 久久精点视频 | 亚洲综合在线一区二区 | 伊人久久精品一区二区三区 | 毛片大全 | 国产精品久久久久久久久久久免费看 | 亚洲精品天堂 | 日韩高清一区 | 日韩一区二区在线视频 | 国产精品一区久久久久 | 国户精品久久久久久久久久久不卡 | 欧美国产日韩精品 | 成人a视频片观看免费 | 日韩av一二三区 | 欧美精品一区二区在线观看 |