简体   繁体   English

为什么这个先知 Python 模块不会导入? 我已经尝试了一切可能

[英]Why won't this prophet Python module import? I have tried everything possible

I am running Python version 3.7 and trying to create a stock prediction Python program using fbprophet.我正在运行 Python 版本 3.7 并尝试使用 fbprophet 创建股票预测 Python 程序。 However, it doesn't want to install.但是,它不想安装。

I have tried importing it using pip, through python, and using conda install.我尝试使用 pip、python 和 conda 安装导入它。 Nothing seems to work.似乎没有任何效果。 Can I get some help here?我可以在这里得到一些帮助吗?

Showing that it isn't importing显示它没有导入

Try with virtuanenv in python.在 python 中尝试使用 virtuanenv。

❯ python -m venv .venv
❯ source .venv/bin/activate
❯ pip install prophet

Then everything you installed will be in the virtual environment.然后你安装的所有东西都会在虚拟环境中。

Here is the sample code.这是示例代码。

from prophet import Prophet从先知进口先知

print("imported successfully!") print("导入成功!")

And the output would be following: output 将如下所示:

❯ python sample.py
Fontconfig warning: ignoring UTF-8: not a valid region tag
Importing plotly failed. Interactive plots will not work.
imported successfully!

Keep in mind that, every library you installed will be only in the virtual env and you have to source first, before running the code.请记住,您安装的每个库都只会在虚拟环境中,您必须先获取源代码,然后再运行代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM