如何修复windows 10上的以下错误获得modulenotfounderror没有模块命名为slugify?<



我已经安装了pip3 python-slugify, pip3列表显示python-slugify 5.0.2;安装时的路径被添加到环境变量path中,但尽管如此当尝试执行:

from slugify import slugify

我总是得到:

ModuleNotFoundError: No module named slugify.

我的python --version显示3.8.8(def, apr 13.2021) Anaconda build

python-slugify安装C: 用户… python39…

我尝试重新启动系统并使用pip3重新安装,但根本没有运气。

如何解决这个问题

  1. 检查安装文件夹

pip3 show python-slugify

是站点包文件夹。在该文件夹中应该有一个文件slugify.py

然后检查python中的路径:

import sys
for x in sys.path:
print(x)

在1中得到的文件夹。应该打印出来。如果没有,请确保您使用的是来自相同python环境的pip3和python。

使用

查看可执行文件的位置
where pip3

where python

Windows控制台中

最新更新