質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

3回答

4210閲覧

シェルから「python3」が効かなくなってしまった…

hacosato

総合スコア48

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2020/02/24 03:16

編集2020/02/25 15:34

環境構築についてです。シェルから「python3」が効かなくなってしまいました…。
ふだんなら python3 Pythonファイルのパス を指定したら動くのに、 -bash: python3: command not found と出ます。

きのううっかり brew upgrade したのがきっかけのような気がします。

upgradeしたときのログを見ると、下記のように表示されています。

pyenv 1.2.4 -> 1.2.16 python 3.6.5 -> 3.7.6_1

python3 じゃなくて python したら動くのかな? と思ったけどちがうようです…。

$ python -V Python 2.7.16

でした。Python2は使わないけど、OSに最初から入っていたので触らずに置いています。

brewでpython3のlistを見たところ下記の通りでした。
brew list python でも同じ結果でした。

$ brew list python3 /usr/local/Cellar/python/3.6.5/bin/2to3 /usr/local/Cellar/python/3.6.5/bin/2to3-3.6 /usr/local/Cellar/python/3.6.5/bin/easy_install-3.6 /usr/local/Cellar/python/3.6.5/bin/idle3 /usr/local/Cellar/python/3.6.5/bin/idle3.6 /usr/local/Cellar/python/3.6.5/bin/pip3 /usr/local/Cellar/python/3.6.5/bin/pip3.6 /usr/local/Cellar/python/3.6.5/bin/pydoc3 /usr/local/Cellar/python/3.6.5/bin/pydoc3.6 /usr/local/Cellar/python/3.6.5/bin/python3 /usr/local/Cellar/python/3.6.5/bin/python3-config /usr/local/Cellar/python/3.6.5/bin/python3.6 /usr/local/Cellar/python/3.6.5/bin/python3.6-config /usr/local/Cellar/python/3.6.5/bin/python3.6m /usr/local/Cellar/python/3.6.5/bin/python3.6m-config /usr/local/Cellar/python/3.6.5/bin/pyvenv /usr/local/Cellar/python/3.6.5/bin/pyvenv-3.6 /usr/local/Cellar/python/3.6.5/bin/wheel3 /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/ (2787 files) /usr/local/Cellar/python/3.6.5/IDLE 3.app/Contents/ (8 files) /usr/local/Cellar/python/3.6.5/lib/pkgconfig/ (3 files) /usr/local/Cellar/python/3.6.5/libexec/bin/ (7 files) /usr/local/Cellar/python/3.6.5/libexec/pip/ (637 files) /usr/local/Cellar/python/3.6.5/libexec/setuptools/ (339 files) /usr/local/Cellar/python/3.6.5/libexec/wheel/ (49 files) /usr/local/Cellar/python/3.6.5/Python Launcher 3.app/Contents/ (16 files) /usr/local/Cellar/python/3.6.5/share/doc/ (1002 files) /usr/local/Cellar/python/3.6.5/share/man/ (2 files)

また、.bashrcは下記の通りでしたが、変えました。

PATH=$HOME/Users/hacosato/Library/Homebrew/bin:$PATH HOMEBREW_CACHE=$HOME/Users/hacosato/Library/Homebrew/cashe

自分自身の環境でどのようにPythonがインストールされているかもあまり理解できておらずなのですが…アドバイスいただけたらと思います。

macos 10.14.6

追記:

$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
$ brew config HOMEBREW_VERSION: 2.2.6 ORIGIN: https://github.com/Homebrew/brew HEAD: (16進数みたいなやつ) Last commit: 7 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: (16進数みたいなやつ) Core tap last commit: 28 minutes ago HOMEBREW_PREFIX: /usr/local CPU: 16-core 64-bit skylake Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/bin/ruby Clang: 11.0 build 1100 Git: 2.21.0 => /Applications/Xcode.app/Contents/Developer/usr/bin/git Curl: 7.54.0 => /usr/bin/curl macOS: 10.14.6-x86_64 CLT: N/A Xcode: 11.2.1 XQuartz: 2.7.11 => /opt/X11
$ brew info python3 python: stable 3.7.6 (bottled), HEAD Interpreted, interactive, object-oriented programming language https://www.python.org/ /usr/local/Cellar/python/3.6.4_2 (3,809 files, 58.4MB) Poured from bottle on 2018-01-07 at 22:11:55 /usr/local/Cellar/python/3.6.5 (4,872 files, 101.4MB) Poured from bottle on 2018-05-15 at 15:52:39 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb ==> Dependencies Build: pkg-config ✔ Required: gdbm ✔, openssl@1.1 ✔, readline ✔, sqlite ✔, xz ✔ ==> Options --HEAD Install HEAD version ==> Caveats Python has been installed as /usr/local/bin/python3 Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to `python3`, `python3-config`, `pip3` etc., respectively, have been installed into /usr/local/opt/python/libexec/bin You can install Python packages with pip3 install <package> They will install into the site-package directory /usr/local/lib/python3.7/site-packages See: https://docs.brew.sh/Homebrew-and-Python ==> Analytics install: 402,371 (30 days), 1,386,122 (90 days), 5,584,222 (365 days) install-on-request: 210,466 (30 days), 705,025 (90 days), 2,782,130 (365 days) build-error: 0 (30 days)

3.7と3.6が混ざってる…?

追記:

.bashrcは、変更して下記の通りです。

# PATH=$HOME/Library/Homebrew/bin:$PATH # HOMEBREW_CACHE=$HOME/Library/Homebrew/cashe export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
$ brew unlink python3 $ brew install python3

