chris-greening/instascrape

Import Error cannot import name 'exceptions' from 'instascrape.exceptions'

jcesteves opened this issue · 6 comments

Hey there @jcesteves , thanks for bringing this to my attention. I'm not able to reproduce this error on my machine, could you provide more context for the error occurring? The stack trace or general context surrounding the error appearing should be good

Hi, maybe your python version is lower than 3.7 in this case you should upgrade it to use this library.

Hi @chris-greening thanks for this amazing project :) I want to use it and I create a new Python project from scratch to do some tests with this library but I can't follow the examples by the same reason of @jcesteves problem:

Python 3.8.6 (default, Sep 30 2020, 04:00:38) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from instascrape import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/olidroide/python/tests/venv/lib/python3.8/site-packages/instascrape/__init__.py", line 1, in <module>
    from instascrape.scrapers import *
  File "/home/olidroide/python/tests/venv/lib/python3.8/site-packages/instascrape/scrapers/__init__.py", line 5, in <module>
    from instascrape.scrapers.hashtag import *
  File "/home/olidroide/python/tests/venv/lib/python3.8/site-packages/instascrape/scrapers/hashtag.py", line 12, in <module>
    from instascrape.core._static_scraper import _StaticHtmlScraper
  File "/home/olidroide/python/tests/venv/lib/python3.8/site-packages/instascrape/core/_static_scraper.py", line 15, in <module>
    from instascrape.exceptions.exceptions import InstagramLoginRedirectError
ModuleNotFoundError: No module named 'instascrape.exceptions'

I have a venv with these dependencies installed

Package        Version
-------------- ---------
beautifulsoup4 4.9.3
certifi        2020.11.8
chardet        3.0.4
idna           2.10
insta-scrape   1.2.1
pip            20.2.4
requests       2.24.0
setuptools     50.3.2
soupsieve      2.0.1
urllib3        1.25.11

I could provide any information as you need it, I'm on Python3.8 with Manjaro OS

Thanks for all!

Very strange @olidroide! Thanks so much for bringing this to my attention, I'm gonna get to the bottom of this right now and will update with my findings

@olidroide okay, it should be good to go. Really finnicky situation but I think there's a circular import situation going on somewhere that I have to track down; I commented out anything involving custom exceptions for the time being 🤠

Anyways, thank you for your patience!!! I'm going to work on updating/adding examples right now so keep an eye out for that 😄

Thanks @chris-greening for your time and your contibution :)