Python language support for Apache NetBeans IDE using Language Server Protocol (LSP).
- Syntax Highlighting - Automatic Python syntax recognition
- Code Completion ✅ - Intelligent code suggestions via LSP
- Auto-triggers on
.(object.method) - Context-aware completions
- Imports, functions, classes, variables
- Powered by pyright or pylsp
- Auto-triggers on
- Error Detection - Real-time syntax and semantic errors
- Go to Definition - Navigate to function/class definitions
- Find Usages - Find all references to symbols
- Hover Documentation - View docstrings on hover
- Code Formatting - Format with Black, autopep8, etc. (via LSP)
- Python Project Recognition - Automatically detects Python projects
- setup.py (setuptools)
- pyproject.toml (PEP 518)
- requirements.txt (pip)
- Pipfile (pipenv)
- poetry.lock (poetry)
- .py files in directory
- Run Python Scripts - Execute .py files directly from NetBeans
- Python Console/REPL - Interactive Python shell within NetBeans
- Output Window Integration - View script output in NetBeans
- Debugger integration (pdb, debugpy)
- Testing support (pytest, unittest)
- Package management (pip)
- Virtual environment support
- Jupyter notebook support
- Type checking (mypy)
- Linting (pylint, flake8)
- Apache NetBeans 22.0 or later
- Java 11 or later
- Python 3.7+ installed and on PATH
- One of the following language servers:
npm install -g pyrightOR
pip install python-lsp-server- Download
netbeans-python-1.0.nbm - In NetBeans: Tools → Plugins → Downloaded
- Click "Add Plugins..." and select the NBM file
- Click "Install" and follow prompts
- Restart NetBeans
git clone https://github.com/FlossWare/netbeans-python.git
cd netbeans-python
mvn clean packageNBM file will be in: python/target/netbeans-python-1.0.nbm
Method 1: File → Open Project
- Navigate to any directory containing Python files
- If it has setup.py, pyproject.toml, or requirements.txt, it's auto-recognized
Method 2: Create New Project
- Create a directory with Python files
- Open it in NetBeans
Method 1: Right-click on .py file
- Right-click any .py file in Projects or Files view
- Select "Run Python Script"
Method 2: From Editor
- Open a .py file
- Right-click in editor
- Select "Run Python Script"
Output appears in NetBeans Output window.
Open the console:
- Menu: Window → Python Console
- Type Python commands interactively
With a language server installed (pyright or pylsp):
Auto-Trigger:
- Type
.after an object → automatic completion - Type
import→ module suggestions - Type
from→ package suggestions
Manual Trigger:
- Press
Ctrl+Space→ trigger completion anywhere
Features:
- Function/method names
- Class attributes
- Module imports
- Built-in functions
- Local variables
- Type-aware suggestions (with type hints)
Example:
import os
os. # ← Auto-complete shows: getcwd(), path, environ, etc.
class MyClass:
def my_method(self):
self. # ← Auto-complete shows class attributes
my_obj = MyClass()
my_obj. # ← Auto-complete shows: my_method()Navigation:
- Hover over symbols for documentation
- Ctrl+Click (or F12) to go to definition
- See function signatures and docstrings
If Python is not on your PATH:
- Tools → Options → Python (future feature)
- Set Python interpreter path
By default, the plugin auto-detects pyright or pylsp.
To prefer a specific server: (future feature)
- Tools → Options → Python → Language Server
- Select "pyright" or "pylsp"
netbeans-python/
├── pom.xml # Parent POM
└── python/
├── pom.xml # Module POM
└── src/
├── main/
│ ├── java/org/flossware/netbeans/python/
│ │ ├── lsp/
│ │ │ └── PythonLspServerLauncher.java # LSP server launcher
│ │ ├── completion/
│ │ │ ├── PythonLspCompletionProvider.java # Code completion
│ │ │ ├── PythonLspCompletionQuery.java # LSP query
│ │ │ └── PythonLspCompletionItem.java # Completion item
│ │ ├── project/
│ │ │ ├── PythonProject.java # Project representation
│ │ │ └── PythonProjectFactory.java # Project recognition
│ │ ├── execution/
│ │ │ └── RunPythonAction.java # Run script action
│ │ ├── ui/
│ │ │ └── PythonConsoleTopComponent.java # Python REPL
│ │ └── settings/
│ │ └── PythonSettings.java # User settings
│ └── resources/org/flossware/netbeans/python/
│ ├── layer.xml # NetBeans registration
│ ├── Bundle.properties # I18N strings
│ └── PythonResolver.xml # MIME type resolver
├── test/java/ # Unit tests
└── integration-test/java/ # Integration tests
This plugin uses LSP for language features:
- NetBeans LSP client communicates with Python language server
- Language server provides: completion, diagnostics, hover, goto-def, etc.
- Server runs as separate process
Architecture:
┌─────────────────────────┐
│ NetBeans IDE │
│ ┌──────────────────┐ │
│ │ Python Plugin │ │
│ │ (LSP Client) │ │
│ └────────┬─────────┘ │
└───────────┼─────────────┘
│ LSP/JSON-RPC
▼
┌─────────────────────────┐
│ Python Language Server │
│ (pyright or pylsp) │
└─────────────────────────┘
A directory is recognized as a Python project if it contains:
setup.py- setuptools configurationpyproject.toml- PEP 518 build systemrequirements.txt- pip dependenciesPipfile- pipenv configurationpoetry.lock- poetry configuration- Any
.pyfiles in root directory
Python scripts are executed using:
python /path/to/script.pyUses system Python from PATH (or configured interpreter).
Problem: Language server not installed
Solution:
# Install pyright
npm install -g pyright
# OR install pylsp
pip install python-lsp-serverVerify installation:
# Check pyright
pyright --version
# OR check pylsp
pylsp --versionProblem: Python not on PATH
Solutions:
- Add Python to system PATH
- Configure Python path in plugin settings (future)
- Create shell wrapper
Problem: Python interactive mode not starting
Solution:
- Ensure Python is on PATH
- Try running
python -imanually to verify - Check NetBeans output window for errors
Problem: Directory not detected as Python project
Solutions:
- Add one of these files to directory:
requirements.txt(can be empty)setup.pypyproject.toml
- Or create a
.pyfile in root
# Clone repository
git clone https://github.com/FlossWare/netbeans-python.git
cd netbeans-python
# Build
mvn clean package
# NBM file location
ls python/target/netbeans-python-*.nbm# Run tests
mvn test
# With coverage
mvn test jacoco:report
open python/target/site/jacoco/index.html- Fork the repository
- Create a feature branch
- Make changes
- Add tests
- Submit pull request
| Feature | PyCharm | VS Code + Python | This Plugin |
|---|---|---|---|
| Code completion | ✅ Native | ✅ LSP (Pylance) | ✅ LSP (pyright/pylsp) |
| Debugging | ✅ Excellent | ✅ Good | 🚧 Planned |
| Refactoring | ✅ Excellent | ✅ Good | ✅ LSP-based |
| Project management | ✅ Native | ✅ Extensions | ✅ Native |
| REPL | ✅ Yes | ✅ Yes | ✅ Yes |
| Run scripts | ✅ Yes | ✅ Yes | ✅ Yes |
| Virtual env | ✅ Excellent | ✅ Good | 🚧 Planned |
| Testing | ✅ pytest, unittest | ✅ pytest, unittest | 🚧 Planned |
| Cost | 💰 Paid | ✅ Free | ✅ Free |
- LSP integration (pyright/pylsp)
- Project recognition
- Run Python scripts
- Python REPL console
- Basic configuration
- Debugger integration (debugpy)
- Virtual environment auto-detection
- pip package management UI
- pytest/unittest integration
- Enhanced settings panel
- Jupyter notebook support
- Django/Flask project templates
- Code formatting UI (Black, autopep8)
- Linting integration (pylint, flake8, mypy)
- Advanced refactoring tools
Apache License 2.0
- Built by FlossWare
- Uses Language Server Protocol
- Supports pyright (Microsoft) and pylsp (Python community)
- Inspired by the original nbpython project
- GitHub: https://github.com/FlossWare/netbeans-python
- Issues: https://github.com/FlossWare/netbeans-python/issues
- NetBeans Plugin Portal: (coming soon)
- PackageCloud: https://packagecloud.io/flossware/java/
Q: Do I need to install both pyright AND pylsp?
A: No, install either one. Pyright is recommended (faster, more accurate).
Q: Will this work with Python 2?
A: Python 2 is end-of-life. This plugin targets Python 3.7+.
Q: Can I use this with Anaconda?
A: Yes, as long as Python is on your PATH or configured in settings.
Q: Does this support type checking?
A: Yes, via the language server (pyright has built-in type checking).
Q: Can I debug Python code?
A: Not yet - debugger support is planned for version 1.1.
Q: How does this compare to PyDev (Eclipse)?
A: Both provide Python IDE features. This plugin uses LSP for modern language support.
Version: 1.0
Last Updated: 2026-05-24
Status: Initial Release