Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATH variable not set in PyCharm 2024.2.4 #66

Open
jstewmon opened this issue Oct 30, 2024 · 4 comments
Open

PATH variable not set in PyCharm 2024.2.4 #66

jstewmon opened this issue Oct 30, 2024 · 4 comments

Comments

@jstewmon
Copy link

👋 Hi, thank you for the excellent plugin. I'm having an issue with the latest version of PyCharm where my PATH variable is not reflecting the PATH_add instructions in my .envrc file. It looks like all other environment variables that are exported in my .envrc are populated, so I suspect there is some conflict specific to the PATH variable.

Build #PY-242.23726.102, built on October 22, 2024

@fehnomenal
Copy link
Owner

Hi,

the code has no special handling of PATH, so everything should work. Does the changes to PATH get picked up when using direnv in the terminal?

@jstewmon
Copy link
Author

jstewmon commented Nov 1, 2024

Yes, PATH is set as expected in the terminal. Sorry, I failed to mention that I'm observing a different PATH when with Run Configurations. Specifically, for python and pytest run configurations.

I am launching the IDE from the JetBrains toolbox. I can tell the IDE is loading my home shell profile (not from the project root) when it launches bc I have a command in my profile that requires a touchID.

Maybe there is some other IDE setting about loading the shell profile, or I need to launch the IDE differently?

@stijndcl
Copy link

stijndcl commented Nov 4, 2024

or I need to launch the IDE differently?

@jstewmon If you want your updated PATH to be available to your IDE you should launch it from the command-line after cd'ing into your desired directory (and letting direnv update your environment). E.g. cd into your project dir and type pycharm, goland, webstorm, ...

Agree that it would be nice for the plugin to support this instead.

@jstewmon
Copy link
Author

jstewmon commented Nov 4, 2024

@stijndcl thanks for your support on this issue. If I open my project by running pycharm ., it seems all of my direnv settings are inherited by the IDE, including updates to the path. But, having launched that way, when I try to use a run configuration with Enable Direnv and Trust .envrc checked, I get this error in the IDE:

Cannot invoke "java.util.Map.size()" because "m" is null

It would still be nice for the direnv plugin to work when the IDE is launched from a direnv directory, so that edits to environment variables can be picked up without having to restart the IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants