【发布时间】:2019-06-13 09:52:45
【问题描述】:
我无法在 python 3 虚拟环境中的 jupyter notebook 中导入 category_encoders 模块。
错误
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-15-86725efc8d1e> in <module>()
9 from plotly import graph_objs
10 from datetime import datetime
---> 11 import category_encoders as ce
12
13 import sklearn
ModuleNotFoundError: No module named 'category_encoders'
“哪个点”的输出
/opt/virtual_env/py3/bin/pip
“pip show category_encoders”的输出是
Name: category-encoders
Version: 1.3.0
Summary: A collection sklearn transformers to encode categorical variables as numeric
Home-page: https://github.com/wdm0006/categorical_encoding
Author: Will McGinnis
Author-email: will@pedalwrencher.com
License: BSD
Location: /opt/virtual_env/py3/lib/python3.6/site-packages
Requires: numpy, pandas, statsmodels, scikit-learn, patsy, scipy
Required-by:
“点子列表”的输出
Package Version
------------------- -------
absl-py 0.7.0
astor 0.7.1
backcall 0.1.0
category-encoders 1.3.0
cycler 0.10.0
【问题讨论】:
-
如果您使用 anaconda,请使用 conda install category-encoders 安装软件包。重启jupyter。然后试试代码。
-
我现在没有使用 anaconda。
-
请重启jupyter并尝试执行。大多数时候,它会解决问题。
-
我安装了内核,重启了很多次,还是这个错误。我确定我已经安装了 pip 和 scikit。我正在使用 pycharm。
标签: python encoding data-science categorical-data