を実行しました。結果は下記の通りです。

$ brew unlink python3 ==> Tapping homebrew/core Cloning into '/Users/hacosato/Library/Homebrew/Library/Taps/homebrew/homebrew-core'... remote: Enumerating objects: 5140, done. remote: Counting objects: 100% (5140/5140), done. remote: Compressing objects: 100% (4939/4939), done. remote: Total 5140 (delta 45), reused 322 (delta 5), pack-reused 0 Receiving objects: 100% (5140/5140), 4.16 MiB | 1.01 MiB/s, done. Resolving deltas: 100% (45/45), done. Error: Invalid formula: /Users/hacosato/Library/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/diesel.rb undefined method `uses_from_macos' for #<Class:0x00007f9757899ae0> Error: Invalid formula: /Users/hacosato/Library/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/h2o.rb undefined method `uses_from_macos' for Formulary::FormulaNamespacec579bc6ee01a64170f1603f5fc3ebbad::H2o:Class (同じエラーが600行ほど) Error: Cannot tap homebrew/core: invalid syntax in tap! Error: Failure while executing: /Users/hacosato/Library/Homebrew/bin/brew tap homebrew/core hacosatonoiMac:~ hacosato$ brew install python3 Initialized empty Git repository in /Users/hacosato/Library/Homebrew/.git/ remote: Enumerating objects: 1967, done. Updating Homebrew...ects: 0% (1/1967) remote: Counting objects: 100% (1967/1967), done. remote: Compressing objects: 100% (1781/1781), done. remote: Total 1967 (delta 201), reused 713 (delta 102), pack-reused 0 Receiving objects: 100% (1967/1967), 2.01 MiB | 1.26 MiB/s, done. Resolving deltas: 100% (201/201), done. From https://github.com/Homebrew/brew * [new branch] master -> origin/master HEAD is now at 575f76a Merge pull request #7074 from dawidd6/log-homebrew-path To restore the stashed changes to /Users/hacosato/Library/Homebrew run: 'cd /Users/hacosato/Library/Homebrew && git stash pop' -e:1:in `<main>': undefined method `canonical_segments' for #<Gem::Version "2.3.7"> (NoMethodError) ==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3.mavericks.bottle.tar.gz Already downloaded: /Users/hacosato/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz ==> Pouring portable-ruby-2.6.3.mavericks.bottle.tar.gz ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics have been recorded yet (or will be during this `brew` run). ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Tapping homebrew/core Cloning into '/Users/hacosato/Library/Homebrew/Library/Taps/homebrew/homebrew-core'... remote: Enumerating objects: 13, done. remote: Counting objects: 100% (13/13), done. remote: Compressing objects: 100% (9/9), done. remote: Total 684812 (delta 6), reused 11 (delta 4), pack-reused 684799 Receiving objects: 100% (684812/684812), 276.87 MiB | 526.00 KiB/s, done. Resolving deltas: 100% (448910/448910), done. Tapped 2 commands and 4922 formulae (5,182 files, 303.7MB). /Users/hacosato/Library/Homebrew/Library/Homebrew/brew.rb:10:in `<main>': Homebrew must be run under Ruby 2.6! You're running 2.3.7. (RuntimeError)

unlinkができていないでしょうか…?

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hoshi-takanori

2020/02/24 03:25

echo $PATH と brew config の結果を貼ってもらってもいいですか?
quickquip

2020/02/24 04:00

自分が使っていたのが、pyenvで入れたPython3なのか、brewで入れたPython3なのか、はたまた別の何かなのか、自分で理解していますか?
hacosato

2020/02/24 13:08

> pyenvで入れたPython3なのか、brewで入れたPython3なのか、はたまた別の何かなのか、 理解しておらずです…。
quickquip

2020/02/24 14:13 編集

だとしたら そもそも質問はなんなのでしょう? という疑問が生じます。 元の環境に戻す方法を他人に聞いているわけじゃないですよね。(元の環境に戻ったのかを認識できないわけですから) まっさらにする方法が知りたい? のでしょうか? そのあたりを質問に追記するとよいかと。
hacosato

2020/02/24 14:18

元のようにPythonが動くようにする方法を知りたいというのが今回の質問の趣旨です。 その途中で、元の環境がどうあったのかや、どういう環境を構築していくべきなのかが俎上に乗ってくると思っています。
quickquip

2020/02/24 14:33

なら質問は「インストールされていると思われるPythonを全部洗い出す方法」ではないでしょうか。 回答者からしたら調べる方法を回答に書くしかなくて、あなたがそれを実行して情報を挙げないとどうしようもない質問です。 試したこととその結果の情報も、個別の回答のコメント欄ではなくて質問の方を編集して載せていった方が効率はいいと思いますよ。
hacosato

2020/02/25 15:34

ありがとうございます! 試した結果を記載しました。
hoshi-takanori

2020/02/25 16:03

なんか brew がおかしくなってますね。とりあえず brew doctor してみてください。その結果を見て考えましょう。ところで python3 を使いたい目的ってなんですか?
hacosato

2020/02/25 16:21

