Intellij not activating venv (python project)

Answered

Hi all,

while the project works beautifully in pycharm (i.e. opening the terminal shows me the venv name and right path when I type e.g. which python), it does not do the same when opening the terminal from intellij [0].

I have the SDK set correctly to the venv/bin/python within the project.

I have the checkbox checked about activating virtual environments in the terminal settings.

 

What else shall I do to get idea to activate the right venv? I can type source venv/bin/activate and that does the trick, but I'm sure that intellij can do that automatically. Restarted intellij multiple times in-between.

 

Thanks!

0
3 comments

Igor, J  I was unable to reproduce this same behavior from the get-go. I created a new Python project on IntelliJ and it automatically activated the venv created.  Are you using the latest 2023.2.5? If the issue persists with the Python plugin please create a new bug request on YouTrack so we can further investigate the logs from Help | Collect Logs and Diagnostic Data - https://youtrack.jetbrains.com/newIssue?project=PY

0

Hello Miguel,

yes, I'm using 2023.2.5. The project was created from within intellij itself and I made no configuration changes myself which could cause it.

I even created one more project this very moment, opened the terminal and same issue occurs (example below).

I opened a youtrack item here: https://youtrack.jetbrains.com/issue/IDEA-338309/Intellij-not-activating-venv-python-project

Thanks!

0

Addendum: it's working as it should, when starting intellij from the commandline instead of the toolbox and/or the Applications folder

0

Please sign in to leave a comment.