Skip to content

Added windows virtual environment activation command. Closes #942#946

Merged
mpoulin merged 6 commits into
realpython:masterfrom
suryasr007:master
Dec 20, 2018
Merged

Added windows virtual environment activation command. Closes #942#946
mpoulin merged 6 commits into
realpython:masterfrom
suryasr007:master

Conversation

@suryasr007
Copy link
Copy Markdown
Contributor

Issue: 942

  • Add windows virtual environment activation command.

Additional Changes

  • Defined venv as name of virtual environment, Instead of my_project.
  • Provided details about python's virtual environment module venv

@mpoulin
Copy link
Copy Markdown
Contributor

mpoulin commented Dec 17, 2018

@suryasr007
Thanks for making these edits.
Is there a benefit to naming the environment "venv" instead of "my_project"?

@suryasr007
Copy link
Copy Markdown
Contributor Author

Hi @mpoulin,

As I mentioned in guide, 'venv' is the general convention used globally. As it is readily available in ignore files (eg: .gitignore').

Copy link
Copy Markdown
Contributor

@apjanke apjanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor typo/style notes.

Comment thread docs/dev/virtualenvs.rst Outdated
placed in the ``my_project`` folder, isolated from the global Python installation.
placed in the ``venv`` folder, isolated from the global Python installation.

For windows, same command which is mentioned in step 1 can be used for creation of virtual environment. But, to activate, we use the following command.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Windows" should be capitalized.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing out. I will change it.

Comment thread docs/dev/virtualenvs.rst Outdated

For windows, same command which is mentioned in step 1 can be used for creation of virtual environment. But, to activate, we use the following command.

Assuming that, you are in project directory:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: no comma necessary here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing out. I will change it.

Comment thread docs/dev/virtualenvs.rst Outdated
where they were placed.

.. note::
Python has included virtual environment module from 3.3. It works in the simliar way as mentioned above. For details: `venv <https://docs.python.org/3/library/venv.html>`_.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "similar".

Should probably also be "...included the virtual...".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please elaborate this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just an English grammar issue, I think. For a non-proper noun "foo", if you say "X has included foo", it really needs an article like "X has include a foo" or "X has included the foo". Plain "X has included foo" only works for proper nouns/names of the form "X has included Foo" For that form, it would be "Python has included venv from 3.3.". That would be okay since "venv" is a proper noun since it's the actual name of the module.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @apjanke for the clarification.

@suryasr007
Copy link
Copy Markdown
Contributor Author

HI @apjanke
Fixed the typos

@apjanke
Copy link
Copy Markdown
Contributor

apjanke commented Dec 18, 2018

Looks good to me now.

@suryasr007
Copy link
Copy Markdown
Contributor Author

on windows I thinkthis should be venv\Scripts\activate

Yeah, sorry my bad. I will rectify that.
Thanks for pointing out.

@mpoulin mpoulin merged commit 9d975b5 into realpython:master Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants