I am installing a virtualenv and want to understand what’s going on.
$ curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
– I understand curl fine
$ python virtualenv.py my_new_env
– Understand this, too
$ . my_new_env/bin/activate
– Here’s where I get lost. What is the period doing here?
(my_new_env)$ pip install …
– What does it mean to have the parentheses here? Does this use tell me I’m in a folder?
The dot is a command that means to read and execute the contents of the given script in the current shell (normally running a shell script runs it in a new process.) Evaluating the script in the current shell can change the environment variables of the current shell, so the behavior of subsequent commands is affected.
I don’t know for sure about the parentheses, but I don’t think they’re meant to be syntax you type. As they come before the ‘$’ prompt, perhaps that’s literally what you’ll get as your new prompt after running the
activatescript, to show you that your environment has been changed?