You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-2Lines changed: 43 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This package provides `tflocal` - a small wrapper script to run [Terraform](http
7
7
## Prerequisites
8
8
9
9
* Python 3.x
10
-
*`pip`
10
+
*`pip` or `pipx`
11
11
*`terraform`
12
12
13
13
## How it works
@@ -16,11 +16,52 @@ The script uses the [Terraform Override mechanism](https://www.terraform.io/lang
16
16
17
17
## Installation
18
18
19
-
The `tflocal` command line interface can be installed via `pip`:
19
+
The recommended way to install tflocal is using pipx, which installs Python CLI tools in their own isolated environments. This avoids conflicts with system packages and the externally-managed-environment error (PEP 668) seen on modern Linux distributions.
20
+
21
+
##### 1) Recommended: Using pipx
22
+
23
+
24
+
First, ensure pipx is installed.
25
+
26
+
On Debian/Ubuntu:
27
+
28
+
```
29
+
sudo apt install pipx
30
+
```
31
+
Or, using pip (for other systems):
32
+
33
+
```
34
+
pip install --user pipx
35
+
```
36
+
Then, run pipx ensurepath to add pipx's binaries to your system's PATH. You may need to restart your shell for this to take effect.
37
+
38
+
#### Install tflocal with pipx:
39
+
Bash
40
+
41
+
pipx install terraform-local
42
+
43
+
To upgrade tflocal in the future, run: pipx upgrade terraform-local.
44
+
45
+
##### 2) Alternative: Using a Virtual Environment
46
+
47
+
If you prefer not to use pipx, you can install tflocal into a standard Python virtual environment (venv):
48
+
Bash
49
+
50
+
# Create a virtual environment (e.g., in your project directory)
51
+
```
52
+
python3 -m venv .venv
53
+
```
54
+
# Activate it
55
+
```
56
+
source .venv/bin/activate
57
+
```
58
+
# Install the package
20
59
```
21
60
pip install terraform-local
22
61
```
23
62
63
+
# Note: You must activate this venv (source .venv/bin/activate) every time you want to use the tflocal command.
64
+
24
65
## Configurations
25
66
26
67
The following environment variables can be configured:
0 commit comments