> python3 を使いたい目的 粒度どれぐらいでしょうか…? 趣味で勉強していて、いまはスクレイピングとそこからローカルのデータの簡単な集計や編集。ゆくゆくはそれを元にして統計や機械学習へといったイメージです。 brew doctor長すぎて本文に書けなくなってしまったのでこちらに記載します。 Xcodeを新しくするので合ってますか…? ``` $ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: The following directories do not exist: /Users/hacosato/Library/Homebrew/Cellar /Users/hacosato/Library/Homebrew/Frameworks /Users/hacosato/Library/Homebrew/include /Users/hacosato/Library/Homebrew/lib /Users/hacosato/Library/Homebrew/opt /Users/hacosato/Library/Homebrew/sbin /Users/hacosato/Library/Homebrew/var/homebrew/linked You should create these directories and change their ownership to your account. sudo mkdir -p /Users/hacosato/Library/Homebrew/Cellar /Users/hacosato/Library/Homebrew/Frameworks /Users/hacosato/Library/Homebrew/include /Users/hacosato/Library/Homebrew/lib /Users/hacosato/Library/Homebrew/opt /Users/hacosato/Library/Homebrew/sbin /Users/hacosato/Library/Homebrew/var/homebrew/linked sudo chown -R $(whoami) /Users/hacosato/Library/Homebrew/Cellar /Users/hacosato/Library/Homebrew/Frameworks /Users/hacosato/Library/Homebrew/include /Users/hacosato/Library/Homebrew/lib /Users/hacosato/Library/Homebrew/opt /Users/hacosato/Library/Homebrew/sbin /Users/hacosato/Library/Homebrew/var/homebrew/linked Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected dylibs: /usr/local/lib/libmecab.2.dylib /usr/local/lib/libtcl8.6.dylib /usr/local/lib/libtk8.6.dylib Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/fakemysql.h /usr/local/include/fakepq.h /usr/local/include/fakesql.h /usr/local/include/itcl.h /usr/local/include/itcl2TclOO.h /usr/local/include/itclDecls.h /usr/local/include/itclInt.h /usr/local/include/itclIntDecls.h /usr/local/include/itclMigrate2TclCore.h /usr/local/include/itclTclIntStubsFcn.h /usr/local/include/mecab.h /usr/local/include/mysqlStubs.h /usr/local/include/odbcStubs.h /usr/local/include/pqStubs.h /usr/local/include/tcl.h /usr/local/include/tclDecls.h /usr/local/include/tclOO.h /usr/local/include/tclOODecls.h /usr/local/include/tclPlatDecls.h /usr/local/include/tclThread.h /usr/local/include/tclTomMath.h /usr/local/include/tclTomMathDecls.h /usr/local/include/tdbc.h /usr/local/include/tdbcDecls.h /usr/local/include/tdbcInt.h /usr/local/include/tk.h /usr/local/include/tkDecls.h /usr/local/include/tkPlatDecls.h Warning: Unbrewed .la files were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected .la files: /usr/local/lib/libmecab.la Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected .pc files: /usr/local/lib/pkgconfig/tcl.pc /usr/local/lib/pkgconfig/tk.pc Warning: Unbrewed static libraries were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected static libraries: /usr/local/lib/libmecab.a /usr/local/lib/libtclstub8.6.a /usr/local/lib/libtkstub8.6.a Warning: Your Homebrew's prefix is not /usr/local. Some of Homebrew's bottles (binary packages) can only be used with the default prefix (/usr/local). You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC. You are responsible for resolving any issues you experience while you are running this unsupported configuration. Warning: Xcode alone is not sufficient on Mojave. Install the Command Line Tools: xcode-select --install Warning: Your Xcode (11.2.1) is outdated. Please update to Xcode 11.3 (or delete it). Xcode can be updated from the App Store. ```
hoshi-takanori

2020/02/25 16:56

なるほど。とりあえず pyenv を使う必要はなさそうな気がしますね。というか、まず brew をちゃんと使えるようにになることが先決というか。たぶんネットの記事を鵜呑みにして入れたんだと思いますが、みなさんそれぞれ自分の流儀で書いてるので、自分のやり方に合わせて読み替え・取捨選択が必要なんですが、まぁ初心者には難しいですよね。 で、brew を使う場合も、普通はデフォルトの /usr./local のまま使うことが多いのですが、たまに別の場所に入れたい人もいるようですね。自分が何をしているのかを理解して、ネットの記事を自分の環境に合わせて読み替えられるならいいのですが、普通はデフォルトの設定で使うのが無難だと思います。 というわけで、無茶ぶりになりますが、まずは決断してください。brew で行きますか、それとも pyenv にしますか? また、brew はデフォルトの場所にしますか?
quickquip

2020/02/26 00:22

とりあえず 普通じゃないhomebrewのインストールをしている HomebrewじゃないTcl/Tkをインストールしているっぽい High SierraからMojaveにアップデートしたあとで、Command Line Toolsをインストールし直してないっぽい(本当に起こり得るかは不詳) という雰囲気が見て取れるので High Sierra時代に普通じゃない入れ方をしたHomebrewがそのままの状態でMojaveで動いていた(から整合性がない状態でbrew upgradeが走ってしまった) 可能性が高そう。 と思ったら https://teratail.com/questions/107847 こんなことしてたら間違いなくトラブりそう。
hacosato

2020/02/26 14:09

> brew で行きますか、それとも pyenv にしますか? pyenvだと下記の記事でなんとなく見通しが立つ感じがしています。 https://qiita.com/koooooo/items/b21d87ffe2b56d0c589b brewでpython3使えるようになるほうが良さそうでしょうか? > brew はデフォルトの場所にしますか? とくにこだわりがないので、デフォルトがよいように思っています。 現状のわたしの設定がデフォルトの位置ではなさそうでしょうか…? まずはApp StoreにXcodeの新しいバージョンがいたので、それをダウンロードしています…。 Xcodeアップデートしてみます。
hacosato

