<commit_before>[TOC]

# Overview

# Tips and Tricks

## Restricting pip to work on virtualenv only in macOS

- Create `~/Library/Application\ Support/pip/pip.conf`

```
[install]
require-virtualenv = true

[uninstall]
require-virtualenv = true
```

- Create a global pip function in shell script

```
gpip(){
   PIP_REQUIRE_VIRTUALENV="0" pip3 "$@"
}
```

- Upgrade global packages
    + `gpip install --upgrade pip setuptools wheel virtualenv`<commit_msg>Add links<commit_after>[TOC]

# Overview

# Tips and Tricks

## Restricting pip to work on virtualenv only in macOS

- https://hackercodex.com/guide/python-development-environment-on-mac-osx/
- Create `~/Library/Application\ Support/pip/pip.conf`

```
[install]
require-virtualenv = true

[uninstall]
require-virtualenv = true
```

- Create a global pip function in shell script

```
gpip(){
   PIP_REQUIRE_VIRTUALENV="0" pip3 "$@"
}
```

- Upgrade global packages
    + `gpip install --upgrade pip setuptools wheel virtualenv`
{'fraction_non_alphanumeric': 0.12919633774160733, 'fraction_numerical': 0.004069175991861648, 'mean_word_length': 4.178947368421053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3578004', 'n_tokens_mistral': 354, 'n_tokens_neox': 328, 'n_words': 89}