python переводчик не работает в zeppelin в windows - PullRequest
0 голосов
/ 06 января 2020

Я пытаюсь заставить этого python и pyspark intepreter работать в zeppelin в windows среде. После установки zeppelin в windows я попробовал этот код, и это сработало.

import org.apache.commons.io.IOUtils
import java.net.URL
import java.nio.charset.Charset

// Zeppelin creates and injects sc (SparkContext) and sqlContext (HiveContext or SqlContext)
// So you don't need create them manually

// load bank data
val jcrExtract = sc.parallelize(
    IOUtils.toString(
        new URL("file:///Users/to125007/Activities/Software/zeppelin-0.8.1-bin-all/Extract_short.csv"),
        Charset.forName("utf8")).split("\n"))

case class Jcr(Department: String, Work_Package: String, Large_Work_Package: String, Supplier: String, Reference: String, Origin: String, Author: String, State: String)

val jcr_df = jcrExtract.map(s => s.split(",")).filter(s => s(0) != "Department").map(
    s => Jcr(s(0), 
            s(1),
            s(2),
            s(3),
            s(4),
            s(5),
            s(6),
            s(7).trim()
        )
).toDF()
jcr_df.registerTempTable("Jcr")
}

Однако, когда я использовал интерпретатор% python и выполнил приведенный ниже блок кода, он ничего не показывает. Я ожидал график, как видно из учебника.

%python
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])

Ничего не могу понять из журнала.


DEBUG [2020-01-06 12:34:23,685] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) - DEBUG [2020-01-06 12:34:23,685] ({pool-2-thread-2} Interpreter.java[getProperty]:229) - key: zeppelin.py4j.useAuth, value: false
DEBUG [2020-01-06 12:34:23,711] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:23,711] ({pool-2-thread-2} IPythonInterpreter.java[setupIPythonEnv]:319) - PYTHONPATH:C:\Users\to125007\Activities\Software\zeppelin-0.8.1-bin-all\interpreter/python/py4j-0.9.2/src
DEBUG [2020-01-06 12:34:25,185] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:25,185] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:25,288] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:25,288] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:25,433] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:25,433] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:25,572] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:25,572] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:25,701] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:25,701] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:25,848] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:25,847] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:25,995] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:25,994] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,132] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,131] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,236] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,236] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,338] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,338] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,440] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,440] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,543] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,543] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,645] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,645] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,747] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,747] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,849] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,849] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:26,952] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:26,952] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,054] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,054] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,156] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,155] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,258] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,258] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,361] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,360] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,461] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,461] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,563] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,562] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,666] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,665] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,768] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,768] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,870] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,870] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:27,972] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:27,972] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:28,075] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:28,075] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:28,177] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:28,176] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:28,279] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:28,279] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:293) - Wait for IPython Kernel to be started
DEBUG [2020-01-06 12:34:28,385] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:28,385] ({pool-2-thread-2} IPythonInterpreter.java[launchIPythonKernel]:290) - IPython Kernel is Running
DEBUG [2020-01-06 12:34:28,385] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:28,385] ({pool-2-thread-2} Py4JUtils.java[createGatewayServer]:44) - Launching GatewayServer at 127.0.0.1:61177
DEBUG [2020-01-06 12:34:28,613] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:28,613] ({pool-2-thread-2} PythonInterpreter.java[open]:235) - IPython is available, Use IPythonInterpreter to replace PythonInterpreter
DEBUG [2020-01-06 12:34:28,614] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) - DEBUG [2020-01-06 12:34:28,614] ({pool-2-thread-2} Interpreter.java[getProperty]:222) - key: zeppelin.PythonInterpreter.precode, value: null
DEBUG [2020-01-06 12:34:28,616] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) - DEBUG [2020-01-06 12:34:28,616] ({pool-2-thread-2} RemoteInterpreterServer.java[jobRun]:631) - Script after hooks: import matplotlib.pyplot as plt
DEBUG [2020-01-06 12:34:28,616] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) - plt.plot([1, 2, 3])
DEBUG [2020-01-06 12:34:28,678] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:298) -  INFO [2020-01-06 12:34:28,677] ({pool-2-thread-2} SchedulerFactory.java[jobFinished]:120) - Job 20161101-192232_289486976 finished by scheduler org.apache.zeppelin.python.PythonInterpreter1570228789
 INFO [2020-01-06 12:34:28,686] ({pool-2-thread-5} NotebookServer.java[afterStatusChange]:2314) - Job 20161101-192232_289486976 is finished successfully, status: FINISHED
 INFO [2020-01-06 12:34:28,738] ({pool-2-thread-5} VFSNotebookRepo.java[save]:196) - Saving note:2C2AUG798
 INFO [2020-01-06 12:34:28,747] ({pool-2-thread-5} SchedulerFactory.java[jobFinished]:120) - Job 20161101-192232_289486976 finished by scheduler org.apache.zeppelin.interpreter.remote.RemoteInterpreter-python:shared_process-shared_session

Может ли кто-нибудь дать мне подсказку или два, где я иду не так? Благодаря.

...