2020/02/27 13:28

Xcodeアップデートしました。 brew doctorはこういう感じです。 ``` $ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: The following directories do not exist: /usr/local/sbin You should create these directories and change their ownership to your account. sudo mkdir -p /usr/local/sbin sudo chown -R $(whoami) /usr/local/sbin Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected dylibs: /usr/local/lib/libmecab.2.dylib /usr/local/lib/libtcl8.6.dylib /usr/local/lib/libtk8.6.dylib Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/fakemysql.h /usr/local/include/fakepq.h /usr/local/include/fakesql.h /usr/local/include/itcl.h /usr/local/include/itcl2TclOO.h /usr/local/include/itclDecls.h /usr/local/include/itclInt.h /usr/local/include/itclIntDecls.h /usr/local/include/itclMigrate2TclCore.h /usr/local/include/itclTclIntStubsFcn.h /usr/local/include/mecab.h /usr/local/include/mysqlStubs.h /usr/local/include/odbcStubs.h /usr/local/include/pqStubs.h /usr/local/include/tcl.h /usr/local/include/tclDecls.h /usr/local/include/tclOO.h /usr/local/include/tclOODecls.h /usr/local/include/tclPlatDecls.h /usr/local/include/tclThread.h /usr/local/include/tclTomMath.h /usr/local/include/tclTomMathDecls.h /usr/local/include/tdbc.h /usr/local/include/tdbcDecls.h /usr/local/include/tdbcInt.h /usr/local/include/tk.h /usr/local/include/tkDecls.h /usr/local/include/tkPlatDecls.h Warning: Unbrewed .la files were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected .la files: /usr/local/lib/libmecab.la Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected .pc files: /usr/local/lib/pkgconfig/tcl.pc /usr/local/lib/pkgconfig/tk.pc Warning: Unbrewed static libraries were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected static libraries: /usr/local/lib/libmecab.a /usr/local/lib/libtclstub8.6.a /usr/local/lib/libtkstub8.6.a Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: python r mecab Warning: Xcode alone is not sufficient on Mojave. Install the Command Line Tools: xcode-select --install hacosatonoiMac:~ hacosato$ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: The following directories do not exist: /usr/local/sbin You should create these directories and change their ownership to your account. sudo mkdir -p /usr/local/sbin sudo chown -R $(whoami) /usr/local/sbin Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected dylibs: /usr/local/lib/libmecab.2.dylib /usr/local/lib/libtcl8.6.dylib /usr/local/lib/libtk8.6.dylib Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/fakemysql.h /usr/local/include/fakepq.h /usr/local/include/fakesql.h /usr/local/include/itcl.h /usr/local/include/itcl2TclOO.h /usr/local/include/itclDecls.h /usr/local/include/itclInt.h /usr/local/include/itclIntDecls.h /usr/local/include/itclMigrate2TclCore.h /usr/local/include/itclTclIntStubsFcn.h /usr/local/include/mecab.h /usr/local/include/mysqlStubs.h /usr/local/include/odbcStubs.h /usr/local/include/pqStubs.h /usr/local/include/tcl.h /usr/local/include/tclDecls.h /usr/local/include/tclOO.h /usr/local/include/tclOODecls.h /usr/local/include/tclPlatDecls.h /usr/local/include/tclThread.h /usr/local/include/tclTomMath.h /usr/local/include/tclTomMathDecls.h /usr/local/include/tdbc.h /usr/local/include/tdbcDecls.h /usr/local/include/tdbcInt.h /usr/local/include/tk.h /usr/local/include/tkDecls.h /usr/local/include/tkPlatDecls.h Warning: Unbrewed .la files were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected .la files: /usr/local/lib/libmecab.la Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected .pc files: /usr/local/lib/pkgconfig/tcl.pc /usr/local/lib/pkgconfig/tk.pc Warning: Unbrewed static libraries were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected static libraries: /usr/local/lib/libmecab.a /usr/local/lib/libtclstub8.6.a /usr/local/lib/libtkstub8.6.a Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: python r mecab ``` 最後の警告への対処として、 brew link python とかをやっていくでいいでしょうか?
hoshi-takanori

2020/02/27 21:01

