random-password-generator
raw JSON → 2.2.0 verified Mon Apr 27 auth: no python
A simple and customizable random password generator for Python. Version 2.2.0 uses the secrets module for cryptographically secure passwords, with the API component separated into a separate package. Released irregularly.
pip install random-password-generator Common errors
error ImportError: cannot import name 'generate_password' from 'random_password_generator' ↓
cause The package name on PyPI has hyphens, but the import uses underscores. Users often try `import random-password-generator` which is invalid.
fix
Use
from random_password_generator import generate_password (all underscores). error ModuleNotFoundError: No module named 'random_password_generator' ↓
cause The package might not be installed, or Python environment issue.
fix
Run
pip install random-password-generator and ensure you are using the correct virtual environment. Warnings
gotcha In versions before 2.1.0, the library used the `random` module, which is not cryptographically secure. Always use version >=2.1.0 for secure generation. ↓
fix Upgrade to 2.1.0 or later with `pip install --upgrade random-password-generator`.
breaking In v2.2.0, the API (web service) was separated into a new package. The library itself has zero dependencies now, but if you relied on the API endpoints, install `rpg-web` separately. ↓
fix If you need the web API, install `pip install rpg-web`. The library `random-password-generator` is now standalone.
Imports
- generate_password
from random_password_generator import generate_password - RandomPasswordGenerator
from random_password_generator import RandomPasswordGenerator
Quickstart
from random_password_generator import generate_password
password = generate_password(length=16, numbers=True, uppercase=True, symbols=True)
print(password)