LinuxCommandLibrary

pyvenv-3.4

Create isolated Python 3.4 virtual environments

SYNOPSIS

pyvenv-3.4 [options] ENV_DIR

PARAMETERS

ENV_DIR
    Required. The path to the directory where the virtual environment will be created. This directory will be created if it doesn't exist.

--without-pip
    Create the environment without `pip` installed.

--clear
    Delete the contents of the environment directory if it already exists, before environment creation.

--symlinks
    Attempt to use symlinks rather than copies, when symlinks are not the default.

--copies
    Attempt to use copies rather than symlinks, even when symlinks are the default.

--prompt PREFIX
    Provide an alternative prefix name of this environment.

DESCRIPTION

The `pyvenv-3.4` command is a utility for creating Python virtual environments. A virtual environment is a self-contained directory that holds a Python installation and associated packages, isolating it from the system-wide Python installation and other virtual environments. This allows you to manage dependencies for different projects separately, preventing conflicts and ensuring reproducibility.

Using virtual environments is considered best practice for Python development. `pyvenv-3.4` specifically creates environments using Python 3.4. If you have multiple Python versions installed, you would use the `pyvenv` command corresponding to the version you intend to use (e.g., `pyvenv-3.8` for Python 3.8). Once created, you 'activate' the environment to use the Python interpreter and installed packages within it. The environments it created were not relocatable. Newer versions of `venv` can relocate environments.

CAVEATS

The `pyvenv-3.4` command creates environments tailored to Python 3.4. This command is deprecated. It has been replaced by the `venv` module which is part of the standard library. Virtual environments created using `pyvenv-3.4` are generally not relocatable (moving the environment directory may break it). Activating the environment requires sourcing the `activate` script within the environment's `bin` directory (or `Scripts` on Windows).

ACTIVATION

To activate a virtual environment created by `pyvenv-3.4`, you need to source the `activate` script in the environment's `bin` directory (or `Scripts` on Windows): `source ENV_DIR/bin/activate`.

DEACTIVATION

To deactivate a virtual environment, simply type `deactivate` in the terminal.

UPGRADE PATH

Consider migrating to using the standard `venv` module for creating virtual environments, as `pyvenv-3.4` is deprecated. Use `python3 -m venv ENV_DIR`.

HISTORY

The `pyvenv-3.4` command was introduced as a tool for creating virtual environments using Python 3.4. It aimed to provide a standardized way to isolate Python projects. However, it has been superseded by the `venv` module, which offers improved functionality and is part of the Python standard library from Python 3.3 onwards. `pyvenv` and `venv` were created in part as a response to virtualenv not always being up to date with the latest Python releases. `pyvenv` allowed immediate creation of environments without requiring a third party package to be installed via `pip` first.

SEE ALSO

virtualenv(1), python3.4(1), venv(1)

Copied to clipboard