简体   繁体   English

ModuleNotFoundError: 没有名为“unidecode”的模块,但我已经安装了该模块

[英]ModuleNotFoundError: No module named 'unidecode' yet I have the module installed

I am trying to remove accents from a Python list of strings by converting it from UTF-8 to ASCII.我试图通过将 Python 字符串列表从 UTF-8 转换为 ASCII 来从字符串列表中删除重音符号。 I have read answers to multiple questions here in StackOverflow that suggest using the unidecode function from the unidecode package.我在 StackOverflow 中阅读了多个问题的答案,这些问题建议使用 unidecode 包中的 unidecode 函数。 I have installed it using conda but if I write我已经使用 conda 安装了它,但是如果我写

import unidecode

I get我得到

ModuleNotFoundError: No module named 'unidecode'

I have tried excluding unidecode and reinstalling it (using both conda and pip) and I checking if the PATH was pointing to all Anaconda locations, as advised in Alexander McFarlane's answer to this question .我已经尝试排除 unidecode 并重新安装它(同时使用 conda 和 pip),并且我检查了PATH是否指向所有 Anaconda 位置,如Alexander McFarlane 对此问题回答中所述。

I had the same problem, capitalizing Unidecode in the pip command worked for me.我遇到了同样的问题,在 pip 命令中大写 Unidecode 对我有用。

pip install Unidecode

https://pypi.org/project/Unidecode/ https://pypi.org/project/Unidecode/

follow steps按照步骤

1.open cmd 1.打开cmd

2.give full path to the script folder eg 2.给出脚本文件夹的完整路径,例如

C:\\Python37-32\\Scripts C:\\Python37-32\\Scripts

3.then try pip commands 3.然后尝试pip命令

pip install Unidecode pip 安装 Unidecode

C:\\Python37-32\\Scripts>pip install unicode C:\\Python37-32\\Scripts>pip install unicode

done!完毕!

Make sure you are using the same version of Python when you install the package and when you run it.确保在安装包和运行包时使用相同版本的 Python。 You are probably installing the library in one version and running using a different version.您可能在一个版本中安装库并使用不同版本运行。

You can check the python version in terminal this way:您可以通过以下方式在终端中检查 python 版本:

python3 --version

Also try to create and work on an environment, install your packages in the environment then try to run.还尝试创建并在环境中工作,在环境中安装您的软件包,然后尝试运行。

Read more about package managment in Conda since you use it https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html阅读有关 Conda 中的包管理的更多信息,因为您使用它https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:没有名为“magenta.protobuf”的模块,但我已经安装了它 - ModuleNotFoundError: No module named 'magenta.protobuf' but I have installed it 收到错误 ModuleNotFoundError: No module named 'mysql' 当我安装它时 - getting error ModuleNotFoundError: No module named 'mysql' when i have installed it 没有名为“unidecode”的模块 - No module named 'unidecode' ModuleNotFoundError:没有名为“pandas”的模块 - 当我已经安装了熊猫时 - ModuleNotFoundError: No module named 'pandas' - when I have pandas already installed ModuleNotFoundError:安装后没有名为“pgzrun”的模块? - ModuleNotFoundError: No module named 'pgzrun' when I have it installed? ModuleNotFoundError:即使我安装了功能工具,也没有名为“功能工具”的模块 - ModuleNotFoundError: No module named 'featuretools' even though I have installed featuretools 我已经安装了 Anaconda 并且我也安装了 pygame,但仍然出现错误 ModuleNotFoundError: No module named 'pygame' - I have installed Anaconda and I have installed pygame as well, but still got an error ModuleNotFoundError: No module named 'pygame' 我有一个 ModuleNotFoundError: No module named 'Crypto' - I have a ModuleNotFoundError: No module named 'Crypto' 没有名为“ PySocks”的模块,但我已经安装了该模块 - No module named 'PySocks' but I have installed this module ModuleNotFoundError:没有模块名为“ bs4”,但我安装了bs4,我相信 - ModuleNotFoundError: No module named 'bs4' but I have bs4 installed I believe
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM