配置anaconda環(huán)境(linux)

安裝Anaconda

1.下載
wget https://repo.anaconda.com/archive/Anaconda3-5.0.1-Linux-x86_64.sh

  1. 安裝

在安裝包路徑下執(zhí)行:
bash Anaconda3-5.0.1-Linux-x86_64.sh

安裝過(guò)程中會(huì)需要不斷回車來(lái)閱讀并同意license炒辉。

安裝路徑默認(rèn)為用戶目錄(可以自己指定),最后需要確認(rèn)將路徑加入用戶的.bashrc中泉手。

  1. 編輯.bashrc文件

打開(kāi)文件
vi ~/.bashrc # 編輯 .bashrc

在最后一行加入:
export PATH="$PATH:~/anaconda3/bin"
保存

最后黔寇,立即使路徑生效,需要在用戶目錄下執(zhí)行:(一定不要忘了執(zhí)行)
source ~/.bashrc

  1. 查看conda環(huán)境列表
    conda info --envs

安裝 Astropy 和 IRAF

https://faculty1.coloradocollege.edu/~sburns/courses/18-19/pc362/Anaconda_IRAF_install.html

步驟

換源

  • conda添加源
# 附更換清華鏡像源的方式:
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

# 附加庫(kù):
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

conda config --add channels http://ssb.stsci.edu/astroconda
  • 查看源
    conda config --show
  • 刪除源
conda config --remove channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --remove-key channels # 刪除所有源

安裝

conda create -n iraf27 python=2.7 iraf-all pyraf-all stsci

啟動(dòng)

~$ source activate iraf27
(iraf27) ~$ mkdir iraf
(iraf27) ~$ cd iraf
(iraf27) iraf$ mkiraf
-- creating a new uparm directory
Terminal types: xgterm,xterm,gterm,vt640,vt100,etc.
Enter terminal type [default xterm-256color]: xgterm
A new LOGIN.CL file has been created in the current directory.
You may wish to review and edit this file to change the defaults.
You may also add additional customizations to loginuser.cl

編輯login.cl

# LOGIN.CL -- User login file for the IRAF command language.

# Identify login.cl version (checked in images.cl).
if (defpar ("logver"))
    logver = "IRAF V2.16 March 2012"

set home        = "/home/zy/iraf/"
set imdir       = "./"       # edit!!
set cache       = "U_CACHEDIR"
set uparm       = "home$uparm/"
set userid      = "zy"

# Set the terminal type.  We assume the user has defined this correctly 
# when issuing the MKIRAF and no longer key off the unix TERM to set a
# default.
if (access (".hushiraf") == no)
    print "setting terminal type to xgterm..."
stty xgterm


# Uncomment and edit to change the defaults.
set editor      = vi      # edit!! 設(shè)置編輯器
#set    printer     = lp
#set    pspage      = "letter"
#set    stdimage    = imt800
#set    stdimcur    = stdimage
#set    stdplot     = lw
#set    clobber     = no
#set    imclobber   = no
#set    filewait    = yes
#set    cmbuflen    = 512000
#set    min_lenuserarea = 64000
set imtype      = "fits"    # edit!! 設(shè)置圖像格式
set imextn      = "oif:imh fxf:fits,fit fxb:fxb plf:pl qpf:qp stf:hhh,??h"


# XIMTOOL/DISPLAY stuff.  Set node to the name of your workstation to
# enable remote image display.  The trailing "!" is required.
#set    node        = "my_workstation!"

# CL parameters you mighth want to change.
#ehinit   = "nostandout eol noverify"
#epinit   = "standout showall"
showtype = yes


# Default USER package; extend or modify as you wish.  Note that this can
# be used to call FORTRAN programs from IRAF.

package user

task    $adb $bc $cal $cat $comm $cp $csh $date $dbx $df $diff  = "$foreign"
task    $du $find $finger $ftp $grep $lpq $lprm $ls $mail $make = "$foreign"
task    $man $mon $mv $nm $od $ps $rcp $rlogin $rsh $ruptime    = "$foreign"
task    $rwho $sh $spell $sps $strings $su $telnet $tip $top    = "$foreign"
task    $awk $vi $emacs $w $wc $less $rusers $sync $pwd $gdb    = "$foreign"
task    $more                                                   = "$foreign"   
# edit!!

task    $xc $mkpkg $generic $rtar $wtar $buglog         = "$foreign"
#task   $fc = "$xc -h $* -limfort -lsys -lvops -los"
task    $fc = ("$" // envget("iraf") // "unix/hlib/fc.csh" //
        " -h $* -limfort -lsys -lvops -los")
task    $nbugs = ("$(setenv EDITOR 'buglog -e';" //
        "less -Cqm +G " // envget ("iraf") // "local/bugs.*)")
task    $cls = "$clear;ls"
task    $clw = "$clear;w"
task    $pg = ("$(less -Cqm $*)")

if (access ("home$loginuser.cl"))
    cl < "home$loginuser.cl"
;
keep

# Load the default CL package.  Doing so here allows us to override package
# paths and load personalized packages from our loginuser.cl. 
clpackage


# List any packages you want loaded at login time, ONE PER LINE.
images          # general image operators
plot            # graphics tasks
dataio          # data conversions, import export
lists           # list processing

# The if(deftask...) is needed for V2.9 compatibility.
if (deftask ("proto"))
    proto       # prototype or ad hoc tasks

tv              # image display
utilities       # miscellaneous utilities
noao            # optical astronomy packages
vo              # Virtual Observatory tools
plot

prcache directory
cache   directory page type help

# Print the message of the day.
if (access (".hushiraf"))
    menus = no
else {
    type hlib$motd
}


# Uncomment to initialize the SAMP interface on startup.
if (deftask ("samp") == yes) {
  printf ("Initializing SAMP .... ")
  if (sampHubAccess() == yes) {
     # Enable SAMP messaaging.  Set default handlers that don't require 
     # VO capabilities.
     samp quiet
     samp ("on",                                                >& "dev$null")
#    samp ("handler", "table.load.votable", "tinfo $url",       >& "dev$null")
#    samp ("handler", "image.load.fits", "imstat $url",         >& "dev$null")
     samp noquiet
     print ("on")
  } else 
     print ("No Hub Available\n")
}


# Delete any old MTIO lock (magtape position) files.
if (deftask ("mtclean"))
    mtclean
else
    delete uparm$mt?.lok,uparm$*.wcs verify-

keep

設(shè)置環(huán)境變量

Cl>set terminal=vt100

一些報(bào)錯(cuò)的解決方式

1.conda install 時(shí)出錯(cuò): CondaError: Downloaded bytes did not match Content-Length

  • 方法一
    換源

  • 方法二
    設(shè)置conda下載的timeout斩萌,然后再進(jìn)行嘗試缝裤,如果時(shí)長(zhǎng)不夠可以再設(shè)置大一點(diǎn)。
    conda config --set remote_read_timeout_secs 600.0
    然后運(yùn)行安裝命令
    conda install 包 即可颊郎。

  • 方法三
    從conda的源下載好要安裝的包憋飞,直接采用本地安裝的方式。下載的url再出錯(cuò)的地方有提示:
    url: http://ssb.stsci.edu/astroconda/linux-64/iraf-2.16.UR.1-0.tar.bz2
    離線安裝:
    conda install --offline ./iraf-2.16.UR.1-0.tar.bz2

  1. 啟動(dòng)iraf時(shí)輸入cl報(bào)錯(cuò):/usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

原因:64位系統(tǒng)中安裝了32位程序
解決方法:
yum install glibc.i686

重新安裝以后還有如下類系錯(cuò)誤 再繼續(xù)安裝包
error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
yum install libstdc++.so.6

conda安裝ds9

conda install -c pkgw/label/superseded ds9

jupyter notebook配置

  • 修改jupyter_notebook_config.py
jupyter notebook --generate-config
vi /home/zy/.jupyter/jupyter_notebook_config.py

作如下修改:
c.NotebookApp.allow_root = Ture
c.NotebookApp.notebook_dir = '路徑'

  • 關(guān)聯(lián)Jupyter Notebook和conda的環(huán)境和包——“nb_conda”
    conda install nb_conda
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末姆吭,一起剝皮案震驚了整個(gè)濱河市榛做,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌内狸,老刑警劉巖检眯,帶你破解...
    沈念sama閱讀 218,607評(píng)論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異昆淡,居然都是意外死亡轰传,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,239評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門瘪撇,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人港庄,你說(shuō)我怎么就攤上這事倔既。” “怎么了鹏氧?”我有些...
    開(kāi)封第一講書(shū)人閱讀 164,960評(píng)論 0 355
  • 文/不壞的土叔 我叫張陵渤涌,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我把还,道長(zhǎng)实蓬,這世上最難降的妖魔是什么茸俭? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,750評(píng)論 1 294
  • 正文 為了忘掉前任,我火速辦了婚禮安皱,結(jié)果婚禮上调鬓,老公的妹妹穿的比我還像新娘。我一直安慰自己酌伊,他們只是感情好腾窝,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,764評(píng)論 6 392
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著居砖,像睡著了一般虹脯。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上奏候,一...
    開(kāi)封第一講書(shū)人閱讀 51,604評(píng)論 1 305
  • 那天循集,我揣著相機(jī)與錄音,去河邊找鬼蔗草。 笑死咒彤,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的蕉世。 我是一名探鬼主播蔼紧,決...
    沈念sama閱讀 40,347評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼狠轻!你這毒婦竟也來(lái)了奸例?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 39,253評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤向楼,失蹤者是張志新(化名)和其女友劉穎查吊,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體湖蜕,經(jīng)...
    沈念sama閱讀 45,702評(píng)論 1 315
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡逻卖,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,893評(píng)論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了昭抒。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片评也。...
    茶點(diǎn)故事閱讀 40,015評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖灭返,靈堂內(nèi)的尸體忽然破棺而出盗迟,到底是詐尸還是另有隱情,我是刑警寧澤熙含,帶...
    沈念sama閱讀 35,734評(píng)論 5 346
  • 正文 年R本政府宣布罚缕,位于F島的核電站,受9級(jí)特大地震影響怎静,放射性物質(zhì)發(fā)生泄漏邮弹。R本人自食惡果不足惜黔衡,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,352評(píng)論 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望腌乡。 院中可真熱鬧盟劫,春花似錦、人聲如沸导饲。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,934評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)渣锦。三九已至硝岗,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間袋毙,已是汗流浹背型檀。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 33,052評(píng)論 1 270
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留听盖,地道東北人胀溺。 一個(gè)月前我還...
    沈念sama閱讀 48,216評(píng)論 3 371
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像皆看,于是被迫代替她去往敵國(guó)和親仓坞。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,969評(píng)論 2 355