From 3e452d0f372d7687519d16524994ede974911b8e Mon Sep 17 00:00:00 2001 From: akshaymittal143 Date: Tue, 11 Nov 2025 00:15:40 -0600 Subject: [PATCH 1/2] Fix Python compatibility and dependency installation issues - Fix Python 3.13 compatibility: Document Python 3.9-3.11 requirement - Fix torch installation: Install from PyTorch repository instead of PyPI - Fix NumPy compatibility: Constrain to numpy<2.0 for spacy/thinc compatibility - Improve setup.sh: Add Python version detection and proper dependency order - Update README: Add comprehensive installation instructions and troubleshooting - Add .python-version: Specify recommended Python version - Add CHANGELOG.md: Document all changes Fixes installation issues with: - blis==1.2.0 on Python 3.13+ - torch==2.4.1 not available for Python 3.11 - NumPy 2.x compatibility warnings with spacy/thinc Resolves: Installation failures on modern Python versions --- .python-version | 2 ++ CHANGELOG.md | 27 +++++++++++++++++++++ README.md | 45 +++++++++++++++++++++++++++++----- requirements.txt | Bin 3624 -> 3952 bytes setup.sh | 61 +++++++++++++++++++++++++++++++++++++++++------ 5 files changed, 122 insertions(+), 13 deletions(-) create mode 100644 .python-version create mode 100644 CHANGELOG.md mode change 100644 => 100755 setup.sh diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..4feb2ff --- /dev/null +++ b/.python-version @@ -0,0 +1,2 @@ +3.11 + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..815858a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,27 @@ +# Changelog + +## [Unreleased] - Fix Python Compatibility Issues + +### Fixed +- Fixed Python 3.13 compatibility issue with `blis==1.2.0` by documenting Python version requirements (3.9-3.11) +- Fixed `torch==2.4.1` installation by installing from PyTorch repository instead of PyPI +- Fixed NumPy 2.x compatibility issues by constraining to `numpy<2.0` for spacy/thinc compatibility +- Improved `setup.sh` with Python version detection and proper dependency installation order +- Updated README with comprehensive installation instructions and troubleshooting section + +### Changed +- Updated `requirements.txt` to remove torch (installed separately) and constrain NumPy version +- Enhanced `setup.sh` with error handling and version checking +- Updated README with Python version requirements and alternative installation methods + +### Added +- Added `.python-version` file to specify recommended Python version +- Added comprehensive troubleshooting section to README +- Added Python version detection in setup script + +### Technical Details +- **Python Compatibility**: Now explicitly supports Python 3.9, 3.10, and 3.11 +- **PyTorch Installation**: Uses PyTorch repository for better version compatibility +- **NumPy Version**: Constrained to <2.0 to avoid compatibility issues with spacy/thinc +- **Dependency Order**: Setup script now installs dependencies in correct order + diff --git a/README.md b/README.md index d9f8c6a..e460d28 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Transform AI-generated text into **formal, human-like, and academic writing** with ease, avoids AI detector! 🚀 ![Streamlit](https://img.shields.io/badge/Streamlit-Web_App-red?style=flat-square&logo=streamlit) -![Python](https://img.shields.io/badge/Python-3.10-blue?style=flat-square&logo=python) +![Python](https://img.shields.io/badge/Python-3.9%20%7C%203.10%20%7C%203.11-blue?style=flat-square&logo=python) ![License](https://img.shields.io/github/license/DadaNanjesha/AI-Text-Humanizer-App?style=flat-square) @@ -32,6 +32,11 @@ Building new version of this project here in this repos https://github.com/DadaN ## 📥 Installation +### ⚠️ Python Version Requirements +- **Required**: Python 3.9, 3.10, or 3.11 +- **Not supported**: Python 3.12+ (dependency compatibility issues) +- **Not supported**: Python 3.8 or earlier + ### 1️⃣ Clone the Repository ```bash git clone https://github.com/DadaNanjesha/AI-Text-Humanizer-App.git @@ -40,23 +45,51 @@ cd AI-Text-Humanizer-App ### 2️⃣ Set Up a Virtual Environment (Recommended) ```bash -python -m venv venv +python3.11 -m venv venv # Use Python 3.9, 3.10, or 3.11 source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows ``` ### 3️⃣ Install Dependencies + +**Option A: Using setup.sh (Recommended)** ```bash -pip install --upgrade pip -pip install -r requirements.txt +chmod +x setup.sh +./setup.sh ``` -### 4️⃣ Download NLP Models +**Option B: Manual Installation** ```bash +pip install --upgrade pip setuptools wheel + +# Install NumPy first (must be <2.0 for compatibility) +pip install "numpy<2.0" + +# Install PyTorch from PyTorch repository +pip install torch --index-url https://download.pytorch.org/whl/cpu + +# Install other dependencies +pip install -r requirements.txt + +# Download NLP models python -m spacy download en_core_web_sm -python -c "import nltk; nltk.download('punkt'); nltk.download('wordnet'); nltk.download('averaged_perceptron_tagger');" +python -c "import nltk; nltk.download('punkt', quiet=True); nltk.download('wordnet', quiet=True); nltk.download('averaged_perceptron_tagger', quiet=True)" ``` +### 🔧 Troubleshooting + +**Issue: `blis==1.2.0` installation fails** +- **Solution**: Use Python 3.9-3.11. Python 3.12+ is not supported. + +**Issue: `torch==2.4.1` not found** +- **Solution**: Install torch from PyTorch repository: `pip install torch --index-url https://download.pytorch.org/whl/cpu` + +**Issue: NumPy compatibility warnings** +- **Solution**: NumPy 2.x is not compatible. The setup script automatically installs NumPy <2.0. + +**Issue: spaCy model download fails** +- **Solution**: Ensure you have internet connection and try: `python -m spacy download en_core_web_sm` + --- ## 🖥️ Usage diff --git a/requirements.txt b/requirements.txt index b52a5672ec58f4f0aa1443b307e8d5bbc9e35b77..8656ba551067ecd1b49c46ba8f01a404e6a8e8fb 100644 GIT binary patch delta 385 zcmZ9H&1%9x6opS0wIJ;qhzz(kmM)7g;I50lKur9D(S&4TnuX+b3T^~nz+G2;7azfI z#!5kkn|pHSoR2%-y>tI?>O770rbw^H-_FltJCKo6rb3C9=#|Rw-O!z4S9p9u21xB^&%{o1^o3%jo$I)5OezKj^sUyTX?8pFr+}f&=puqXvs2;cnNC6 iNeR_}EIsBg;;spAy^^A^&;n;o*3uIk)p7s4d$<5fKufp) delta 55 zcmew$w?bya0XAM+23rOr20aMge4On#t9S`RK0^^hGD8MX3L&1 | awk '{print $2}' | cut -d. -f1,2) +PYTHON_MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1) +PYTHON_MINOR=$(echo $PYTHON_VERSION | cut -d. -f2) + +echo "📌 Detected Python version: $PYTHON_VERSION" + +# Check if Python version is compatible (3.9-3.11) +if [ "$PYTHON_MAJOR" -lt 3 ] || ([ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -lt 9 ]); then + echo "❌ Error: Python 3.9 or higher is required. Found Python $PYTHON_VERSION" + echo "Please upgrade Python to 3.9, 3.10, or 3.11" + exit 1 +fi + +if [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -gt 11 ]; then + echo "⚠️ Warning: Python 3.12+ detected. Some dependencies may not be compatible." + echo "Consider using Python 3.9-3.11 for best compatibility." + echo "Continuing with installation..." +fi + +# Upgrade pip +echo "📦 Upgrading pip..." +pip install --upgrade pip setuptools wheel + +# Install NumPy first (required for other packages, must be <2.0 for spacy compatibility) +echo "📦 Installing NumPy (compatible version)..." +pip install "numpy<2.0" + +# Install torch from PyTorch repository (handles version compatibility automatically) +echo "📦 Installing PyTorch (CPU version) from PyTorch repository..." +pip install torch --index-url https://download.pytorch.org/whl/cpu + +# Install other dependencies from requirements.txt +echo "📦 Installing other dependencies..." pip install -r requirements.txt -pip install streamlit spacy sentence-transformers nltk -echo "Installing spaCy model..." +# Download spaCy model +echo "📥 Downloading spaCy model (en_core_web_sm)..." python -m spacy download en_core_web_sm -python -m nltk.downloader all +# Download NLTK resources +echo "📥 Downloading NLTK resources..." +python -c "import nltk; nltk.download('punkt', quiet=True); nltk.download('wordnet', quiet=True); nltk.download('averaged_perceptron_tagger', quiet=True); nltk.download('punkt_tab', quiet=True); nltk.download('averaged_perceptron_tagger_eng', quiet=True)" || { + echo "⚠️ Warning: Some NLTK downloads may have failed, but continuing..." +} -echo "Downloading NLTK data..." -python -c "import nltk; nltk.download('punkt_tab', quiet=True); nltk.download('punkt', quiet=True); nltk.download('wordnet', quiet=True); nltk.download('averaged_perceptron_tagger', quiet=True)" +echo "" +echo "✅ Installation complete!" +echo "" +echo "🚀 To run the app:" +echo " streamlit run main.py" +echo "" From 046cb9ae05d3d2243e7913e486ffea7f385f7f05 Mon Sep 17 00:00:00 2001 From: akshaymittal143 Date: Tue, 11 Nov 2025 00:19:01 -0600 Subject: [PATCH 2/2] Fix .python-version file format --- .python-version | 1 - 1 file changed, 1 deletion(-) diff --git a/.python-version b/.python-version index 4feb2ff..2c07333 100644 --- a/.python-version +++ b/.python-version @@ -1,2 +1 @@ 3.11 -