【问题标题】:No module named 'PyPDF2._codecs', even after already installed没有名为“PyPDF2._codecs”的模块,即使已经安装
【发布时间】:2022-06-19 21:28:21
【问题描述】:

我已经在我的库文件中安装了 pypdf2,但仍然出现错误,我什至通过 pypdf2.py 文件检查是否可以采取任何措施来修复它。 我的python版本是3.10

错误显示如下:ModuleNotFoundError: No module named 'PyPDF2._codecs'

enter image description here

当我尝试在 spyder 中输入它时它甚至会出现

image took at spyder

【问题讨论】:

标签: python python-3.x pypdf2 anaconda3


【解决方案1】:

你可以从here试试这些

回答 1

try the following:
type this import sys !{sys.executable} -m pip install PyPDF2
then import PyPDF2
Hope it works for you too.

回答 2

restart the environment
go to your anaconda prompt
control c to stop the running instance
conda activate ***your_env_here***
pip install PyPDF2
(in my case open the jupyer notebook) jupyter notebook
You can now import the library without the error. import PyPDF2

【讨论】:

    猜你喜欢
    • 2018-07-13
    • 2018-08-18
    • 2022-07-06
    • 2021-02-22
    • 2020-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-07
    相关资源
    最近更新 更多