Skip to content
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

Discourage installation as root, such as with sudo #1283

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/1061.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
discourage installation as ``root``, including ``sudo`` - by :user:`altendky`
20 changes: 13 additions & 7 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,39 @@ Installation
setuptools < 0.9.7, because easy_install didn't download from PyPI over SSL
and was broken in some subtle ways.

To install globally with ``pip`` (if you have pip 1.3 or greater installed globally):
In Windows, run the ``pip`` provided by your Python installation to install ``virtualenv``.

::

$ [sudo] pip install virtualenv
> pip install virtualenv

To install locally (to ~/bin and ~/lib) with ``pip`` (if you have pip 1.3 or greater installed globally):
In non-Windows systems it is discouraged to run ``pip`` as root including with ``sudo``.
Generally use your system package manager if it provides a package.
This avoids conflicts in versions and file locations between the system package manager and ``pip``.
See your distribution's package manager documentation for instructions on using it to install ``virtualenv``.

Using ``pip install --user`` is less hazardous but can still cause trouble within the particular user account.
If a system package expects the system provided ``virtualenv`` and an incompatible version is installed with ``--user`` that package may have problems within that user account.
To install within your user account with ``pip`` (if you have pip 1.3 or greater installed):

::

$ export PYTHONUSERBASE=$HOME
$ pip install --user virtualenv

Note: This assumes you have $HOME/bin in your $PATH for later usage of virtualenv.
Note: The specific ``bin`` path may vary per distribution but is often ``~/.local/bin`` and must be added to your ``$PATH`` if not already present.

Or to get the latest unreleased dev version:

::

$ [sudo] pip install https://github.com/pypa/virtualenv/tarball/master
$ pip install --user https://github.com/pypa/virtualenv/tarball/master


To install version ``X.X.X`` globally from source:

::

$ [sudo] pip install https://github.com/pypa/virtualenv/tarball/X.X.X
$ pip install --user https://github.com/pypa/virtualenv/tarball/X.X.X

To *use* locally from source:

Expand Down