-
Notifications
You must be signed in to change notification settings - Fork 0
/
reinstall-julia.html
210 lines (190 loc) Β· 19.2 KB
/
reinstall-julia.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="en">
<head>
<title>Reinstall Julia - You don't need to prove this</title>
<link href="https://newptcai.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="You don't need to prove this Full Atom Feed" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/w3.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/style.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/jqcloud.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/all.min.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/shariff.min.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/pygments-highlight-github.css">
<!-- JavaScript -->
<script src="https://newptcai.github.io/theme/js/jquery-3.5.1.min.js"></script>
<script src="https://newptcai.github.io/theme/js/jqcloud.min.js"></script>
<!-- Meta -->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="HandheldFriendly" content="True" />
<meta name="author" content="Xing Shi Cai" />
<meta name="description" content="A couple of days ago, I found that I could not install and compile ArbNumerics.jl. The only options is β¦" />
<meta name="keywords" content="programming, Julia">
<!-- Facebook OpenGraph -->
<meta property="og:site_name" content="You don't need to prove this">
<meta property="og:title" content="Reinstall Julia - You don't need to prove this" />
<meta property="og:description" content="A couple of days ago, I found that I could not install and compile ArbNumerics.jl. The only options is β¦" />
<meta property="og:image" content="https://newptcai.github.io">
<meta property="og:type" content="article" />
<meta property="og:url" content="https://newptcai.github.io/reinstall-julia.html" />
<meta property="og:locale" content="de_DE" />
<meta property="og:locale:alternate" content="en_US" />
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Reinstall Julia - You don't need to prove this">
<meta name="twitter:description" content="A couple of days ago, I found that I could not install and compile ArbNumerics.jl. The only options is β¦">
<meta name="twitter:image" content="https://newptcai.github.io">
</head>
<body>
<div class="w3-row w3-card w3-white">
<header id=banner>
<!-- AUTHOR INITIALS-->
<a href="https://newptcai.github.io" id=logo title="Home">XS</a>
<nav id="menu">
<ul>
<li><a href="https://newptcai.github.io/pages/research.html">Research</a></li>
<li><a href="https://newptcai.github.io/pages/teaching.html">Teaching</a></li>
<li class="active"><a href="https://newptcai.github.io/category/math.html">math</a></li>
<li ><a href="https://newptcai.github.io/category/mumble.html">mumble</a></li>
<li ><a href="https://newptcai.github.io/category/photo.html">photo</a></li>
</ul>
</nav>
</header>
</div>
<br>
<article>
<header class="w3-container col-main">
<h1>Reinstall Julia</h1>
<div class="post-info">
<div class="w3-opacity w3-margin-right w3-margin-bottom" style="flex-grow: 1;">
<span> Posted on Sun 24 May 2020 in <a href="https://newptcai.github.io/category/math.html" style="font-style: italic">math</a>
</span>
</div>
<div id="article-tags">
<span class="w3-tag w3-light-grey w3-text-red w3-hover-red">
<a href="https://newptcai.github.io/tag/programming.html" title=" All posts about Programming
">#programming</a>
</span>
<span class="w3-tag w3-light-grey w3-text-red w3-hover-red">
<a href="https://newptcai.github.io/tag/julia.html" title=" All posts about Julia
">#Julia</a>
</span>
</div>
</div>
</header>
<br>
<div class="col-main w3-container">
<main id="article-content">
<p>A couple of days ago, I found that I <a href="https://github.com/JeffreySarnoff/ArbNumerics.jl/issues/41">could not install and compile
<code>ArbNumerics.jl</code></a>. The only options is to reinstall Julia. Fortunately, this is quite easy.</p>
<p>To be extra cautious, I started with a backup of the whole <code>~/.julia</code>. Start a terminal by typing</p>
<div class="highlight"><pre><span></span><code>cp -r ~/.julia/ ~/Downloads/
</code></pre></div>
<p>Then I removed <code>~/.julia</code> without mercy πΏ.</p>
<div class="highlight"><pre><span></span><code>rm -rf ~/.julia/
</code></pre></div>
<p>This means all my previously installed Julia packages are now gone, but Julia itself (the binary and
core packages) are still there.</p>
<p>Most of my project has its own environment. In other words, there are two files <code>Project.toml</code> and
<code>Manifest.tomal</code> in the directory containing an environment. For example, to play with <code>Weave.jl</code>, I
have an environment in <code>~/Work/weave</code>. The content of <code>Project.toml</code> is quite simple,
which just indicates that this environment needs three dependencies <code>DSP</code>, <code>Plots</code> and <code>Weave</code>.</p>
<div class="highlight"><pre><span></span><code><span class="k">[deps]</span>
<span class="n">DSP</span> <span class="o">=</span> <span class="s">"717857b8-e6f2-59f4-9121-6e50c889abd2"</span>
<span class="n">Plots</span> <span class="o">=</span> <span class="s">"91a5bcdd-55d7-5caf-9e0b-520d859cae80"</span>
<span class="n">Weave</span> <span class="o">=</span> <span class="s">"44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"</span>
</code></pre></div>
<p>The content of <code>Manifest.toml</code> is a bit more complicated. The first few lines of it are like this.</p>
<div class="highlight"><pre><span></span><code><span class="c1"># This file is machine-generated - editing it directly is not advised</span>
<span class="k">[[AbstractFFTs]]</span>
<span class="n">deps</span> <span class="o">=</span> <span class="k">["LinearAlgebra"]</span>
<span class="n">git-tree-sha1</span> <span class="o">=</span> <span class="s">"051c95d6836228d120f5f4b984dd5aba1624f716"</span>
<span class="n">uuid</span> <span class="o">=</span> <span class="s">"621f4979-c628-5d54-868e-fcf4e3e8185c"</span>
<span class="n">version</span> <span class="o">=</span> <span class="s">"0.5.0"</span>
<span class="k">[[Base64]]</span>
<span class="n">uuid</span> <span class="o">=</span> <span class="s">"2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"</span>
</code></pre></div>
<p>What it does, is to indicate what exact packages are installed the last time I modified the
environment. </p>
<p>These two files allow me to install all the packages needed to run this environment. I can simply to
launch Julia <code>REPL</code> in the directly where the environment is, <code>active</code> the environment, and run the command
<code>instantiate</code>.</p>
<div class="highlight"><pre><span></span><code><span class="p">(</span><span class="nd">@v1</span><span class="o">.</span><span class="mi">4</span><span class="p">)</span> <span class="n">pkg</span><span class="o">></span> <span class="n">activate</span> <span class="o">.</span> <span class="c"># press ] to get the pkg prompt</span>
<span class="n">Activating</span> <span class="n">environment</span> <span class="n">at</span> <span class="sb">`~/Work/weave/Project.toml`</span>
<span class="p">(</span><span class="n">weave</span><span class="p">)</span> <span class="n">pkg</span><span class="o">></span> <span class="n">st</span>
<span class="n">Status</span> <span class="sb">`~/Work/weave/Project.toml`</span>
<span class="n">β</span> <span class="p">[</span><span class="mi">717857</span><span class="n">b8</span><span class="p">]</span> <span class="n">DSP</span> <span class="n">v0</span><span class="o">.</span><span class="mf">6.6</span>
<span class="p">[</span><span class="mi">91</span><span class="n">a5bcdd</span><span class="p">]</span> <span class="n">Plots</span> <span class="n">v1</span><span class="o">.</span><span class="mf">2.4</span>
<span class="n">β</span> <span class="p">[</span><span class="mi">44</span><span class="n">d3d7a6</span><span class="p">]</span> <span class="n">Weave</span> <span class="n">v0</span><span class="o">.</span><span class="mf">9.4</span>
<span class="n">β</span> <span class="n">Warning</span><span class="o">:</span> <span class="n">Some</span> <span class="n">packages</span> <span class="p">(</span><span class="n">indicated</span> <span class="n">with</span> <span class="n">a</span> <span class="n">red</span> <span class="n">arrow</span><span class="p">)</span> <span class="n">are</span> <span class="n">not</span> <span class="n">downloaded</span><span class="p">,</span> <span class="n">use</span> <span class="sb">`instantiate`</span> <span class="n">to</span> <span class="n">instantiate</span> <span class="n">the</span> <span class="n">current</span> <span class="n">environment</span>
<span class="n">β</span> <span class="err">@</span> <span class="n">Pkg</span><span class="o">.</span><span class="kt">Display</span> <span class="o">/</span><span class="n">buildworker</span><span class="o">/</span><span class="n">worker</span><span class="o">/</span><span class="n">package_linux64</span><span class="o">/</span><span class="n">build</span><span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">julia</span><span class="o">/</span><span class="n">stdlib</span><span class="o">/</span><span class="n">v1</span><span class="o">.</span><span class="mi">4</span><span class="o">/</span><span class="n">Pkg</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="kt">Display</span><span class="o">.</span><span class="n">jl</span><span class="o">:</span><span class="mi">238</span>
<span class="p">(</span><span class="n">weave</span><span class="p">)</span> <span class="n">pkg</span><span class="o">></span> <span class="n">instantiate</span>
<span class="n">Updating</span> <span class="n">registry</span> <span class="n">at</span> <span class="sb">`~/.julia/registries/General`</span>
<span class="n">Updating</span> <span class="n">git</span><span class="o">-</span><span class="n">repo</span> <span class="sb">`https://github.com/JuliaRegistries/General.git`</span>
<span class="n">Installed</span> <span class="n">AbstractFFTs</span> <span class="n">ββββββββββββββββ</span> <span class="n">v0</span><span class="o">.</span><span class="mf">5.0</span>
<span class="n">Installed</span> <span class="n">Parsers</span> <span class="n">βββββββββββββββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">0.3</span>
<span class="n">Installed</span> <span class="n">Tables</span> <span class="n">ββββββββββββββββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">0.4</span>
<span class="n">Installed</span> <span class="n">SpecialFunctions</span> <span class="n">ββββββββββββ</span> <span class="n">v0</span><span class="o">.</span><span class="mf">10.0</span>
<span class="n">Installed</span> <span class="n">Weave</span> <span class="n">βββββββββββββββββββββββ</span> <span class="n">v0</span><span class="o">.</span><span class="mf">9.4</span>
<span class="n">Installed</span> <span class="n">DataStructures</span> <span class="n">ββββββββββββββ</span> <span class="n">v0</span><span class="o">.</span><span class="mf">17.15</span>
<span class="n">Installed</span> <span class="n">Plots</span> <span class="n">βββββββββββββββββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">2.4</span>
<span class="n">Installed</span> <span class="n">DSP</span> <span class="n">βββββββββββββββββββββββββ</span> <span class="n">v0</span><span class="o">.</span><span class="mf">6.6</span>
<span class="n">Installed</span> <span class="n">IteratorInterfaceExtensions</span> <span class="n">β</span> <span class="n">v1</span><span class="o">.</span><span class="mf">0.0</span>
<span class="n">Installed</span> <span class="n">TableTraits</span> <span class="n">βββββββββββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">0.0</span>
<span class="n">Installed</span> <span class="n">PlotUtils</span> <span class="n">βββββββββββββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">0.2</span>
<span class="n">Installed</span> <span class="n">Mustache</span> <span class="n">ββββββββββββββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">0.2</span>
<span class="n">Installed</span> <span class="n">DataValueInterfaces</span> <span class="n">βββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">0.0</span>
<span class="n">Installed</span> <span class="n">FFTW</span> <span class="n">ββββββββββββββββββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">2.1</span>
<span class="n">Installed</span> <span class="n">IntelOpenMP_jll</span> <span class="n">βββββββββββββ</span> <span class="n">v2018</span><span class="o">.</span><span class="mf">0.3</span><span class="o">+</span><span class="mi">0</span>
<span class="n">Installed</span> <span class="n">Polynomials</span> <span class="n">βββββββββββββββββ</span> <span class="n">v0</span><span class="o">.</span><span class="mf">8.0</span>
<span class="n">Installed</span> <span class="n">IterTools</span> <span class="n">βββββββββββββββββββ</span> <span class="n">v1</span><span class="o">.</span><span class="mf">3.0</span>
<span class="n">Installed</span> <span class="n">FFTW_jll</span> <span class="n">ββββββββββββββββββββ</span> <span class="n">v3</span><span class="o">.</span><span class="mf">3.9</span><span class="o">+</span><span class="mi">5</span>
<span class="n">Installed</span> <span class="n">MKL_jll</span> <span class="n">βββββββββββββββββββββ</span> <span class="n">v2019</span><span class="o">.</span><span class="mf">0.117</span><span class="o">+</span><span class="mi">2</span>
<span class="n">Installed</span> <span class="n">YAML</span> <span class="n">ββββββββββββββββββββββββ</span> <span class="n">v0</span><span class="o">.</span><span class="mf">4.0</span>
<span class="n">Building</span> <span class="n">Plots</span> <span class="n">β</span> <span class="sb">`~/.julia/packages/Plots/zOV0T/deps/build.log`</span>
<span class="n">Building</span> <span class="n">FFTW</span> <span class="n">ββ</span> <span class="sb">`~/.julia/packages/FFTW/5DZuu/deps/build.log`</span>
<span class="n">Downloading</span> <span class="n">artifact</span><span class="o">:</span> <span class="n">IntelOpenMP</span>
<span class="c">######################################################################## 100.0%##O=# # Downloading artifact: FFTW</span>
<span class="c">######################################################################## 100.0%##O=# # </span>
</code></pre></div>
<p>To test, I load <code>Weave</code> into the <code>REPL</code>.</p>
<div class="highlight"><pre><span></span><code><span class="n">julia</span><span class="o">></span> <span class="k">using</span> <span class="n">Weave</span>
<span class="p">[</span> <span class="n">Info</span><span class="o">:</span> <span class="n">Precompiling</span> <span class="n">Weave</span> <span class="p">[</span><span class="mi">44</span><span class="n">d3d7a6</span><span class="o">-</span><span class="mi">8</span><span class="n">a23</span><span class="o">-</span><span class="mi">5</span><span class="n">bf8</span><span class="o">-</span><span class="mi">98</span><span class="n">c5</span><span class="o">-</span><span class="n">b353f8df5ec9</span><span class="p">]</span>
</code></pre></div>
<p>Everything seems to be fine. π</p>
<p>Now if you check, you will see a <code>~/.julia</code> has been recreated.</p>
<div class="highlight"><pre><span></span><code><span class="n">shell</span><span class="o">></span> <span class="n">ls</span> <span class="o">~/.</span><span class="n">julia</span> <span class="c"># Press ; to get shell prompt</span>
<span class="n">artifacts</span> <span class="n">compiled</span> <span class="n">conda</span> <span class="n">environments</span> <span class="n">logs</span> <span class="n">packages</span> <span class="n">prefs</span> <span class="n">registries</span>
</code></pre></div>
<p>So one last thing is to do is to restore my <code>config</code> folder by.</p>
<div class="highlight"><pre><span></span><code><span class="n">shell</span><span class="o">></span> <span class="n">cp</span> <span class="o">-</span><span class="n">r</span> <span class="o">~/</span><span class="n">Downloads</span><span class="o">/.</span><span class="n">julia</span><span class="o">/</span><span class="n">config</span><span class="o">/</span> <span class="o">~/.</span><span class="n">julia</span>
</code></pre></div>
<p>and remove the backup</p>
<div class="highlight"><pre><span></span><code><span class="n">shell</span><span class="o">></span> <span class="n">rm</span> <span class="o">-</span><span class="n">rf</span> <span class="o">~/</span><span class="n">Downloads</span><span class="o">/.</span><span class="n">julia</span><span class="o">/</span><span class="n">config</span><span class="o">/</span>
</code></pre></div>
</main>
<br>
<footer>
<div class="adjust-width">
<div id="author-block" class="w3-light-grey w3-border">
<img style="width: 35px; height: 56px; margin-left:50px;" src="https://newptcai.github.io/theme/images/bookmark-red.png" alt="bookmark"></img>
<div id="author-info">
<a href="https://newptcai.github.io/authors.html#xing-shi-cai"><img
style="width: 60px; height: 60px;" src="https://newptcai.github.io/authors/xing-shi-cai.png" onerror="this.src='https://newptcai.github.io/theme/images/avatar.png'"></img>
</a>
<div style="margin-left: 20px; margin-top: 15px;">
<a href="https://newptcai.github.io/authors.html#xing-shi-cai"><span id="author-name" class="w3-hover-text-dark-grey">Xing Shi Cai</span></a>
<p id="author-story" style="max-width: 500px;"></p>
</div>
</div>
</div>
</div>
<br>
</footer>
</div>
</article>
<br>
<script src="https://newptcai.github.io/theme/js/shariff.min.js"></script>
</body>
</html>