我运行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