我对Mac上不同版本的Python感到非常沮丧。我通常有这么多不同的系统python版本吗?我想知道如何有效地管理它们。
string(3) "pig"
string(3) "man"
takes_two(...$args);
和driverAutoCompleteTextView.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
// If the event is a key-down event on the "enter" button
if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
(keyCode == KeyEvent.KEYCODE_ENTER))
{
// remove focus from driverAutoCompleteTextView
driverAutoCompleteTextView.clearFocus();
// give focus to trailerEditText
trailerEditText.setFocusable(true);
trailerEditText.setFocusableInTouchMode(true);
boolean isFocused = trailerEditText.requestFocus();
Log.d("myTag","isFocused is: "+isFocused);
Log.d("myTag","driver auto complete text view focused: "+driverAutoCompleteTextView.isFocused());
showKeyboard(trailerEditText);
return true;
}
return false;
}
});
private void showKeyboard(View view){
InputMethodManager manager = (InputMethodManager) this.getSystemService(Activity.INPUT_METHOD_SERVICE);
manager.showSoftInput(view,InputMethodManager.SHOW_IMPLICIT);
}
似乎提供了相同的Python 2.7系统版本:
$ which -a python python2 python2.7 python3 python3.6
/Users/anonymous/anaconda3/bin/python
/usr/local/opt/python/libexec/bin/python
/usr/bin/python
/usr/bin/python2.7
/Users/anonymous/anaconda3/bin/python3
/usr/local/bin/python3
/usr/local/bin/python3.6
/usr/bin/python
,/usr/bin/python2.7
和Python 2.7.10 (default, Aug 17 2018, 17:41:52)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)] on darwin
似乎提供了相同的Python 3.6系统版本:
/usr/local/bin/python3
/usr/local/bin/python3.6
和/Users/anonymous/anaconda3/bin/python
似乎提供了相同的Anaconda版本的Python 3.7:
Python 3.6.5 (default, Mar 30 2018, 06:41:49)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
所以我想知道是否真的有几个相同版本的Python的安装?这是应该的吗?如果没有,我该怎么做才能删除冗余?谢谢!
答案 0 :(得分:1)
其中一些引用相同的可执行文件。在大多数系统上,python
被符号链接到同一目录中的python2
或python3
,然后被符号链接到该版本的特定二进制文件,例如python2.7
或{{ 1}}。对于python3.7
文件夹中的文件夹,用户anaconda3
似乎已在其主目录中安装了Anaconda Python发行版。 Anaconda是独立的,通常可以代替或附加于系统python。如果您不将其用于任何用途,则可以安全删除。 anonymous
中的python很可能是通过Homebrew或源代码安装的,或者是来自python.org的二进制安装程序