Installation Methods
pipx (Recommended)
pip
From Source
Docker
The recommended way to install Impacket system-wide is using pipx, which isolates the package in its own virtual environment while making the command-line tools globally available.
Install pipx (if needed)
python3 -m pip install --user pipx
python3 -m pipx ensurepath
Install Impacket
Install the latest stable release: python3 -m pipx install impacket
Verify Installation
python3 -c "from impacket.version import version; print(version)"
For project-specific installations or when using virtual environments: It’s recommended to use a virtual environment to avoid conflicts with system packages.
Install the development version from the GitHub repository:
Clone the Repository
git clone https://github.com/fortra/impacket.git
cd impacket
Install from Source
Using pipx: python3 -m pipx install .
Or using pip: Run Impacket in an isolated Docker container:
Build the Image
docker build -t "impacket:latest" .
Run the Container
docker run -it --rm "impacket:latest"
Dependencies
Impacket requires the following Python packages, which are automatically installed:
Core Dependencies
pyasn1>=0.2.3
pyasn1_modules
pycryptodomex
pyOpenSSL
six
charset_normalizer
Protocol-Specific Dependencies
ldap3>=2.5,!=2.5.2,!=2.5.0,!=2.6
ldapdomaindump>=0.9.0
flask>=1.0
pyreadline3 # Windows only
Python Version Requirements
Impacket supports the following Python versions:
Python 3.9 Fully supported
Python 3.10 Fully supported
Python 3.11 Fully supported
Python 3.12 Fully supported
Python 3.13 Fully supported
Python 2.x is no longer supported. Please use Python 3.9 or later.
Virtual Environment Setup
For development or testing, it’s recommended to use a virtual environment:
# Create virtual environment
python3 -m venv impacket-env
# Activate (Linux/macOS)
source impacket-env/bin/activate
# Activate (Windows)
impacket-env\Scripts\activate
# Install Impacket
pip install impacket
Upgrading Impacket
python3 -m pipx upgrade impacket
pip install --upgrade impacket
Troubleshooting
ImportError: No module named 'impacket'
Make sure Impacket is installed in the correct Python environment: # Check Python version
python3 --version
# Check if impacket is installed
python3 -m pip list | grep impacket
# Reinstall if necessary
python3 -m pip install --force-reinstall impacket
On Linux/macOS, you may need to use --user flag or run with appropriate permissions: pip install --user impacket
Or use pipx which handles user installations automatically.
SSL/TLS certificate errors
If you encounter SSL errors, update your certificates: pip install --upgrade certifi
Next Steps
Quick Start Guide Ready to write your first Impacket script? Continue to the Quick Start guide.