mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
[ZEPPELIN-502] Rename python.path to python and default from /usr/bin/python to python
This commit is contained in:
parent
02d1320bd3
commit
fecaf256ef
3 changed files with 19 additions and 17 deletions
|
|
@ -16,9 +16,11 @@ group: manual
|
|||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>python.path</td>
|
||||
<td>/usr/bin/python</td>
|
||||
<td>Path of the already installed Python binary (could be python2 or python3)</td>
|
||||
<td>python</td>
|
||||
<td>python</td>
|
||||
<td>Path of the already installed Python binary (could be python2 or python3).
|
||||
If python is not in your $PATH you can set the absolute directory (example : /usr/bin/python)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ public class PythonInterpreter extends Interpreter {
|
|||
|
||||
public static final String BOOTSTRAP_PY = "/bootstrap.py";
|
||||
public static final String BOOTSTRAP_INPUT_PY = "/bootstrap_input.py";
|
||||
public static final String PYTHON_PATH = "python.path";
|
||||
public static final String DEFAULT_PYTHON_PATH = "/usr/bin/python";
|
||||
public static final String PYTHON_PATH = "python";
|
||||
public static final String DEFAULT_PYTHON_PATH = "python";
|
||||
private String pythonPath;
|
||||
|
||||
private Integer port;
|
||||
|
|
@ -59,13 +59,13 @@ public class PythonInterpreter extends Interpreter {
|
|||
|
||||
static {
|
||||
Interpreter.register(
|
||||
"python",
|
||||
"python",
|
||||
PythonInterpreter.class.getName(),
|
||||
new InterpreterPropertyBuilder()
|
||||
.add(PYTHON_PATH, DEFAULT_PYTHON_PATH,
|
||||
"Python path. Default : /usr/bin/python")
|
||||
.build()
|
||||
"python",
|
||||
"python",
|
||||
PythonInterpreter.class.getName(),
|
||||
new InterpreterPropertyBuilder()
|
||||
.add(PYTHON_PATH, DEFAULT_PYTHON_PATH,
|
||||
"Python directory. Default : python (assume python is in your $PATH)")
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ public class PythonInterpreter extends Interpreter {
|
|||
|
||||
String output = sendCommandToPython(cmd);
|
||||
return new InterpreterResult(Code.SUCCESS, output.replaceAll(">>>", "")
|
||||
.replaceAll("\\.\\.\\.", "").trim());
|
||||
.replaceAll("\\.\\.\\.", "").trim());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ public class PythonInterpreter extends Interpreter {
|
|||
@Override
|
||||
public Scheduler getScheduler() {
|
||||
return SchedulerFactory.singleton().createOrGetParallelScheduler(
|
||||
PythonInterpreter.class.getName() + this.hashCode(), 10);
|
||||
PythonInterpreter.class.getName() + this.hashCode(), 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -239,7 +239,7 @@ public class PythonInterpreter extends Interpreter {
|
|||
|
||||
BufferedReader bootstrapReader = new BufferedReader(
|
||||
new InputStreamReader(
|
||||
PythonInterpreter.class.getResourceAsStream(file)));
|
||||
PythonInterpreter.class.getResourceAsStream(file)));
|
||||
String line = null;
|
||||
String bootstrapCode = "";
|
||||
while ((line = bootstrapReader.readLine()) != null)
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ def help():
|
|||
print ('<h3>Python 2 & 3 comptability</h3>')
|
||||
print ('<p>The interpreter is compatible with Python 2 & 3.<br/>')
|
||||
print ('To change Python version, ')
|
||||
print ('change in the interpreter configuration the python.path to the ')
|
||||
print ('desired version (example : python.path=/usr/bin/python3)</p>')
|
||||
print ('change in the interpreter configuration the python to the ')
|
||||
print ('desired version (example : python=/usr/bin/python3)</p>')
|
||||
print ('<h3>Python modules</h3>')
|
||||
print ('<p>The interpreter can use all modules already installed ')
|
||||
print ('(with pip, easy_install, etc)</p>')
|
||||
|
|
|
|||
Loading…
Reference in a new issue