Inline Python Package Installer for VS Code
A Visual Studio Code extension that automatically detects missing Python imports and offers to install them using pip.
This extension streamlines Python development by providing inline installation suggestions for missing packages.
Features
- 🔍 Automatically detects missing Python module imports
- 💡 Provides quick-fix actions to install missing packages
- ⚙️ Configurable pip command for custom package installation
- 🤖 Optional auto-install mode for seamless development
- 📝 Detailed logging in the output channel
Installation
- Open VS Code
- Press
Ctrl+P / Cmd+P
- Type
ext install inline-python-package-installer
- Press Enter
Requirements
- Visual Studio Code ^1.80.0
- Python and pip installed and accessible from the terminal
- A workspace with Python files
Extension Settings
This extension contributes the following settings:
inlinePythonPackageInstaller.autoInstallModules : Enable/disable automatic installation of missing modules without prompting
inlinePythonPackageInstaller.customPipCommand : Customize the pip command used for installing modules (default: "pip install")
Usage
- Open a Python file in VS Code
- Type an import statement for a package that isn't installed
- The extension will detect the missing import and offer to install it
- Click the lightbulb icon or use Quick Fix (
Ctrl+. / Cmd+. )
- Select "Install missing module [module-name]"
Development
Prerequisites
- Node.js and npm/yarn
- Visual Studio Code
- Recommended VS Code extensions:
- amodio.tsl-problem-matcher
- ms-vscode.extension-test-runner
- dbaeumer.vscode-eslint
Setup
- Clone the repository:
git clone [repository-url]
cd inline-python-package-installer
- Install dependencies:
npm install
# or
yarn install
- Open in VS Code:
code .
Development Workflow
- Make changes to the source code in
src/
- Press
F5 to launch the extension in debug mode
- Use
npm run watch or yarn watch for automatic compilation
- Run tests using the Test Runner in VS Code
Building
npm run package
# or
yarn package
Testing
- Install the Extension Test Runner
- Run the watch task:
npm run watch-tests
# or
yarn watch-tests
- Open the Testing view and run tests
Publishing
- Update version in
package.json
- Update CHANGELOG.md
- Package the extension:
vsce package
- Publish to marketplace:
vsce publish
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License
Release Notes
0.0.3 - 0.0.x
See CHANGELOG.md for detailed release notes.
0.0.2
- Initial release with basic functionality
- Support for automatic package detection
- Configurable pip command
- Quick fix actions for missing imports
Support
For bugs, feature requests, and questions, please create an issue.
| |