django MailInaBox配置问题(来自expiringdict导入ExpiringDict)

1cosmwyk  于 2023-04-13  发布在  Go
关注(0)|答案(1)|浏览(86)

所以我最近升级了我的mailinabox安装,之后当我尝试启动mailinabox服务时,我在控制台上得到这个错误
文件“/root/mailinabox/management/auth.py“,from expiringdict import ExpiringDict ModuleNotFoundError:没有名为“expiringdict”的模块
我已经尝试和安装模块手动使用pip但它就是不工作

von4xj4u

von4xj4u1#

Mailinabox有自己的库目录。我通过运行以下命令发现了这一点:

# grep -R python3 /root/mailinabox/management/*.py

/root/mailinabox/management/cli.py:#!/usr/bin/python3 /root/mailinabox/management/daemon.py:#!/usr/local/lib/mailinabox/env/bin/python3 /root/mailinabox/management/mailconfig.py:#解释器(/usr/bin/python3)以及通过

# head -n1 /root/mailinabox/management/daemon.py

!/usr/local/lib/mailinabox/env/bin/python3

# /usr/local/lib/mailinabox/env/bin/python3 -c“from distutils.sysconfig import get_python_lib;print(get_python_lib())"

/usr/local/lib/mailinabox/env/lib/python3.6/site-packages
现在,知道了mailinbox库的目录,您可以从标准目录创建符号链接:

cd /usr/local/lib/mailinabox/env/lib/python3.6/site-packages
ln -s /usr/lib/python3/dist-packages/expiringdict expiringdict
ln -s /usr/lib/python3/dist-packages/expiringdict-1.1.2.egg-info expiringdict-1.1.2.egg-info

相关问题