ax-va / Python-Example-Collection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python-Example-Collection

Install using pip

Create a virtual environment, activate it on POSIX systems, and install a package

$ python3 -m venv venv_name
$ source venv_name/bin/activate
(venv_name) $ pip install pytest

or using virtualenv

$ python3 -m pip install virtualenv
$ python3 -m virtualenv venv_name
$ source venv_name/bin/activate
(venv_name) $ pip install pytest

Deactivate the venv

(venv_name) $ deactivate

Create a virtual environment, activate it on Windows systems, and install pytest

C:\> python -m venv venv_name
C:\> venv_name\Scripts\activate.bat
(venv_name) C:\> pip install pytest

Activate in PowerShell

C:>venv_name\Scripts\Activate.ps1

Install packages in editable mode

Editable mode refers to a way of installing a Python package such that any changes you make to the source code are immediately reflected without needing to reinstall the package.

Install from the current directory

(venv_editable) $ pip install -e .

Install with optional dependencies for testing

(venv_editable) $ pip install -e "./cards_proj_failed/[test]"

[test] in the -e parameters refers to optional dependencies for testing given in pyproject.toml.

johnnydep

$ johnnydep pandas==2.2.0 --verbose 0

About