sudoを実行しているときに私はpython 2.7を取得します。 .bash_profileと.bashrcを元のユーザーとrootから変更しようとしましたが、役に立たなかったのです。sudo pythonが間違っているバージョン
$ python
Python 3.5.2 (default, Oct 11 2016, 05:05:28)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
$ sudo python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
私は両方のユーザーが両方のbashのconfigsでalias python='python3'
をしましたし、それらを調達。
Python 3.5をsudo python
でロードするにはどうすればよいですか?
EDIT:これはOSX EDIT2:私もwhich
のpythonを見てみました。
$ which python
/usr/bin/python
$ sudo which python
/usr/bin/python
try run env | grep PATHと sudo env | grep PATHは出力を見る – Tyler