質問編集履歴
2
`type pyenv`と`pyenv init -`の実行結果の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -216,6 +216,94 @@
|
|
216
216
|
|
217
217
|
|
218
218
|
|
219
|
+
|
220
|
+
|
221
|
+
###`type pyenv`と`pyenv init -`の実行結果
|
222
|
+
|
223
|
+
```
|
224
|
+
|
225
|
+
$ type pyenv
|
226
|
+
|
227
|
+
pyenv is a function
|
228
|
+
|
229
|
+
pyenv ()
|
230
|
+
|
231
|
+
{
|
232
|
+
|
233
|
+
local command;
|
234
|
+
|
235
|
+
command="${1:-}";
|
236
|
+
|
237
|
+
if [ "$#" -gt 0 ]; then
|
238
|
+
|
239
|
+
shift;
|
240
|
+
|
241
|
+
fi;
|
242
|
+
|
243
|
+
case "$command" in
|
244
|
+
|
245
|
+
rehash | shell)
|
246
|
+
|
247
|
+
eval "$(pyenv "sh-$command" "$@")"
|
248
|
+
|
249
|
+
;;
|
250
|
+
|
251
|
+
*)
|
252
|
+
|
253
|
+
command pyenv "$command" "$@"
|
254
|
+
|
255
|
+
;;
|
256
|
+
|
257
|
+
esac
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
$ pyenv init -
|
264
|
+
|
265
|
+
export PATH="/Users/username/.pyenv/shims:${PATH}"
|
266
|
+
|
267
|
+
export PYENV_SHELL=bash
|
268
|
+
|
269
|
+
source '/usr/local/Cellar/pyenv/1.2.13_1/libexec/../completions/pyenv.bash'
|
270
|
+
|
271
|
+
command pyenv rehash 2>/dev/null
|
272
|
+
|
273
|
+
pyenv() {
|
274
|
+
|
275
|
+
local command
|
276
|
+
|
277
|
+
command="${1:-}"
|
278
|
+
|
279
|
+
if [ "$#" -gt 0 ]; then
|
280
|
+
|
281
|
+
shift
|
282
|
+
|
283
|
+
fi
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
case "$command" in
|
288
|
+
|
289
|
+
rehash|shell)
|
290
|
+
|
291
|
+
eval "$(pyenv "sh-$command" "$@")";;
|
292
|
+
|
293
|
+
*)
|
294
|
+
|
295
|
+
command pyenv "$command" "$@";;
|
296
|
+
|
297
|
+
esac
|
298
|
+
|
299
|
+
}
|
300
|
+
|
301
|
+
```
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
219
307
|
### 補足情報(FW/ツールのバージョンなど)
|
220
308
|
|
221
309
|
macOS Catalina バージョン10.15.4
|
1
ご回答を受けて試したことの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -108,6 +108,114 @@
|
|
108
108
|
|
109
109
|
|
110
110
|
|
111
|
+
### ご回答を受けて試したこと
|
112
|
+
|
113
|
+
`~/.bash_profile`を2通りの方法で修正しましたが、pythonとターミナルで打つとPython3で実行することができておらず、検索しても類似の問題が出てこなくて困っている状態です。
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
①`export PATH=/usr/local/bin:$PATH`を`export PATH=$HOME/.pyenv/bin:$PATH`に書き換えた場合
|
118
|
+
|
119
|
+
```bash
|
120
|
+
|
121
|
+
export PYENV_ROOT="$HOME/.pyenv"
|
122
|
+
|
123
|
+
export PATH=$HOME/.pyenv/bin:$PATH
|
124
|
+
|
125
|
+
eval "$(pyenv init -)"
|
126
|
+
|
127
|
+
export PYENV_ROOT=${HOME}/.pyenv
|
128
|
+
|
129
|
+
if [ -d "${PYENV_ROOT}" ]; then
|
130
|
+
|
131
|
+
export PATH=${PYENV_ROOT}/bin:$PATH
|
132
|
+
|
133
|
+
eval "$(pyenv init -)"
|
134
|
+
|
135
|
+
fi
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
export PATH=/usr/lib/postgresql/11.5/bin/:$PATH
|
140
|
+
|
141
|
+
export PATH=$HOME/.nodebrew/current/bin
|
142
|
+
|
143
|
+
export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"# for nodebrew
|
144
|
+
|
145
|
+
export PATH=$HOME/.nodebrew/current/bin:$PATH
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
```
|
150
|
+
|
151
|
+
以下の結果に
|
152
|
+
|
153
|
+
```bash
|
154
|
+
|
155
|
+
$ type python
|
156
|
+
|
157
|
+
python is /usr/bin/python
|
158
|
+
|
159
|
+
$ python -V
|
160
|
+
|
161
|
+
Python 2.7.16
|
162
|
+
|
163
|
+
```
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
②`export PATH=/usr/local/bin:$PATH`に加えて`PATH=$HOME/.pyenv/bin:$PATH`を書き加えた場合
|
168
|
+
|
169
|
+
```bash
|
170
|
+
|
171
|
+
export PYENV_ROOT="$HOME/.pyenv"
|
172
|
+
|
173
|
+
export PATH=/usr/local/bin:$PATH
|
174
|
+
|
175
|
+
PATH=$HOME/.pyenv/bin:$PATH
|
176
|
+
|
177
|
+
eval "$(pyenv init -)"
|
178
|
+
|
179
|
+
export PYENV_ROOT=${HOME}/.pyenv
|
180
|
+
|
181
|
+
if [ -d "${PYENV_ROOT}" ]; then
|
182
|
+
|
183
|
+
export PATH=${PYENV_ROOT}/bin:$PATH
|
184
|
+
|
185
|
+
eval "$(pyenv init -)"
|
186
|
+
|
187
|
+
fi
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
export PATH=/usr/lib/postgresql/11.5/bin/:$PATH
|
192
|
+
|
193
|
+
export PATH=$HOME/.nodebrew/current/bin
|
194
|
+
|
195
|
+
export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"# for nodebrew
|
196
|
+
|
197
|
+
export PATH=$HOME/.nodebrew/current/bin:$PATH
|
198
|
+
|
199
|
+
```
|
200
|
+
|
201
|
+
の場合、以下の結果に
|
202
|
+
|
203
|
+
```bash
|
204
|
+
|
205
|
+
$ type python
|
206
|
+
|
207
|
+
python is hashed (/usr/bin/python)
|
208
|
+
|
209
|
+
$ python -V
|
210
|
+
|
211
|
+
Python 2.7.16
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
```
|
216
|
+
|
217
|
+
|
218
|
+
|
111
219
|
### 補足情報(FW/ツールのバージョンなど)
|
112
220
|
|
113
221
|
macOS Catalina バージョン10.15.4
|