お返事遅くなって失礼しました。 > pyenvだと下記の記事でなんとなく見通しが立つ感じがしています。 お気を悪くされたら申し訳ありませんが、ここで質問されているということは、現在 brew も pyenv もちゃんと使えてないってことですよね。少なくとも私はそう判断したので、まずは brew をちゃんと使えるようにしましょうとご提案申し上げております。 将来的に(例えば一ヶ月後に)pyenv に切り替えても全然構いませんよ。というか、pyenv は独立した環境を作るので、brew の python3 とも共存できると理解しています。 > 現状のわたしの設定がデフォルトの位置ではなさそうでしょうか…? quiqui さんがご指摘のように、https://teratail.com/questions/107847 のベストアンサーで /usr/local 以外にインストールされたのだと思いますが、それはデフォルトの位置ではない場所にインストールする方法になってます。前回 brew doctor した際に > Warning: The following directories do not exist: > /Users/hacosato/Library/Homebrew/Cellar > /Users/hacosato/Library/Homebrew/Frameworks > /Users/hacosato/Library/Homebrew/include > /Users/hacosato/Library/Homebrew/lib > /Users/hacosato/Library/Homebrew/opt > /Users/hacosato/Library/Homebrew/sbin > /Users/hacosato/Library/Homebrew/var/homebrew/linked と表示されていたので、その時はデフォルトの位置ではない場所にインストールした brew を使う設定になってたのだと思いますが、今回の brew doctor では /Users/hacosato/Library/Homebrew というパスは表示されてないので、デフォルトの場所にある brew を使う設定になってるようです。 (ちなみに、どの brew を使うかという設定はシェルの設定ファイルの各種環境変数(主に PATH だけど、たぶん他にもある)で決まります。で、これって試行錯誤でいろいろ書き換えて実験してるとどんどん訳のわからない状況になっていく可能性があるので、ちゃんと一つ一つの意味を理解してやって欲しいです。) > Xcodeアップデートしてみます。 Xcode そのものは普段あまりお使いではないと思うのですが、アップデートしたらとりあえず一度立ち上げると、追加のツールをインストールします。これが brew を動かすために必要だったりするものなので、まだでしたら一度立ち上げるとダイアログが出ますので、その通りにインストールしてください。 brew doctor の結果ですが、 > Warning: The following directories do not exist: > /usr/local/sbin > > You should create these directories and change their ownership to your account. > sudo mkdir -p /usr/local/sbin > sudo chown -R $(whoami) /usr/local/sbin /usr/local/sbin という管理用コマンドを置く場所がないと言ってますね。ここに入るコマンドはあまりないので、そのままでも大丈夫な気もしますが、sudo mkdir -p /usr/local/sbin と sudo chown -R $(whoami) /usr/local/sbin は実行しておいた方が良いでしょう。 (ちなみに、このコマンドが何をするかはご存知でしょうか?) Unexpected XXX files: と言ってるのは、brew の管理下にないファイルが /usr/local の下にあるということです。brew を使うということは /usr/local の下の管理を brew に任せるということなので、それ以外の方法で /usr/local の下に何かをインストールすると brew と衝突する可能性があります。(やってはいけないという意味ではなく、自分が何をしてるのか理解してるなら大丈夫ですが、ネットの記事を盲信して下手なものをインストールすると何が起こるかをよく考える必要があるということです。) あとは xcode-select --install しろとも言ってますね。先ほど書いた「Xcode 起動時にインストールされるもの」とは確か別だったような気がするので、これも実行してみてください。(すでにインストール済みなら already installed と言われるだけなので。)
hacosato

2020/02/27 23:56

> まずは brew をちゃんと使えるようにしましょうとご提案申し上げております。 いえ、どうもありがとうございます。その方針でやってみます。 いま、下記の2個所にHomebrewが入っていると理解しています。 /usr/local/Homebrew /Users/hacosato/Library/Homebrew このうち、後者のHomebrewは https://teratail.com/questions/107847 のときにインストールしたものでした。 .bashrcに下記のように書いていたので、後者のHomebrewが動いていました。 # PATH=$HOME/Library/Homebrew/bin:$PATH # HOMEBREW_CACHE=$HOME/Library/Homebrew/cashe いまはそれをコメントアウトしているので、前者のHomebrewが動いているという認識です。 前者のHomebrew自体は生きてはいるようなので、こちらをきれいにする方針で考えます。 ここまで問題ないでしょうか? > sudo mkdir -p /usr/local/sbin > sudo chown -R $(whoami) /usr/local/sbin これの意味はわかっているつもり(フォルダを作って権限を付与する)です。 コマンドの意味とかは調べてわかるのですが、全体像がいまいちよく見えていない感じがあります。 ここからbrew link pythonなどをやっていくことで、リンク(リンクはいまいちわからない…)されて、HomebrewでPythonが使えるようになると思っています。
hoshi-takanori

2020/02/28 00:36

> ここまで問題ないでしょうか? はい。/Users/hacosato/Library/Homebrew は不要なら消してもいいし、念のために取っておいても構いません。 それから、/usr/local に入れた brew は /usr/local 全体を管理します。/usr/local/Homebrew だけではありませんのでご注意を。 例えば、私の /usr/local は $ ls -ld /usr/local drwxr-xr-x 15 root wheel 480 9 Apr 2019 /usr/local $ ls -l /usr/local total 0 drwxrwxr-x 63 hoshi admin 2016 23 Feb 20:44 Cellar drwxrwxr-x 5 hoshi admin 160 5 Nov 08:23 Frameworks drwxrwxr-x 20 hoshi admin 640 25 Feb 16:34 Homebrew drwxrwxr-x 317 hoshi admin 10144 23 Feb 20:49 bin drwxrwxr-x 25 hoshi admin 800 23 Feb 20:44 etc drwxrwxr-x 97 hoshi admin 3104 23 Feb 20:44 include drwxrwxr-x 215 hoshi admin 6880 23 Feb 20:44 lib drwxr-xr-x 5 root wheel 160 22 Mar 2017 man drwxrwxr-x 80 hoshi admin 2560 23 Feb 20:44 opt drwxr-xr-x 3 root wheel 96 29 Dec 2018 remotedesktop drwxrwxr-x 34 hoshi admin 1088 23 Feb 20:44 share drwxrwxr-x 7 hoshi admin 224 16 Jul 2019 var という状態です。これは /usr/local そのものは root のもの(OS の管理下にある)ですが、所有者が hoshi になってるものは brew の管理下にあります。(/usr/local/man も brew だと思うけど…。) で、例えば /usr/local/sbin ディレクトリを作る場合、ユーザー権限で mkdir すると /usr/local の所有者が root なので失敗します。このために sudo mkdir する必要があって、でもそうすると今度は /usr/local/sbin の所有者が root になるので、それを自分のものにするために sudo chown する、という流れになります。 次に brew link ですが、brew で入れたものは /usr/local/Celler に入ります。例えば python3 なら /usr/local/Cellar/python/3.7.6_1 です。が、そのままでは PATH の設定とか面倒くさいので、/usr/local/bin からシンボリックリンクというものを張っています。例えば、 $ ls -l /usr/local/bin/python3 lrwxr-xr-x 1 hoshi admin 36 2 Jan 07:07 /usr/local/bin/python3 -> ../Cellar/python/3.7.6_1/bin/python3 これは /usr/local/bin/python3 の実体が /usr/local/Cellar/python/3.7.6_1/bin/python3 にあることを意味しています。これによって例えば複数の python3 バージョンを brew で入れておいて切り替えて使うことが可能になります。 で、最初の質問で brew link に関するエラーが出ていたのは、どういうわけかこのリンクが古いバージョンを指していたので、新しいバージョンを指す陸の作成に失敗したということになります。
hoshi-takanori

