Installation Guide¶
Requirements¶
Before installing python-newtype, ensure you have:
- Python 3.8 or higher
- pip (Python package installer)
- A C compiler (for building extensions)
Installation Methods¶
From PyPI (Recommended)¶
The simplest way to install python-newtype is via pip:
Development Installation¶
For development or to access the latest features:
-
Clone the repository:
-
Install in development mode with extra dependencies:
Building from Source¶
-
Clone the repository:
-
Build the package:
-
Install the built package:
Verifying Installation¶
To verify the installation:
Optional Dependencies¶
Development Dependencies¶
- pytest>=3.2
- pytest-asyncio
- pytest-memray
- pandas>=2
Install with:
Troubleshooting¶
Common Issues¶
- Missing Compiler
- Windows: Install Visual Studio Build Tools
- Linux: Install gcc (
sudo apt-get install gcc
or equivalent) -
macOS: Install Xcode Command Line Tools
-
ImportError: No module named 'newtype'
- Ensure the package is installed:
pip list | grep python-newtype
-
Check Python path:
python -c "import sys; print(sys.path)"
-
Build Errors
- Ensure you have the latest setuptools:
pip install --upgrade setuptools
- Check compiler installation:
gcc --version
or equivalent - On Windows, ensure you're using the correct Visual Studio version
Getting Help¶
If you encounter issues:
- Check the GitHub Issues
- Search for similar problems in closed issues
- Open a new issue with:
- Your Python version
- Your OS and version
- Complete error message
- Steps to reproduce