如何在Jupyter Lite中安装pmdarima?

huangapple go评论63阅读模式
英文:

How can i install pmdarima in jupiter lite

问题

我正在使用Jupyter Lite(https://jupyter.org/try-jupyter/lab/index.html)。

我需要安装pmdarima。

我输入以下代码:

import pmdarima

但我收到以下错误信息:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[79], line 1
----> 1 import pmdarima

ModuleNotFoundError: No module named 'pmdarima'

我尝试使用以下代码来安装pmdarima:

pip install pmdarima

但我遇到以下问题:

module 'pexpect' has no attribute 'TIMEOUT'

任何帮助将不胜感激。

BR,

Andreas

英文:

I am using Jupiter lite (https://jupyter.org/try-jupyter/lab/index.html)

I need to install pmdarima.

I write
import pmdarima
but i receive the following error


ModuleNotFoundError Traceback (most recent call last)
Cell In[79], line 1
----> 1 import pmdarima

ModuleNotFoundError: No module named 'pmdarima'

I write

pip install pmdarima

but i get

module 'pexpect' has no attribute 'TIMEOUT'

Any help would be appreciated.

BR,

Andreas

答案1

得分: 1

在这个时间,这将不起作用。

理论上,安装它的命令将是%pip install -q pmdarima,您可以在要使用该包的笔记本内的单元格中运行它。请参阅此处获取更多信息。这种语法结构将适用于许多包。只需替换包名称。

但是,并不是所有在典型的基于全面的Python内核上工作的包都适用于底层的基于pyodide的JupyterLite。这是其中之一。如果运行该命令,您将看到以下内容:

ValueError: 找不到pmdarima的纯Python 3 wheel
请参阅https://pyodide.org/en/stable/usage/faq.html#micropip-can-t-find-a-pure-python-wheel
您可以使用`micropip.install(..., keep_going=True)`来获取所有缺少wheel的包列表

它告诉您如何获取更多信息。如果您愿意并且有能力构建wheel并添加它,请参阅此处。否则,如果您不能在此时没有该包的情况下完成工作,您需要使用典型的基于全面的Python内核,不能使用JupyterLite。事情不断发展,新的包正在添加。


在不安装任何东西或登录到您的计算机上使用该包的选项

要在您的浏览器中使用该包,只需在典型的基于全面的Python内核中,而无需安装任何东西或登录到任何地方,转到此处并点击“启动binder”徽章。当由MyBinder.org服务提供的临时JupyterLab会话打开时,单击右侧主窗格下方的“笔记本”下的磁贴,以打开一个由Python3支持的(ipykernel)支持的笔记本,并在新单元格中输入%pip install pmdarima(或%pip install -q pmdarima)并让进程运行。它会告诉您何时完成运行,方法是说您可能需要重新启动内核以使用该包。在内核下,选择重新启动内核。然后,您可以在新单元格中输入来自此处的“Quickstart Examples”下的第一个示例的前八行,并运行包括从pmdarima.model_selection导入pmdarima和使用train_test_split()来拆分数据以进行训练和测试集的示例部分。

请注意,MyBinder会话的计算资源可能不足以执行任何实质性的操作;但是,您至少可以观察到该包可以仅使用pip安装。

请注意,MyBinder会话是远程匿名会话,如果不活动会超时,因此如果制作了有用的内容,请将其下载回本地计算机。还有一个带有云图标的图标,让您可以将其备份到浏览器缓存中。但是,最安全的方式是在正常的本地驱动器上访问它,因为浏览器缓存是不可访问的。如果您没有在会话处于活动状态时采取步骤,将无法恢复内容。

英文:

At this time that won't work.

In theory, the command to install that would be %pip install -q pmdarima that you run in a cell inside the notebook where you want to use the package. See here for more about that. That syntax structure will work with many packages. Just substitute the package name.

However, not all packages that work in a typical, full Python-based kernel with a pyodide-based kernel that underlies JupyterLite. This is one of them. If you run that command, you'll see the following:

ValueError: Can't find a pure Python 3 wheel for 'pmdarima'.
See: https://pyodide.org/en/stable/usage/faq.html#micropip-can-t-find-a-pure-python-wheel
You can use `micropip.install(..., keep_going=True)`to get a list of all packages with missing wheels.

It tells you there how to get more information. And if you wanted to and are capable to build the wheels and add it, see here. Otherwise you need to use a typical, full Python-based kernel and cannot use JupyterLite if you cannot do your work without that package at this time. Things keep developing and new packages are added.


An option to use that package without installing anything on your machine or logging in:

To use the package right in your browser alone with a typical, full Python-based kernel without installing anything on your machine or logging in anywhere, go to here and press the 'launch binder' badge. When the temporary JupyterLab session opens that is being served by the MyBinder.org service opens, click on the tile in under 'Notebook' in the main pane on the right to open a Python3-based (ipykernel)-backed notebook and enter in a new cell %pip install pmdarima (or %pip install -q pmdarima) and let the process run. It will let you know when it is done running by saying you may need to restart the kernel to use the package. Under kernel, choose to restart the kernel. Then you can enter in a new cell the first eight lines from first example from under 'Quickstart Examples' from here and run the example portion that includes importing pmdarima and using train_test_split() from pmdarima.model_selection to split the data to train and test sets.

Note that the computational resources of the MyBinder-based session may not be enough to do anything substantial; however, you can at least observe that the package can install with pip alone.

Be aware the remote anonymous session is temporary and will time out after inactivity, and so if you make anything useful download it back to your own local machine. There is also an icon with a cloud that let's you back it up in your browser cache. However, the most safe way is you have it where you can access it on your normal local drive as the browser cache isn't accessible. There is no way to recover content if you didn't take steps while the session was active.

huangapple
  • 本文由 发表于 2023年7月10日 22:00:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76654511.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定