2020/02/28 00:46

そうだ、次にやるべきことですが、とりあえず brew update した後に brew outdated して、差し支えなければ brew outdated の結果を貼ってください。私は次のようになりました。 $ brew outdated go (1.13.8) < 1.14 imagemagick (7.0.9-23) < 7.0.9-26
hacosato

2020/02/28 04:12

ありがとうございます!! > /Users/hacosato/Library/Homebrew は不要なら消してもいいし、念のために取っておいても構いません。 不要になると思うので消したいですが、消し方がすぐにわからず、あとで考えます。 https://docs.brew.sh/FAQ ここを見るとuninstallの方法が書いてありますが、これだと/usr/local/Homebrewが消えるような気がします…。 > Download the uninstall script and run ./uninstall --help to view more uninstall options. これのやり方をあとで調べます。 /usr/local/sbin は作れました。所有の仕組みも理解しました! $ ls -l /usr/local/Cellar すると、 ``` drwxr-xr-x 4 hacosato admin 128 6 15 2019 python lrwxr-xr-x 1 hacosato admin 6 5 15 2018 python3 -> python ``` このようになっていました。python3からpythonへのシンボリックリンクが張ってある…。 また、 $ ls -l /usr/local/bin には、python3らしきものはありませんでした。 pip、pip3、pyenvなどはありました。 という状態で、 $ brew link python をしたところ、下記のようになりました。 ``` Linking /usr/local/Cellar/python/3.6.5... Error: Could not symlink bin/pip3 Target /usr/local/bin/pip3 already exists. You may want to remove it: rm '/usr/local/bin/pip3' To force the link and overwrite all conflicting files: brew link --overwrite python To list all files that would be deleted: brew link --overwrite --dry-run python ``` 言われていることはなんとなくわかる(pip3を消すか、コンフリクトを上書きするかの選択肢がある)のですが、これはどちらを選んだらよいでしょうか? pip3については下記の通りでした。 $ pip3 --version pip 20.0.2 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
hoshi-takanori

2020/02/28 05:10

・/Users/hacosato/Library/Homebrew をアンインストールするための特別なコマンドは多分ないので、rm -rf /Users/hacosato/Library/Homebrew で消してしまって大丈夫だと思います。 ・/usr/local/Cellar の python3 から python へのシンボリックリンクは、python のデフォルトが 2 だった頃の名残でしょうか。とりあえず消しても大丈夫な気はしますが。 ・pip3 は自分で消してもいいし、overwrite でもいいと思います。また、--dry-run は、実際には何もせずに、何をするかだけを表示するオプションです。 ところでまた大事なことを思い出しました。pip の置き場所から分かるように、python 3.6 と 3.7 ではライブラリの置き場所が違うので、python 3.7 に切り替えたらライブラリは入れなおう必要があります。 ので、3.6 の pip を消す前に、pip3 list して何があるか記録しておくと良いかもです。
hacosato

2020/02/28 07:44

たびたびありがとうございます! $ rm -rf /Users/hacosato/Library/Homebrew 完了しました! $ brew link --overwrite python Linking /usr/local/Cellar/python/3.6.5... 25 symlinks created できました! pip3 listしてみたところ、いろんなライブラリが出てきたあとに警告が出ました。 これは…SSLの認証が通らなかった…? ``` $ pip3 list Package Version ------------------ --------- aiohttp 3.2.1 appnope 0.1.0 asn1crypto 0.24.0 ... WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping ``` とりあえずlinkしてみました。 ``` $ brew link python Warning: Already linked: /usr/local/Cellar/python/3.6.5 ``` もう繋がっているようでした。 ``` $ python -V Python 2.7.16 $ python3 -V Python 3.6.5 ``` 復帰しました…! ありがとうございました! $ brew update したあとで $ brew outdated してみました。 結果は下記の通りです。 ``` gcc (8.1.0) < 9.2.0_3 isl (0.19) < 0.22 jpeg (9c) < 9d oniguruma (6.9.1) < 6.9.4 pcre (8.42) < 8.44 pyenv (1.0.1, 1.2.4) < 1.2.16 python (3.6.4_2, 3.6.5) < 3.7.6_1 r (3.5.0_1) < 3.6.2 ``` python3.6.4は使わないけど、python3ふたつ入っているみたいでした。 /usr/local/Cellar/python/3.6.4_2 ここにいるようです…。
hoshi-takanori

2020/02/28 08:01

pip3 の警告ですが、pip3 が古いせいですね。python3 を最新 (3.7) にすれば pip3 も一緒に更新されるはずですが、副作用も大きいので、余裕ができた時にやればいいともいます。 python3 がふたつ入ってる件は、brew cleanup パッケージ名 でインストールされている最新版以外は消えるはずです。pyenv も2つ入ってるようなので、まず brew cleanup pyenv から試してみては。 他のパッケージの更新とかも、ゆっくりやっていけばいいと思います。brew upgrade だけだと全部まとめて更新されますが、brew upgrade パッケージ名 とすれば特定のパッケージだけ更新できます。 brew は基本的にこまめに brew upgrade して最新版を使おうというコンセプトのツールになりますので、バージョンを固定して使いたい場合は pyenv のようなツールの導入を考えることになると思います。
hacosato

2020/02/28 11:25

$ brew cleanup pyenv したところ、 Warning: Skipping pyenv: most recent version 1.2.16 not installed という警告が出ました。 そこで、 $ brew upgrade pyenv でpyenvが最新にうまくアップデートできたようです。 $ brew cleanup pyenv しても、とくに反応がわからなかったので、 ``` $ brew outdated gcc (8.1.0) < 9.2.0_3 isl (0.19) < 0.22 jpeg (9c) < 9d oniguruma (6.9.1) < 6.9.4 pcre (8.42) < 8.44 python (3.6.4_2, 3.6.5) < 3.7.6_1 r (3.5.0_1) < 3.6.2 ``` うまくいっているみたいです! $ brew cleanup python Warning: Skipping python: most recent version 3.7.6_1 not installed Pythonも同じやり方でいくなら3.7にする必要がありそうですが、 > 副作用も大きいので、余裕ができた時にやればいいともいます。 なにか注意すべきことはあるでしょうか? pip3 listは先ほど書き出したのを控えてあるのでとくに問題ありません。 ほかのひとの環境に合わせて3.6を使わなければならないなどの事情もないので、ふつうにアップデートしてしまって、必要に応じてpipでなにかをインストールしていけばよいでしょうか?
hoshi-takanori

2020/02/28 17:06

> Pythonも同じやり方でいくなら3.7にする必要がありそうですが、 そのようですね。失礼しました。 > ふつうにアップデートしてしまって、必要に応じてpipでなにかをインストールしていけばよいでしょうか? はい、大丈夫だと思います。
hacosato

2020/02/29 14:00

たびたびありがとうございました。 brew upgrade pythonしたところ、下記のようになりました。 Pythonは3.7.6になり、問題なく動いているようです。 下記に重大な問題がなければこの質問は締めようと思っていますがいかがでしょうか? ``` $ brew upgrade python Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae abcm2ps cargo-instruments dust grails libgr qca webpack agda cfengine dvc graphicsmagick libjwt rancid xmake allure clblast erlang i2p man-db ratfor yq angle-grinder cobalt firebase-cli jruby mill serverless zydis appstream-glib consul flyway lapack mongoose shadowenv aws-google-auth dhall folly less ne stress-ng azure-storage-cpp dhall-bash fonttools lesspipe numpy@1.16 tealdeer b3sum dhall-json geoipupdate lft nwchem tmux byteman dhall-lsp-server gmsh libfido2 pastel topgrade camlp5 dps8m gptfdisk libgphoto2 pjproject wasmer ==> Upgrading 1 outdated package: python 3.6.5 -> 3.7.6_1 ==> Upgrading python ==> Downloading https://homebrew.bintray.com/bottles/python-3.7.6_1.mojave.bottle.tar.gz ==> Downloading from https://akamai.bintray.com/64/643d627c2b4fc03a3286c397d299284ef8ce2d4a832737e41175f297d4f0862e?__gda__=exp=15829 ######################################################################## 100.0% ==> Pouring python-3.7.6_1.mojave.bottle.tar.gz ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cel ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cel ==> /usr/local/Cellar/python/3.7.6_1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cel ==> Caveats Python has been installed as /usr/local/bin/python3 Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to `python3`, `python3-config`, `pip3` etc., respectively, have been installed into /usr/local/opt/python/libexec/bin You can install Python packages with pip3 install <package> They will install into the site-package directory /usr/local/lib/python3.7/site-packages See: https://docs.brew.sh/Homebrew-and-Python ==> Summary ???? /usr/local/Cellar/python/3.7.6_1: 3,977 files, 60.8MB Removing: /usr/local/Cellar/python/3.6.4_2... (3,809 files, 58.4MB) Removing: /usr/local/Cellar/python/3.6.5... (4,872 files, 101.4MB) ==> Checking for dependents of upgraded formulae... ==> No dependents found! ```
hoshi-takanori

2020/02/29 14:21

良さそうですね。お疲れさまでした。
hacosato

2020/02/29 14:22

ながらくお付き合いいただき大変ありがとうございました!!
technocore

2020/02/29 14:29

あれ? 結局pyenvでバージョンを切り替える方法はやめちゃったんですね?
guest

回答3

0

ベストアンサー

まず、pyenv と python3 の両方が入ってるようですが、pyenv を使うのであれば python は pyenv で入れることになると思うので、brew で入れる必要はない気がします。ただし、他の brew のパッケージの依存関係で入ることはあり得ますね。(私は pyenv を使ってないので詳しくありませんが。)

