9

私は PySpark 1.5.2 を使用しています。UserWarning Please install psutil to have better support with spillingコマンドを発行した後に取得しました.collect()

この警告が表示されるのはなぜですか?

どうすればインストールできpsutilますか?

4

2 に答える 2

1

次のリンクで psutil プロジェクトを複製またはダウンロードできます: https://github.com/giampaolo/psutil.git

次に、setup.py を実行して psutil をインストールします

「spark/python/pyspark/shuffle.py」では、次のコードを確認できます。

def get_used_memory():
    """ Return the used memory in MB """
    if platform.system() == 'Linux':
        for line in open('/proc/self/status'):
            if line.startswith('VmRSS:'):
                return int(line.split()[1]) >> 10

    else:
        warnings.warn("Please install psutil to have better "
                      "support with spilling")**
        if platform.system() == "Darwin":
            import resource
            rss = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
            return rss >> 20
        # TODO: support windows

    return 0

y os が Linux でない場合は、psutil をお勧めします。

于 2015-12-29T06:15:24.007 に答える