google-cloud-platform - pip install 后无法在 Google AI Platform Notebook 中导入 sklearn_pandas
问题描述
我正在使用 Google 的 AI Platform Notebook(目前仍处于测试阶段)。我上传了一个依赖于 sklearn_pandas 的 python 脚本,我收到了这个错误:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-24f79569b871> in <module>
----> 1 from sklearn_pandas import DataFrameMapper
ImportError: No module named 'sklearn_pandas'
然后我尝试 pip 安装它:
!pip install sklearn-pandas
我重新启动了内核,但它仍然得到相同的 ImportError。我这样做是为了确认确实安装了 sklearn pandas:
!pip list |grep -i sklearn
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
sklearn-pandas (1.8.0)
有人试过这个吗?在此之前我使用过google colab,我从来没有遇到过这样的困难。如果 Google colab 级别的用户体验可以移植到这个 beta 产品中,那就太好了。我认为这可能是一个一般的 python 模块导入问题,而不仅仅是 sklearn_pandas。
解决方案
我想可能是
%pip install sklearn-pandas
而不是“!pip”。
推荐阅读
- bash - 如何在 init=/bin/bash 的早期引导阶段将标准输出重定向到文件
- angular - 如何将 i18n Angular 应用程序部署到 Netlify?
- kubernetes - How to measure Hyperledger Fabric performance using Hyperledger Caliper in Kubernetes setting
- javascript - Convert object into array of object values
- javascript - Verifying decrypted string
- r - How to update the choices in a Shiny selectInput after loading a file?
- deep-learning - How to guarantee that the actor would select a correct action?
- python-3.x - 如何遍历多个元素的字符串列表并将字符串附加到另一个?(Python)
- python - 如何在 Python 服务器版本上使用 Tkinter?
- c# - sha256 : 如何使用算法作为输入