d
Please help.
n
hi @Denis can you share • the output of
cat ~/.prefect/profiles.toml
? • the output of
prefect version
?
d
Dear @Nate, The output of prefect version is: (venv) C:\Users\customer\Desktop\Python\Prefect>prefect version Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Scripts\prefect.exe\__main__.py", line 4, in <module> File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\cli\__init__.py", line 3, in <module> from prefect.cli.root import app File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\cli\root.py", line 16, in <module> import prefect.context File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\context.py", line 617, in <module> GLOBAL_SETTINGS_CONTEXT: SettingsContext = root_settings_context() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\context.py", line 580, in root_settings_context profiles = prefect.settings.load_profiles() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\settings.py", line 2105, in load_profiles user_profiles = _read_profiles_from(user_profiles_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\settings.py", line 2075, in _read_profiles_from contents = toml.loads(path.read_text()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\toml\decoder.py", line 463, in loads raise TomlDecodeError("Can't have a keygroup with an empty " toml.decoder.TomlDecodeError: Can't have a keygroup with an empty name (line 3 column 1 char 13)
n
actually i just realized you shouldnt share the
cat
output directly here as it might be sensitive, but it looks like thats where the issue is
ie it cant parse that toml this reason > Can't have a keygroup with an empty name
instead of
prefect version
, can you do
pip list | grep prefect
?
d
C:\Users\customer\Desktop\Python\Prefect>pip list | grep prefect 'grep' is not recognized as an internal or external command, operable program or batch file.
pip freeze gives the following: C:\Users\customer\Desktop\Python\Prefect>pip freeze aiosqlite==0.20.0 alembic==1.13.2 annotated-types==0.7.0 anyio==4.4.0 apprise==1.8.1 asgi-lifespan==2.1.0 asyncpg==0.29.0 attrs==23.2.0 cachetools==5.4.0 certifi==2024.7.4 cffi==1.17.0rc1 charset-normalizer==3.3.2 click==8.1.7 cloudpickle==3.0.0 colorama==0.4.6 coolname==2.2.0 croniter==3.0.3 cryptography==43.0.0 dateparser==1.2.0 dnspython==2.6.1 docker==7.1.0 email_validator==2.2.0 exceptiongroup==1.2.2 fastapi==0.111.1 fastapi-cli==0.0.4 fsspec==2024.6.1 graphviz==0.20.3 greenlet==3.0.3 griffe==0.47.0 h11==0.14.0 h2==4.1.0 hpack==4.0.0 httpcore==1.0.5 httptools==0.6.1 httpx==0.27.0 humanize==4.10.0 hyperframe==6.0.1 idna==3.7 importlib_resources==6.1.3 Jinja2==3.1.4 jinja2-humanize-extension==0.4.0 jsonpatch==1.33 jsonpointer==3.0.0 jsonschema==4.23.0 jsonschema-specifications==2023.12.1 Mako==1.3.5 Markdown==3.6 markdown-it-py==3.0.0 MarkupSafe==2.1.5 mdurl==0.1.2 oauthlib==3.2.2 orjson==3.10.6 packaging==24.1 pathspec==0.12.1 pendulum==3.0.0 prefect==3.0.0rc13 pycparser==2.22 pydantic==2.8.2 pydantic-extra-types==2.9.0 pydantic-settings==2.4.0 pydantic_core==2.20.1 Pygments==2.18.0 python-dateutil==2.9.0.post0 python-dotenv==1.0.1 python-multipart==0.0.9 python-slugify==8.0.4 pytz==2024.1 pywin32==306 PyYAML==6.0.2rc1 readchar==4.1.0 referencing==0.35.1 regex==2024.7.24 requests==2.32.3 requests-oauthlib==2.0.0 rfc3339-validator==0.1.4 rich==13.7.1 rpds-py==0.19.1 ruamel.yaml==0.18.6 ruamel.yaml.clib==0.2.8 shellingham==1.5.4 six==1.16.0 sniffio==1.3.1 SQLAlchemy==2.0.31 starlette==0.37.2 text-unidecode==1.3 time-machine==2.14.2 toml==0.10.2 typer==0.12.3 typing_extensions==4.12.2 tzdata==2024.1 tzlocal==5.2 ujson==5.10.0 urllib3==2.2.2 uvicorn==0.30.4 watchfiles==0.22.0 websockets==12.0 wrapt==1.16.0
n
got it, are you able to share the redacted content from your ~/.prefect/profiles.toml file? i believe thats where the problem is
d
Here it is unredacted: active = "default" [profiles.default]
n
hrm thats odd, can you just try deleting that file and doing
prefect profiles ls
?
d
(venv) C:\Users\customer\Desktop\Python\Prefect>prefect profiles ls Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Scripts\prefect.exe\__main__.py", line 4, in <module> File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\cli\__init__.py", line 3, in <module> from prefect.cli.root import app File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\cli\root.py", line 16, in <module> import prefect.context File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\context.py", line 617, in <module> GLOBAL_SETTINGS_CONTEXT: SettingsContext = root_settings_context() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\context.py", line 580, in root_settings_context profiles = prefect.settings.load_profiles() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\settings.py", line 2101, in load_profiles profiles = _read_profiles_from(DEFAULT_PROFILES_PATH) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\settings.py", line 2075, in _read_profiles_from contents = toml.loads(path.read_text()) ^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 1027, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 1013, in open return io.open(self, mode, buffering, encoding, errors, newline) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\customer\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\prefect\\profiles.toml'
I even deleted Python\\Python312\\Lib\\site-packages\\prefect\ and pip installed Prefect again
It still throes the error:
(venv) C:\Users\customer\Desktop\Python\Prefect>prefect cloud logout Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\customer\Desktop\Python\Prefect\venv\Scripts\prefect.exe\__main__.py", line 4, in <module> File "C:\Users\customer\Desktop\Python\Prefect\venv\Lib\site-packages\prefect\cli\__init__.py", line 3, in <module> from prefect.cli.root import app File "C:\Users\customer\Desktop\Python\Prefect\venv\Lib\site-packages\prefect\cli\root.py", line 16, in <module> import prefect.context File "C:\Users\customer\Desktop\Python\Prefect\venv\Lib\site-packages\prefect\context.py", line 677, in <module> GLOBAL_SETTINGS_CONTEXT: SettingsContext = root_settings_context() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\Desktop\Python\Prefect\venv\Lib\site-packages\prefect\context.py", line 640, in root_settings_context profiles = prefect.settings.load_profiles() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\Desktop\Python\Prefect\venv\Lib\site-packages\prefect\settings.py", line 2138, in load_profiles user_profiles = _read_profiles_from(user_profiles_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\Desktop\Python\Prefect\venv\Lib\site-packages\prefect\settings.py", line 2108, in _read_profiles_from contents = toml.loads(path.read_text()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\customer\Desktop\Python\Prefect\venv\Lib\site-packages\toml\decoder.py", line 463, in loads raise TomlDecodeError("Can't have a keygroup with an empty " toml.decoder.TomlDecodeError: Can't have a keygroup with an empty name (line 3 column 1 char 13)
Dear @Nate, is it a problem with my PC or with a software bug?
Now in my profiles.toml has the following content: # This is a template for profile configuration for Prefect. # You can modify these profiles or create new ones to suit your needs. active = "ephemeral" [profiles.ephemeral] PREFECT_SERVER_ALLOW_EPHEMERAL_MODE = "true" [profiles.local] # You will need to set these values appropriately for your local development environment PREFECT_API_URL = "http://127.0.0.1:4200/api" [profiles.cloud]
n
I assume you just upgraded? we just released and have made some changes here are you still getting the same error when you use the CLI?
d
yes I have upgraded and now have this problem
I tried to run older versions, The same error
178 Views