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

如何更改默認 Anaconda python 環境

How to change default Anaconda python environment(如何更改默認 Anaconda python 環境)
本文介紹了如何更改默認 Anaconda python 環境的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我安裝了 Anaconda 并創建了兩個額外的環境:py3k(包含 Python 3.3)和 py34(包含 Python 3.4).除此之外,我還有一個名為root"的默認環境,Anaconda 安裝程序默認創建該環境并保存 Python 2.7.最后一個是默認設置,每當我從終端啟動ipython"時,它都會給我 2.7 版.為了使用 Python 3.4,我需要發出命令(在 shell 中)

I've installed Anaconda and created two extra environments: py3k (which holds Python 3.3) and py34 (which holds Python 3.4). Besides those, I have a default environment named 'root' which the Anaconda installer created by default and which holds Python 2.7. This last one is the default, whenever I launch 'ipython' from the terminal it gives me version 2.7. In order to work with Python 3.4, I need to issue the commands (in the shell)

source activate py34
ipython

將默認環境更改為 Python 3.4.這很好用,但很煩人,因為我大部分時間都在使用 Python 3.4,而不是 Python 2.7(我持有它是為了教學目的,這是一個相當長的故事).無論如何,我想知道如何將默認環境更改為 Python 3.4,記住我不想從頭開始重新安裝所有內容.

which change the default environment to Python 3.4. This works fine, but it's annoying since most of the time I work on Python 3.4, instead of Python 2.7 (which I hold for teaching purposes, it's a rather long story). Anyway, I'll like to know how to change the default environment to Python 3.4, bearing in mind that I don't want to reinstall everything from scratch.

推薦答案

如果你只是想暫時換個環境,用

If you just want to temporarily change to another environment, use

source activate environment-name

ETA:這可能已被棄用.我相信當前正確的命令是:

ETA: This may be deprecated. I believe the current correct command is:

source conda activate environment-name

(您可以使用 conda create 創建 environment-name)

(you can create environment-name with conda create)

永久更改,除了創建一個運行上述代碼的啟動腳本之外別無他法.

To change permanently, there is no method except creating a startup script that runs the above code.

通常最好只創建新環境.但是,如果你真的想在默認環境下更改 Python 版本,你可以這樣做:

Typically it's best to just create new environments. However, if you really want to change the Python version in the default environment, you can do so as follows:

首先,通過運行確保您擁有最新版本的 conda

First, make sure you have the latest version of conda by running

conda update conda

然后運行

conda install python=3.5

這將嘗試將根環境中的所有包更新到 Python 3 版本.如果不可能(例如,因為某些包不是為 Python 3.5 構建的),它會給您一條錯誤消息,指出是哪個包導致了問題.

This will attempt to update all your packages in your root environment to Python 3 versions. If it is not possible (e.g., because some package is not built for Python 3.5), it will give you an error message indicating which package(s) caused the issue.

如果您使用 pip 安裝軟件包,則必須重新安裝它們.

If you installed packages with pip, you'll have to reinstall them.

這篇關于如何更改默認 Anaconda python 環境的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件時出現問題)
Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按屬性查找所有節點)
Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 響應并將元素值存儲在變量中?)
How to get XML tag value in Python(如何在 Python 中獲取 XML 標記值)
How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正確解析 utf-8 xml?)
Parse XML from URL into python object(將 XML 從 URL 解析為 python 對象)
主站蜘蛛池模板: 一区视频在线免费观看 | 天堂色网 | 精品乱子伦一区二区三区 | 毛片免费看 | 超碰97免费观看 | 中文字幕成人免费视频 | 日韩图区| 超碰日本| 91高清视频在线观看 | 久久伊人一区 | 亚洲国产一区在线 | av网站免费 | 蜜桃免费一区二区三区 | 在线看片网站 | 国产精品久久久久久久久久久免费看 | 99精品国产成人一区二区 | 国产精品一区二区不卡 | 国产ts一区| 韩日精品一区 | 日韩av中文 | 久草视频观看 | 亚洲免费一 | 韩国精品一区二区三区 | 亚洲一区毛片 | 国产一区二区三区在线 | 99热热热热 | 午夜在线电影网 | 国产精品久久久久久久白浊 | 日本在线视频中文字幕 | 在线午夜电影 | 亚洲精品国产偷自在线观看 | 欧美一区二区三区视频在线播放 | 国产亚洲精品a | 伊人二区 | 国产黄色网 | 国产区久久 | 黄网站涩免费蜜桃网站 | 久久精品男人的天堂 | 久久久久久综合 | 亚洲人精品 | 欧美三级视频 |