在Apache Spark 3.3.0中,我想安装Prophet,以便与pyspark一起使用。
$ pyspark --version
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 3.3.0
/_/
Using Scala version 2.13.8, OpenJDK 64-Bit Server VM, 1.8.0_332
Branch HEAD
Compiled by user ubuntu on 2022-06-09T18:15:33Z
Revision f74867bddfbcdd4d08076db36851e88b15e66556
Url https://github.com/apache/spark
Type --help for more information.
而我
$ python --version
Python 2.7.18
我对python很陌生,我试过:
1)的
>>> from fbprophet import Prophet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'fbprophet'
>>> pip install Prophet
File "<stdin>", line 1
pip install Prophet
^
SyntaxError: invalid syntax
>>>
>>> from prophet import Prophet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'prophet'
>>>
$ pip install prophet
-bash: pip: command not found
所以这里的问题是如何在Apache Spark中安装prophet以与pyspark一起使用?
1条答案
按热度按时间wz1wpwve1#
您必须在终端(Apache Spark之外)中运行
pip install prophet
,而不是Python脚本。一旦安装了prophet,你就可以在你的Python代码中引用它用途:
fbprophet是软件包的旧名称,除非你想使用旧版本,否则请使用prophet代替。