安装该特定模块后出现 ModuleNotFoundError
ModuleNotFoundError after installing that particular module
我目前正在设置开发人员环境,我想使用包 django-ckeditor
。所以,我执行了 pip3 install django-ckeditor
结果是
Installing collected packages: django-ckeditor
Successfully installed django-ckeditor-5.8.0
在我的终端。启动 Django 后,我得到 ModuleNotFoundError: No module named 'ckeditor'
。所以,我检查了以下内容:
我正在使用 python3(.7) 启动 Django,所以我正在使用 pip3(.7) 中的包。
ls -l .local/lib/python3.7/site-packages/ | grep "ckeditor"
产量
drwxr-xr-x 5 albert albert 4096 Jan 22 10:22 ckeditor
drwxr-xr-x 4 albert albert 4096 Jan 22 10:22 ckeditor_demo
drwxr-xr-x 7 albert albert 4096 Jan 22 10:22 ckeditor_uploader
drwxr-xr-x 2 albert albert 4096 Jan 22 10:22 django_ckeditor-5.8.0.dist-info
所以它实际上已安装。
pip3 list
也显示 django-ckeditor 5.8.0
所以现在我不知道从这里去哪里。有人有什么建议吗?
我找到了解决方案。我实际上使用的是一个虚拟环境,我的包在 ~/.local/lib/python3.7/site-packages
中。 ckeditor
不在那里,因为我为此使用了 "global" pip3.7。解决方案是使用 ~/.local/bin/pip3.7 install django-ckeditor
.
很抱歉让您感到困惑,但我希望以后能帮助解决这个问题的人。
我目前正在设置开发人员环境,我想使用包 django-ckeditor
。所以,我执行了 pip3 install django-ckeditor
结果是
Installing collected packages: django-ckeditor
Successfully installed django-ckeditor-5.8.0
在我的终端。启动 Django 后,我得到 ModuleNotFoundError: No module named 'ckeditor'
。所以,我检查了以下内容:
我正在使用 python3(.7) 启动 Django,所以我正在使用 pip3(.7) 中的包。
ls -l .local/lib/python3.7/site-packages/ | grep "ckeditor"
产量drwxr-xr-x 5 albert albert 4096 Jan 22 10:22 ckeditor drwxr-xr-x 4 albert albert 4096 Jan 22 10:22 ckeditor_demo drwxr-xr-x 7 albert albert 4096 Jan 22 10:22 ckeditor_uploader drwxr-xr-x 2 albert albert 4096 Jan 22 10:22 django_ckeditor-5.8.0.dist-info
所以它实际上已安装。pip3 list
也显示django-ckeditor 5.8.0
所以现在我不知道从这里去哪里。有人有什么建议吗?
我找到了解决方案。我实际上使用的是一个虚拟环境,我的包在 ~/.local/lib/python3.7/site-packages
中。 ckeditor
不在那里,因为我为此使用了 "global" pip3.7。解决方案是使用 ~/.local/bin/pip3.7 install django-ckeditor
.
很抱歉让您感到困惑,但我希望以后能帮助解决这个问题的人。