UltimaHoarder / UltimaScraper

Scrape all the media from an OnlyFans account - Updated regularly
GNU General Public License v3.0
4k stars 608 forks source link

Python 3.9 and 3.11 issues #1961

Closed frustra1 closed 1 year ago

frustra1 commented 1 year ago

Last night the scraper started crashing on me. I downloaded a fresh copy and started getting a message to use python version 3.9. I uninstalled version 3.11 and tried running the scraper again and was given this message

Traceback (most recent call last): File "C:\Users\Admin\Downloads\Compressed\OnlyFans-master\start_ofd.py", line 12, in main_test.check_config() File "C:\Users\Admin\Downloads\Compressed\OnlyFans-master\tests\main_test.py", line 23, in check_config import helpers.main_helper as main_helper File "C:\Users\Admin\Downloads\Compressed\OnlyFans-master\helpers\main_helper.py", line 1, in from database.databases.user_data.models.api_table import api_table File "C:\Users\Admin\Downloads\Compressed\OnlyFans-master\database\databases\user_data\models\api_table.py", line 6, in import sqlalchemy ModuleNotFoundError: No module named 'sqlalchemy'

since then I've gone back and forth installing different versions of Python and trying my best to troubleshoot but this is all pretty new to me so I think I've gotten as far as I can on my own. Does anybody have any ideas of what I could do to fix this?

arasakaxx commented 1 year ago

Same problem here. Does anyone know how to fix it?

icymelonpop commented 1 year ago

I'm noob, too. But i found solution On tests\main_test.py there's a function where it checks for python version. 1) open tests\main_test.py file 2) edit 12 line, ( if python_version < 3.9: -> if python_version < 3.0: )

RazeBerry commented 1 year ago

Quick Guide: Solving SQLAlchemy ModuleNotFoundError with Python Virtual Environment

Problem

You're receiving a ModuleNotFoundError when importing SQLAlchemy in your Python script, despite having SQLAlchemy installed in your virtual environment. This may be due to an alias overriding the Python executable in your virtual environment.

Solution

Step 1: Activate your Python virtual environment.

source venv/bin/activate

Step 2: Ensure SQLAlchemy is installed in the virtual environment.

pip install sqlalchemy

Step 3: Check if python points to the Python in your virtual environment.

which python

If it points to /usr/bin/python3 or similar, you have an alias for python that needs to be removed.

Step 4: Determine your shell (bash or zsh).

echo $SHELL

Step 5: Open your shell's configuration file (~/.bashrc for bash, ~/.zshrc for zsh).

nano ~/.bashrc   # or nano ~/.zshrc

Step 6: Find the line alias python=... and comment it out or delete it.

Step 7: Save and exit (Ctrl+X, Y, Enter in nano).

Step 8: Reload your shell's configuration.

source ~/.bashrc   # or source ~/.zshrc

Step 9: Close and reopen your terminal. Activate your virtual environment again. Now python should point to your virtual environment's Python.

Now, try running your script. SQLAlchemy should import without error.