質問編集履歴
4
modfy
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,7 +17,8 @@
|
|
17
17
|
bashに戻してpythonをみたところデフォルトのpythoに戻っています。
|
18
18
|
|
19
19
|
|
20
|
-
そこでAnaconda pytonのpathを~/.bash_profileに書いてsourceしたら以下のエラーが発生しました。
|
20
|
+
~~そこでAnaconda pytonのpathを~/.bash_profileに書いてsourceしたら以下のエラーが発生しました。~~
|
21
|
+
|
21
22
|
```
|
22
23
|
(base) MacBook-Pro:~ $ source ~/.bash_profile
|
23
24
|
-bash: export PATH=/Users/user_name/anaconda3/bin:/usr/local/opt/maven@3.5/bin:/usr/bin:/Users/ruimac/.nodebrew/current/bin:/usr/local/bin:/usr/l
|
3
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -26,6 +26,15 @@
|
|
26
26
|
local/bin:/Users/ruimac/opt/anaconda3/bin:/Users/ruimac/opt/anaconda3/condabin:/Users/ruimac/.pyenv/bin:/usr/local/opt/maven@3.5/bin:/usr/bin:/Users/ruimac/.nodebrew/current/bin:/usr/local/bin:/Users/ruimac/.pyenv/bin:/usr/local/opt/maven@3.5/bin:/usr/bin:/Users/ruimac/.nodebrew/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home: No such file or directory
|
27
27
|
```
|
28
28
|
|
29
|
+
exportの一部に全角空白があったので修正しました。
|
30
|
+
その結果、source ~/.bash_profileは通りました。
|
31
|
+
|
32
|
+
```
|
33
|
+
(base) MacBook-Pro:~ ruimac$ which python
|
34
|
+
/usr/bin/python
|
35
|
+
```
|
36
|
+
anaconda pythonは参照されていません。
|
37
|
+
|
29
38
|
と表示されます。
|
30
39
|
|
31
40
|
### vim ~./bash_profile
|
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -28,6 +28,47 @@
|
|
28
28
|
|
29
29
|
と表示されます。
|
30
30
|
|
31
|
+
### vim ~./bash_profile
|
32
|
+
|
33
|
+
~./bash_profileはこのように記載しました。
|
34
|
+
```
|
35
|
+
|
36
|
+
export PATH=$HOME/.nodebrew/current/bin:$PATH
|
37
|
+
|
38
|
+
|
39
|
+
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
|
40
|
+
|
41
|
+
|
42
|
+
export PATH="/usr/bin:${PATH}:${JAVA_HOME}"
|
43
|
+
|
44
|
+
MAVEN_HOME=/usr/local/opt/maven@3.5
|
45
|
+
export PATH=$MAVEN_HOME/bin:$PATH
|
46
|
+
|
47
|
+
|
48
|
+
# >>> conda initialize >>>
|
49
|
+
# !! Contents within this block are managed by 'conda init' !!
|
50
|
+
__conda_setup="$('/Users/ruimac/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
51
|
+
if [ $? -eq 0 ]; then
|
52
|
+
eval "$__conda_setup"
|
53
|
+
else
|
54
|
+
if [ -f "/Users/ruimac/opt/anaconda3/etc/profile.d/conda.sh" ]; then
|
55
|
+
. "/Users/ruimac/opt/anaconda3/etc/profile.d/conda.sh"
|
56
|
+
else
|
57
|
+
export PATH="/Users/ruimac/opt/anaconda3/bin:$PATH"
|
58
|
+
fi
|
59
|
+
fi
|
60
|
+
unset __conda_setup
|
61
|
+
# <<< conda initialize <<<
|
62
|
+
|
63
|
+
export PATH=/Users/user_name/anaconda3/bin:$PATH
|
64
|
+
```
|
65
|
+
### exportをしたpathの一覧
|
66
|
+
|
67
|
+
](1592ed144d3d0be9e174b156ed1a4356.png)
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
31
72
|
### 質問
|
32
73
|
OS周りで問題があると思うのですが、何から勉強すればいいかわからなくなってしまいました。
|
33
74
|
アドバイスをください。
|
1
全角文字の修正を行いました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,32 +1,33 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
bashでpythonのpathを通したいです。
|
3
|
+
bash環境でpythonのpathを通したいです。
|
4
4
|
|
5
5
|
|
6
6
|
|
7
7
|
### 発生している問題・エラーメッセージ
|
8
|
-
以前にSublime
|
8
|
+
以前にSublime Text2をterminalから利用できるように設定をしました。
|
9
|
-
参照
|
9
|
+
参照:
|
10
10
|
https://reasonable-code.com/sublimetext-terminal/
|
11
11
|
|
12
|
-
シンボリックリンクを設定してそのリンクを参照する場所のpathも
|
12
|
+
シンボリックリンクを設定してそのリンクを参照する場所のpathも(export PATH=/usr/local/bin:$PATH)をbashrcに書き込みしました。
|
13
13
|
しかし、コマンドが見つからないと表示されます。
|
14
14
|
|
15
|
-
そこでヤケクソになって再起動やら
|
15
|
+
そこでヤケクソになって再起動やらzshrcに変更するとかをあまり理解をせず行ってみたのですが、案の定、OSに詳しくないので環境変数を壊してしまいました。
|
16
16
|
|
17
17
|
bashに戻してpythonをみたところデフォルトのpythoに戻っています。
|
18
18
|
|
19
19
|
|
20
|
-
そこで
|
20
|
+
そこでAnaconda pytonのpathを~/.bash_profileに書いてsourceしたら以下のエラーが発生しました。
|
21
21
|
```
|
22
|
+
(base) MacBook-Pro:~ $ source ~/.bash_profile
|
22
|
-
-bash: export PATH=/Users/user_name/anaconda3/bin:/usr/local/opt/maven@3.5/bin:/usr/bin:/Users/
|
23
|
+
-bash: export PATH=/Users/user_name/anaconda3/bin:/usr/local/opt/maven@3.5/bin:/usr/bin:/Users/ruimac/.nodebrew/current/bin:/usr/local/bin:/usr/l
|
23
24
|
|
24
|
-
ocal/opt/maven@3.5/bin:/usr/bin:/Users/
|
25
|
-
local/bin:/Users/
|
25
|
+
ocal/opt/maven@3.5/bin:/usr/bin:/Users/ruimac/.nodebrew/current/bin:/usr/
|
26
|
+
local/bin:/Users/ruimac/opt/anaconda3/bin:/Users/ruimac/opt/anaconda3/condabin:/Users/ruimac/.pyenv/bin:/usr/local/opt/maven@3.5/bin:/usr/bin:/Users/ruimac/.nodebrew/current/bin:/usr/local/bin:/Users/ruimac/.pyenv/bin:/usr/local/opt/maven@3.5/bin:/usr/bin:/Users/ruimac/.nodebrew/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home:/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home: No such file or directory
|
26
27
|
```
|
27
28
|
|
28
29
|
と表示されます。
|
29
30
|
|
30
|
-
###
|
31
|
+
### 質問
|
31
|
-
OS周り
|
32
|
+
OS周りで問題があると思うのですが、何から勉強すればいいかわからなくなってしまいました。
|
32
33
|
アドバイスをください。
|