-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Change to code-block:: text
from code-block:: bash
& update the version of pip
#937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d90a975
ede3fed
d1ee5f6
d1795e5
1394c76
4e4adfd
ee40d83
4e01f46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ installed. | |
|
||
.. tab:: Unix/macOS | ||
|
||
Debian and most other distributions include a `python-pip`_ package, if you | ||
want to use the Linux distribution-provided versions of pip see | ||
Debian and most other distributions include a `python-pip`_ package; if you | ||
want to use the Linux distribution-provided versions of pip, see | ||
:doc:`/guides/installing-using-linux-tools`. | ||
|
||
You can also install pip yourself to ensure you have the latest version. It's | ||
|
@@ -32,30 +32,34 @@ installed. | |
|
||
python3 -m pip install --user --upgrade pip | ||
|
||
Afterwards, you should have the newest pip installed in your user site: | ||
python3 -m pip --version | ||
|
||
.. code-block:: bash | ||
Afterwards, you should have the latest version of pip installed in your | ||
user site: | ||
|
||
python3 -m pip --version | ||
pip 9.0.1 from $HOME/.local/lib/python3.6/site-packages (python 3.6) | ||
.. code-block:: text | ||
|
||
pip 21.1.3 from $HOME/.local/lib/python3.9/site-packages (python 3.9) | ||
Comment on lines
+37
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In retrospect, the changes to this section probably should be in a separate PR, but I took the opportunity to (hopefully) add some additional clarity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, also, the console session should be coupled with the output after the prompt input. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If you mean there shouldn't be any explanatory text between the input and the output There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's confusing when the input line isn't marked with a prompt. If it is, that should be rendered better. |
||
|
||
.. _python-pip: https://packages.debian.org/stable/python-pip | ||
|
||
.. tab:: Windows | ||
|
||
The Python installers for Windows include pip. You should be able to access | ||
pip using: | ||
The Python installers for Windows include pip. You can make sure that pip is | ||
up-to-date by running: | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install --upgrade pip | ||
|
||
py -m pip --version | ||
pip 9.0.1 from c:\python36\lib\site-packages (Python 3.6.1) | ||
|
||
You can make sure that pip is up-to-date by running: | ||
Afterwards, you should have the latest version of pip: | ||
|
||
.. code-block:: bash | ||
.. code-block:: text | ||
|
||
pip 21.1.3 from c:\python39\lib\site-packages (Python 3.9.4) | ||
|
||
py -m pip install --upgrade pip | ||
|
||
|
||
Installing virtualenv | ||
|
@@ -81,7 +85,7 @@ using pip. | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install --user virtualenv | ||
|
||
|
@@ -111,7 +115,7 @@ in the below commands. | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m venv env | ||
|
||
|
@@ -140,27 +144,40 @@ virtual environment-specific | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: text | ||
.. code-block:: bat | ||
|
||
.\env\Scripts\activate | ||
|
||
You can confirm you're in the virtual environment by checking the location of your | ||
Python interpreter, it should point to the ``env`` directory. | ||
Python interpreter: | ||
|
||
.. tab:: Unix/macOS | ||
|
||
.. code-block:: bash | ||
|
||
which python | ||
.../env/bin/python | ||
|
||
.. tab:: Windows | ||
|
||
.. code-block:: text | ||
.. code-block:: bat | ||
|
||
where python | ||
|
||
It should be in the ``env`` directory: | ||
|
||
.. tab:: Unix/macOS | ||
|
||
.. code-block:: bash | ||
|
||
.../env/bin/python | ||
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bat | ||
|
||
...\env\Scripts\python.exe | ||
|
||
|
||
As long as your virtual environment is activated pip will install packages into that | ||
specific environment and you'll be able to import and use packages in your | ||
Python application. | ||
|
@@ -193,7 +210,7 @@ Now that you're in your virtual environment you can install packages. Let's inst | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install requests | ||
|
||
|
@@ -232,7 +249,7 @@ a specific version of ``requests``: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install requests==2.18.4 | ||
|
||
|
@@ -246,7 +263,7 @@ To install the latest ``2.x`` release of requests: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install requests>=2.0.0,<3.0.0 | ||
|
||
|
@@ -260,7 +277,7 @@ To install pre-release versions of packages, use the ``--pre`` flag: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install --pre requests | ||
|
||
|
@@ -279,7 +296,7 @@ specifying the extra in brackets: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install requests[security] | ||
|
||
|
@@ -301,7 +318,7 @@ pip can install a package directly from source, for example: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
cd google-auth | ||
py -m pip install . | ||
|
@@ -318,7 +335,7 @@ installed package without needing to re-install: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install --editable . | ||
|
||
|
@@ -354,7 +371,7 @@ wheel, or tar file) you can install it directly with pip: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install requests-2.18.4.tar.gz | ||
|
||
|
@@ -370,7 +387,7 @@ pip to look for packages there and not to use the | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install --no-index --find-links=/local/dir/ requests | ||
|
||
|
@@ -393,7 +410,7 @@ If you want to download packages from a different index than the | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install --index-url http://index.example.com/simple/ SomeProject | ||
|
||
|
@@ -409,7 +426,7 @@ and a separate index, you can use the ``--extra-index-url`` flag instead: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install --extra-index-url http://index.example.com/simple/ SomeProject | ||
|
||
|
@@ -427,7 +444,7 @@ install the latest version of ``requests`` and all of its dependencies: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install --upgrade requests | ||
|
||
|
@@ -453,7 +470,7 @@ And tell pip to install all of the packages in this file using the ``-r`` flag: | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip install -r requirements.txt | ||
|
||
|
@@ -471,7 +488,7 @@ Pip can export a list of all installed packages and their versions using the | |
|
||
.. tab:: Windows | ||
|
||
.. code-block:: bash | ||
.. code-block:: bat | ||
|
||
py -m pip freeze | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For win console, it's probably just
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @bhrutledge have you seen these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh. I missed those. I agree those seem appropriate, if there's a parallel change of all of the
bash
inputs, i.e.:I think that's beyond the scope of this PR. Also, as noted in an earlier discussion, I'm not sure it's a better experience, because it adds a little more work to copying a command.