pip install gower
Defaulting to user installation because normal site-packages is not writeable
Looking in links: /usr/share/pip-wheels
Collecting gower
Using cached gower-0.1.2-py3-none-any.whl (5.2 kB)
Requirement already satisfied: scipy in /opt/conda/envs/anaconda-2022.05-py39/lib/python3.9/site-packages (from gower) (1.7.3)
Requirement already satisfied: numpy in /opt/conda/envs/anaconda-2022.05-py39/lib/python3.9/site-packages (from gower) (1.21.5)
Installing collected packages: gower
Successfully installed gower-0.1.2
Note: you may need to restart the kernel to use updated packages.
这样就安装好了,但是只能用pip安装,不能用conda安装,而且找不到模块:
import gower
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[3], line 1
----> 1 import gower
ModuleNotFoundError: No module named 'gower'
我也尝试用 conda 安装它,但它不在 conda 包管理器中:
conda install gower
Channels:
- defaults
- conda-forge
- pytorch
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- gower
Current channels:
- defaults
- https://conda.anaconda.org/conda-forge/linux-64
- https://conda.anaconda.org/conda-forge/noarch
- https://conda.anaconda.org/pytorch/linux-64
- https://conda.anaconda.org/pytorch/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
Note: you may need to restart the kernel to use updated packages.
在测试过程中,我始终处于同一个虚拟环境中,该环境是 Anaconda.com 上在线提供的“anaconda-2022.05-py39”虚拟环境。切换到“anaconda-panel-2023.05-py310”时,错误是相同的。
如何才能让
import gower
运行?
正如 pip 安装程序的输出所示:
Note: you may need to restart the kernel to use updated packages.
当我切换回“anaconda-2022.05-py39”并触发内核重新启动时,找到了
gower
模块。我忘记了这一点并监督了注释。