在MacOS Yosemite上使用PySpark时遇到tput:PyCharm中的未知终端“emacs”

时间:2015-08-25 19:41:12

标签: python emacs pycharm pyspark

我正在根据this link配置PyCharm来链接pyspark。 PyCharm成功找到了包并自动完成了我的代码。

但是,当我通过在终端中调用python demo1.py来运行代码时,我得到以下信息:

tput: unknown terminal "emacs" 
49886

我想这与我的终端(bash)设置有关。但我太无知了解决问题。

更新

当我通过运行:

在IPyhton终端窗口中创建SparkContext时
In [1]: from pyspark import SparkContext, SparkConf

In [2]: sc = SparkContext()
50463

终端给了我一些随机数(端口号?),终端冻结了。所以我认为问题不在于PyCharm。

1 个答案:

答案 0 :(得分:0)

今天,我再次尝试了它,它的确有效。特别是在bash终端我打开了ipython:

ipython

然后,在ipython中调用:

In [1]: from pyspark import SparkContext

In [2]: sc = SparkContext()
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
15/08/26 10:39:49 INFO SparkContext: Running Spark version 1.4.1
15/08/26 10:39:50 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
15/08/26 10:39:50 INFO SecurityManager: Changing view acls to: 
15/08/26 10:39:50 INFO SecurityManager: Changing modify acls to: 
15/08/26 10:39:50 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(panc25); users with modify permissions: Set(panc25)
15/08/26 10:39:51 INFO Slf4jLogger: Slf4jLogger started
15/08/26 10:39:51 INFO Remoting: Starting remoting
15/08/26 10:39:51 INFO Remoting: Remoting started; listening on addresses :[akka.tcp://sparkDriver@10.184.135.215:54733]
15/08/26 10:39:51 INFO Utils: Successfully started service 'sparkDriver' on port 54733.
15/08/26 10:39:51 INFO SparkEnv: Registering MapOutputTracker
15/08/26 10:39:51 INFO SparkEnv: Registering BlockManagerMaster
15/08/26 10:39:51 INFO DiskBlockManager: Created local directory at /private/var/folders/75/xqfxsstx5f70nqrv3pjt6llh0000gn/T/spark-15f3f4b7-2a90-451d-87d9-16d885a37dd9/blockmgr-efda35e0-f987-4460-b1aa-13e901f3fab5
15/08/26 10:39:51 INFO MemoryStore: MemoryStore started with capacity 265.1 MB
15/08/26 10:39:51 INFO HttpFileServer: HTTP File server directory is /private/var/folders/75/xqfxsstx5f70nqrv3pjt6llh0000gn/T/spark-15f3f4b7-2a90-451d-87d9-16d885a37dd9/httpd-89de876f-f2f2-40c3-99a6-dceb3b8247e4
15/08/26 10:39:51 INFO HttpServer: Starting HTTP Server
15/08/26 10:39:51 INFO Utils: Successfully started service 'HTTP file server' on port 54734.
15/08/26 10:39:51 INFO SparkEnv: Registering OutputCommitCoordinator
15/08/26 10:39:51 WARN Utils: Service 'SparkUI' could not bind on port 4040. Attempting port 4041.
15/08/26 10:39:51 WARN Utils: Service 'SparkUI' could not bind on port 4041. Attempting port 4042.
15/08/26 10:39:51 INFO Utils: Successfully started service 'SparkUI' on port 4042.
15/08/26 10:39:51 INFO SparkUI: Started SparkUI at http://10.184.135.215:4042
15/08/26 10:39:52 INFO Executor: Starting executor ID driver on host localhost
15/08/26 10:39:52 INFO Utils: Successfully started service 'org.apache.spark.network.netty.NettyBlockTransferService' on port 54735.
15/08/26 10:39:52 INFO NettyBlockTransferService: Server created on 54735
15/08/26 10:39:52 INFO BlockManagerMaster: Trying to register BlockManager
15/08/26 10:39:52 INFO BlockManagerMasterEndpoint: Registering block manager localhost:54735 with 265.1 MB RAM, BlockManagerId(driver, localhost, 54735)
15/08/26 10:39:52 INFO BlockManagerMaster: Registered BlockManager

我仍然不确定遇到问题时发生了什么。