次にパスの設定ですが、.bashrc で設定してるはずのものが echo $PATH で表示されてませんね。
PATH=$HOME/Users/hacosato/Library/〜 としてますが、多分 $HOME は /Users/hacosato なので、/Users/hacosato/Library/〜 をパスに入れたいのであれば /Users/hacosato は不要です。というか、brew は /usr/local にあるので、/Users/hacosato/Library/Homebrew/bin をパスに入れる必要がない気がします。(HOMEBREW_CACHE も不要だと思いますが、よく分かりません。)
(また、pyenv を使うのであれば $HOME/.pyenv/shims をパスに入ってるはずだと思いますが…。)

とりあえず brew で入れた python3 を最新版にして使いたいのであれば、いったん python3 を unlink して install し直してみてはいかがでしょうか。

$ brew unlink python3 $ brew install python3

これで成功したら、cleanup で古いバージョンは消せるはずです。

$ brew cleanup python3

投稿2020/02/24 03:56

hoshi-takanori

総合スコア7895

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hacosato

2020/02/25 15:26

ありがとうございます! もともと.bashrc記載してあったぶんはコメントアウトして、 ``` # PATH=$HOME/Library/Homebrew/bin:$PATH # HOMEBREW_CACHE=$HOME/Library/Homebrew/cashe export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi ``` と入れました。 > pyenv と python3 の両方が入ってるようですが、 上記でお話いただいているpython3というのは、brewで入れているということになりますか? pyenvで入っているPythonと、Homebrewで入っているPythonがありそうということでしょうか? ともあれ ``` $ brew unlink python3 $ brew install python3 ``` 上記をシェルから実行しました。うまくいっているのか判断できません…。 結果を質問欄追記に記載します。 > これで成功したら、 成功したかわからず、 ``` $ brew cleanup python3 ``` はまだ実行していません…。
guest

0

>pyenv 1.2.4 -> 1.2.16

pyenvをバージョンアップした時は、
$ pyenv rehash

を実行してください。
これが原因かどうかはわかりませんけど。

それとpyenvでpython3をインストールした場合は
$ python
で良いはずです。

$ which python
/Users/Technocore/.pyenv/shims/python

$ python -V
Python 3.7.6

投稿2020/02/24 03:31

technocore

総合スコア7225

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hacosato

2020/02/24 03:51

pyenv rehash をしましたが、状況変わりませんでした…。 > それとpyenvでpython3をインストールした場合は 前にインストールしたとき手探りだったのでこのあたりがよくわかっておらずです…。 昨日までは「python3」で動かしていました。 $ which python /usr/bin/python $ which python3 は無反応です……。
technocore

2020/02/24 03:55

ログイン時の環境設定はできていますか? あなたが使っているシェルが /bin/bash なら.bash_profile (または.bashrc) /bin/zshなら .zshrc にパスを記述しますが。 export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
hacosato

2020/02/25 14:45

``` export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi ``` 上記を.bashrcに追記しました。が、状況は変わりませんでした。 パスが通っていないのでしょうか…。
technocore

2020/02/25 15:49

あなたの使っているシェルはなんでしょう? $ echo $SHELL で確認してください。 「/bin/bash」と表示されたら「.bash_profile」 「/bin/zsh」と表示されたら「.zprofile」 にその3行を追加して、再ログインしてください。 そしてpyenvが実行できるか確認してください。 $ pyenv -v pyenv 1.2.16
hacosato

2020/02/25 16:24

$ echo $SHELL /bin/bash bashでしたので.bash_profileに記載しました(ファイルなかったので作りました)。 $ pyenv -v pyenv 1.2.4 と出ています!
technocore

2020/02/25 16:38 編集

それでは、pyenvが管理しているpython一覧を表示してみてください。 pyenvで複数のpythonをインストールしていれば以下のように出ます。 $ pyenv versions system 3.6.10 * 3.7.6 (set by /Users/Technocore/.pyenv/version) 3.8.1
hacosato

2020/02/26 13:48

ありがとうございます! ``` $ pyenv versions * system (set by /Users/hacosato/.pyenv/version) ``` こうなりました。 pyenvでインストールされているPythonはシステムの分だけと認識しました。 現状ここまでしかやっていませんが、以降はこのQiitaのとおりでよいでしょうか? https://qiita.com/koooooo/items/b21d87ffe2b56d0c589b bashの設定について質問があります。 上記のQiitaだと.bash_profileの最後の行が ``` eval "$(pyenv init -)" ``` になっています。 わたしが設定しているのは ``` if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi ``` ですが、同じものと捉えていいでしょうか? また、わたしは.bash_profileと.bashrcに同じ内容が入っていますが、.bashrcは消していいでしょうか?(ファイルを残して中身だけ?)
technocore

2020/02/26 14:00

Qiitaのとおりでいいです。 いくつかのバージョンをインストールして、切り替える操作を覚えてください。 >bashの設定について質問 念のため最初のifでpyenvの存在をチェックしています。 安全のため、ifチェックはつけておいてください。 >.bashrcは消していいでしょうか? いきなり消すのは不安なので.bashrc.backup みたいにリネームしておけばいいでしょう。 しばらく使っていて問題がなければ削除すればよいです。 補足ですが、pyenv自体をバージョンアップした時は $ pyenv rehash を実行してください。
guest

0

python3.7 Pythonファイルのパスでどうですか?

投稿2020/02/24 03:19

Nippun

総合スコア1147

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hacosato

2020/02/24 03:20

ありがとうございます! -bash: python3.7: command not found でした……。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問