Ubuntu下没有安装dotenv

f45qwnt8  于 2023-10-17  发布在  其他
关注(0)|答案(2)|浏览(160)

我正在尝试安装paperless,在python下遇到了dotenv的问题。我做了一些研究,最后卸载了dotenv,然后通过pip安装了python-dotenv。我仍然在犯同样的错误。任何帮助将不胜感激!

Traceback (most recent call last):
  File "./manage.py", line 18, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 307, in execute
    settings.INSTALLED_APPS
  File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/www/paperless/paperless/src/paperless/settings.py", line 15, in <module>
    from dotenv import load_dotenv
ModuleNotFoundError: No module named 'dotenv'

我正在运行Linux ubuntu 4.13.0-21-generic #24-Ubuntu SMP Mon Dec 18 17:29:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
简体中文
pip install python-dotenv返回成功安装python-dotenv-0.8.2

stszievb

stszievb1#

首先用“pip 3 list”检查dotenv
如果不在列表中,请使用以下命令安装它:'pip3 install python-dotenv'
结果:收集python-dotenv下载python_dotenv-0.20.0-py 3-none-any.whl(17 kB)安装收集的软件包:python-dotenv成功安装python-dotenv-0.20.0

0aydgbwb

0aydgbwb2#

我在从我的项目目录安装它时遇到了问题。
转到根目录(cd /),然后'pip 3 install python-dotenv',这对我很有帮助。

相关问题