我運行sudo時得到了python 2.7。我試過改變我的.bash_profile和.bashrc從我原來的用戶和根,但無濟於事。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.
>>>
我已經alias python='python3'
在兩個用戶的bash配置和來源。
如何使用python 3.5加載sudo python
?
編輯:這是在OSX 編輯2:我也試過看which
python。
$ which python
/usr/bin/python
$ sudo which python
/usr/bin/python
try run env | grep PATH和 sudo env | grep PATH查看輸出 – Tyler