Issue with activating virtualenv Issue with activating virtualenv bash bash

Issue with activating virtualenv


For me it works when I do these steps:

  • Go to the directory/folder that you want

  • run virtualenv .env

  • then run source .env/bin/activate


The accepted answer is incomplete! The suggested code left out your error, but didn't comment on it.

The command . .env/bin/activate would indeed do the same as source on the file activate in the folder .env/bin. In fact, apparently the command "source" is an alias for the command ".", and not the other way around. Note that . here has a space after it, and used differently from the . discussed below (which makes files and folders hidden).

What I notice is that you are calling your folder .env, which is not standard practice. Files and folders preceded by . are made "hidden" by Mac OS X. Standard practice is to call a virtual environment directory env or venv, and to call the virtual environment specification file .env.

So, if your spec file is called .env and your virtual environment directory is called env, you can run either

source env/bin/activateor. env/bin/activate.


I had same issue & following steps resolved issue:

```   $mkdir annotateNLP   $cd annotateNLP   $python -m venv env   $source env/Scripts/activate```