AvikB
AvikB

Reputation: 3

How can I make sure that terminal searches the venv folder and not the default python location for third party modules?

Although I have implemented Virtual Environment inside a project in PyCharm IDE, when I trigger python -m behave it says:

'python' is not recognized as an internal or external command".

How can I make sure that terminal searches the venv folder and not the default python location?

I made sure that inside settings>tools>Terminal, "Activate Virtual Environment" is checked.

Upvotes: 0

Views: 70

Answers (1)

user10889503
user10889503

Reputation:

Terminal in PyCharm is still just a system terminal.

So you should add your python binarys path to your systems PATH environment variable.

Or you can use the option "Environment Variables" inside settings/tools/Terminal and add a new entry there like PATH=$PATH$;< Path to your python binary >

Then python should launch in PyCharms terminal window.

But to access your virtual environment you still need to start it like in a normal terminal: venv\Scripts\activate (on Windows).

Upvotes: 1

Related Questions