AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

No module named 'dotenv'

Open MrTrigster opened this issue 2 years ago • 3 comments

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

Windows

Which version of Auto-GPT are you using?

Latest Release

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

Running ./run.bat

Current behavior 😯

The autogpt doesnt run properly

Expected behavior 🤔

run the autogpt

Your prompt 📝

NO prompt

Your Logs 📒

PS C:\AI\Auto-GPT> ./run.bat
Traceback (most recent call last):
  File "C:\AI\Auto-GPT\scripts\check_requirements.py", line 4, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
Installing missing packages...
C:\Libraries\msys64\mingw64\bin\python.exe: No module named pip
Traceback (most recent call last):
  File "C:\Libraries\msys64\mingw64\lib\python3.10\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Libraries\msys64\mingw64\lib\python3.10\runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\Libraries\msys64\mingw64\lib\python3.10\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "C:\AI\Auto-GPT\autogpt\__init__.py", line 5, in <module>
    from dotenv import load_dotenv
ModuleNotFoundError: No module named 'dotenv'

MrTrigster avatar May 05 '23 15:05 MrTrigster

running pip install python-dotenv and pip3 install python-dotenv should do the trick

Bramvlaere avatar May 05 '23 16:05 Bramvlaere

So, I just ran into the same issue. python-dotenv is referenced in the requirements.txt file and installed that way, it is also listed when using the pip list command.

tgoorden avatar May 07 '23 17:05 tgoorden

So, I've figured out this issue (for my case): python was aliased to /usr/bin/python3, but it needed to be aliased to /opt/homebrew/bin/python3. For some reason, the version difference between the two matters.

tgoorden avatar May 07 '23 17:05 tgoorden

I figured it out too, turns out I had multiple python installations so i fixed it by running the program in virtual environment

MrTrigster avatar May 19 '23 07:05 MrTrigster

Closing as OP indicates he's fixed the issue

richbeales avatar May 20 '23 07:05 richbeales

I am having the same issue. How was it fixed and how do I do it? Thank you for your help.

Mr0sari0 avatar Jun 08 '23 00:06 Mr0sari0

I added this to my .zprofile. (This is using HomeBrew on MacOS. Depending on your system or how you installed python3, you may need a different approach.)

alias python=/opt/homebrew/bin/python3
alias pip=/opt/homebrew/bin/pip3

tgoorden avatar Jun 08 '23 06:06 tgoorden