# Pycharm + Doppler CLI = Error

**URL:** <https://community.doppler.com/t/pycharm-doppler-cli-error/655>\
**Category:** Need Help\
**Created:** [June 15, 2022, 1:53pm UTC](https://community.doppler.com/t/pycharm-doppler-cli-error/655 "2022-06-15T13:53:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bp4151](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/bp4151/32/318_2.png) [@bp4151](https://community.doppler.com/u/bp4151)\
**Post date:** [June 15, 2022, 1:53pm UTC](https://community.doppler.com/t/pycharm-doppler-cli-error/655/1 "2022-06-15T13:53:23Z")

</div>

Hey folks,

Today I appear to have an error using Pycharm and the Doppler CLI tool that I didn’t have yesterday. When I attempt to run my project, I get the following error:

```auto
Unable to download secrets
Doppler Error: You must specify a project
Error processing line 2 of C:\Users\username\.virtualenvs\project-yZPpvnK8\lib\site-packages\doppler_env.pth:

```

I double-checked my configuration. I have DOPPLER\_ENV=1 set in both my debug configuration variable and the console environmental variable. I authenticated to the doppler dashboard just fine. I have tried running doppler setup from the Pycharm terminal and in the same folder using Powershell with no change in result.

I also created a new project using the same setup in Pycharm and using the same Doppler project, and I get secrets with no error.

If anyone has any suggestions, I’d appreciate the help.

Regards,  
Bruce

---

<div class="post-metadata">

**Author:** ![bp4151](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/bp4151/32/318_2.png) [@bp4151](https://community.doppler.com/u/bp4151)\
**Post date:** [June 15, 2022, 1:59pm UTC](https://community.doppler.com/t/pycharm-doppler-cli-error/655/2 "2022-06-15T13:59:17Z")

</div>

And now the other test project that was working an hour ago is exhibiting the same behavior…

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [June 15, 2022, 3:33pm UTC](https://community.doppler.com/t/pycharm-doppler-cli-error/655/3 "2022-06-15T15:33:04Z")

</div>

Hey @bp4151,

Does this happen outside of Pycharm too? Or only when you’re using a terminal inside of Pycharm? This is pretty odd since `doppler setup` writes to `~/.doppler/.doppler.yaml` and the CLI will load the project and config specified based on path from there. It shouldn’t matter which terminal you’re using.

Does the CLI work if you manually specify a project and config using the `-p` and `-c` flags?

-Joel

---

<div class="post-metadata">

**Author:** ![bp4151](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/bp4151/32/318_2.png) [@bp4151](https://community.doppler.com/u/bp4151)\
**Post date:** [June 15, 2022, 4:58pm UTC](https://community.doppler.com/t/pycharm-doppler-cli-error/655/4 "2022-06-15T16:58:26Z")

</div>

Hi Joel,

The yaml file looks to be correct. I think I’ve narrowed the issue down to running in the PyCharm IDE. I can run the script using doppler run – python main.py. I just can’t debug anymore within PyCharm.

---

<div class="post-metadata">

**Author:** ![bp4151](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/bp4151/32/318_2.png) [@bp4151](https://community.doppler.com/u/bp4151)\
**Post date:** [June 17, 2022, 11:33am UTC](https://community.doppler.com/t/pycharm-doppler-cli-error/655/5 "2022-06-17T11:33:28Z")

</div>

OS: Windows 10  
PyCharm: 2022.1.2  
Python: 3.10

Issue: When running a script in PyCharm using doppler-env, an error is thrown indicating the project has not been set despite doppler setup having been run and a project and config having been selected.

I found a workaround for this. In doppler\_env/\_\_init.py, there is the block of code

```auto
    DOPPLER_ENV_COMMAND = os.environ.get(
        'DOPPLER_ENV_COMMAND', 'doppler secrets download --no-file --format env'
    )

```

Seeing as how this is reading an environment variable that has a default value of ‘doppler secrets download --no-file --format env’, I added the following environment variable to my PyCharm run/debug configuration

`DOPPLER_ENV_COMMAND=doppler secrets download --project <project goes here> --config <config goes here> --no-file --format env`

Once I added that environment variable, the script ran as expected
