AuroraTea
AuroraTea

Reputation: 54

How to create project with venv (not virtualenv) in Pycharm?

I'm talking about the venv module inside the Python Standard Library, not virtualenv.

When I create a new project, I can't find venv. (PyCharm 2022.3 Professional)

enter image description here

(edited: This paragraph is just about presentation of Jetbrains' documentation presentation and can't create project with venv by this way. But it's not the core of question...) ~~Although the official Pycharm documentation also says "For Python 3.3+ the built-in venv module is used, instead of the third-party virtualenv utility.", the tutorials that follow are actually based around virtualenv. I even thought it meant that Pycharm would automatically use venv instead of virtualenv. But when I tried it, I found that it didn't create the same project as python -m venv.~~

Has been searched many times, but can't find feasible guidelines. But creating via python -m venv and opening it in Pycharm automatically recognizes the virtual environment, which makes me even more confused.

Upvotes: 3

Views: 1105

Answers (2)

GetTheLoot
GetTheLoot

Reputation: 13

I think you need to activate the venv by using a command source /venv/bin/activate in the terminal to access the venv environment. I typically open it separately in the linux terminal or Visual Studio has a built in terminal as well.

Upvotes: 0

Blencer
Blencer

Reputation: 198

There is an open issue about clarifying the documentation about the default virtual environment tool used.

If you try to create a virtual environment using Pycharm in Python 3.3+, it actually creates it using virtualenv, not venv. You can check pyvenv.cfg inside the virtual environment folder to verify this.

I think the documentation is simply inaccurate in this case.

Upvotes: 2

Related Questions