Forum Discussion

nikaro's avatar
nikaro
New Contributor
1 month ago
Solved

.env not seen as existing from Python

Hello,

I tried to use the new local-env feature to pass credentials to Mistral Vibe but the `.env` is considered as not existing. Cf. https://github.com/mistralai/mistral-vibe/issues/302

>>> from pathlib import Path
>>> vibe_env = Path("~/.config/vibe/.env")
>>> vibe_env.exists()
False

I can however access the file in the Shell:

> head -n 1 ~/.config/vibe/.env
# This file was generated by 1Password. Any manual edits will be lost.

 

  • My bad, path should be expanded before checking. `is_fifo()` is working fine then:

    >>> vibe_env.expanduser().is_fifo()
    True

     

2 Replies

  • nikaro's avatar
    nikaro
    New Contributor

    From the shell it is seen as a named pipe:

    ⏺ ~ > ls -l ~/.config/vibe/.env
    prw-------@ 1 nicolas  staff  0 Feb  4 10:42 /Users/nicolas/.config/vibe/.env|

    But even `.is_fifo()` returns `False`:

    >>> vibe_env.is_fifo()
    False

     

    • nikaro's avatar
      nikaro
      New Contributor

      My bad, path should be expanded before checking. `is_fifo()` is working fine then:

      >>> vibe_env.expanduser().is_fifo()
      True