MetaGPT
MetaGPT copied to clipboard
After fresh install of metagpt using pip `--init-config` causes `metagpt.config.NotConfiguredException`
Bug description
Running init config fails when following instructions in README for the installation using pip
.
Bug solved method Steps to recreate:
- Create new conda environment.
- Install metagpt with
pip install metagpt==0.6.6
- Create a directory/navigate to empty directory
- Run
metagpt --init-config
- See error
Environment information
- LLM type and model name: OpenAI GPT 4
- System version: Mac OS X M2 Sonoma 14.3
- Python version: 3.10
- packages version: 0.6.6
- installation method:
pip install metagpt
Screenshots or logs
(metagpt) _______ ~ % metagpt --init-config
2024-02-08 08:44:54.402 | INFO | metagpt.const:get_metagpt_package_root:32 - Package root set to /Users/_____
Traceback (most recent call last):
File "/Users/_______/miniconda3/envs/metagpt/bin/metagpt", line 5, in <module>
from metagpt.startup import app
File "/Users/_______/miniconda3/envs/metagpt/lib/python3.10/site-packages/metagpt/startup.py", line 8, in <module>
from metagpt.config import CONFIG
File "/Users/_______/miniconda3/envs/metagpt/lib/python3.10/site-packages/metagpt/config.py", line 287, in <module>
CONFIG = Config()
File "/Users/_______/miniconda3/envs/metagpt/lib/python3.10/site-packages/metagpt/utils/singleton.py", line 21, in __call__
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
File "/Users/_______/miniconda3/envs/metagpt/lib/python3.10/site-packages/metagpt/config.py", line 83, in __init__
self._update()
File "/Users/_______/miniconda3/envs/metagpt/lib/python3.10/site-packages/metagpt/config.py", line 155, in _update
_ = self.get_default_llm_provider_enum()
File "/Users/_______/miniconda3/envs/metagpt/lib/python3.10/site-packages/metagpt/config.py", line 118, in get_default_llm_provider_enum
raise NotConfiguredException("You should config a LLM configuration first")
metagpt.config.NotConfiguredException: You should config a LLM configuration first
@katyalaitqb you may try config2.yaml to implement your LLM config.
As you can see, the metagpt --init-config command actually resets the config2.yaml file. Therefore, you can directly configure it in config2.yaml from the beginning. Note that MetaGPT has been upgraded to version v0.7.0. You can refer to here to install the latest version and use the quickstart command. Add your GPT key in the config2.yaml file and don't forget to save the file.
I have the same issue but diffrent error and this is a fresh install metagpt --init-config
2024-02-15 13:33:20.057 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to C:\Users\Abrie
Traceback (most recent call last):
File "
I have the same issue but diffrent error and this is a fresh install metagpt --init-config 2024-02-15 13:33:20.057 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to C:\Users\Abrie Traceback (most recent call last): File "", line 198, in run_module_as_main File "", line 88, in run_code File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Scripts\metagpt.exe__main.py", line 4, in File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Lib\site-packages\metagpt\software_company.py", line 10, in from metagpt.config2 import config File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Lib\site-packages\metagpt\config2.py", line 137, in config = Config.default() ^^^^^^^^^^^^^^^^ File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Lib\site-packages\metagpt\config2.py", line 101, in default return Config(**final) ^^^^^^^^^^^^^^^ File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic\main.py", line 164, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self) pydantic_core._pydantic_core.ValidationError: 1 validation error for Config llm Field required [type=missing, input_value={'ALLUSERSPROFILE': 'C:..._INIT_AT_FORK': 'FALSE'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing
Same issue meet
Same issue, can't rune metagpt --init-config
Same here, it keeps showing errors of missing values while the command metagpt --init-config is to create the missing file
Any solution to this? I have the same issue
I have the same issue but diffrent error and this is a fresh install metagpt --init-config 2024-02-15 13:33:20.057 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to C:\Users\Abrie Traceback (most recent call last): File "", line 198, in run_module_as_main File "", line 88, in run_code File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Scripts\metagpt.exe__main.py", line 4, in File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Lib\site-packages\metagpt\software_company.py", line 10, in from metagpt.config2 import config File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Lib\site-packages\metagpt\config2.py", line 137, in config = Config.default() ^^^^^^^^^^^^^^^^ File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Lib\site-packages\metagpt\config2.py", line 101, in default return Config(**final) ^^^^^^^^^^^^^^^ File "C:\Users\Abrie\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic\main.py", line 164, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=pydantic_self) pydantic_core._pydantic_core.ValidationError: 1 validation error for Config llm Field required [type=missing, input_value={'ALLUSERSPROFILE': 'C:..._INIT_AT_FORK': 'FALSE'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/missing
Same issue meet
我也一样,连最开始的官方例子都是这个报错,似乎是模型配置哪里有问题,但是官方没说
Having config2.yaml
also doesn't work.
hey guys. This has been fixed in main for a while, plus it should also be possible to build manually (I also modified the readme to make it easier to understand). You can try again. If there are any problems, feel free to reopen this issue. @katyalaitqb @NagWolf @JerryWang20 @mbenitezm @bachnguyen2001 @toshan-luktuke @loyalty-fox