lossless1024 / StreaMonitor

Adult live stream downloader for advanced people. I could have chosen a better name.
GNU General Public License v3.0
173 stars 42 forks source link

help please #59

Closed TeslaLyon closed 1 year ago

TeslaLyon commented 1 year ago

run: python Downloader.py

log: Traceback (most recent call last): File "/Users/liangshuo/code/py-project/StreaMonitor/Downloader.py", line 9, in import streamonitor.sites # must have File "/Users/liangshuo/code/py-project/StreaMonitor/streamonitor/sites/init.py", line 7, in from . import * AttributeError: partially initialized module 'streamonitor.sites' has no attribute '' (most likely due to a circular import)

DerBunteBall commented 1 year ago

Which Python version do you use?

Tested codebase on 3.11.1 in fresh Python Environment which works.

You could try to comment out line 7 in __init__.py in ./streamonitor/sites/ Folder.

I think the

from . import *

is interpreted as a self import of the package. This can be a problem of the Python version or the interpreter configuration. Normally the init file already leads to the import.

The best way is using a Python environment. Checkout pyenv with Homebrew. Make sure to have Xcode Command Line Tools installed to have Xcode SDK.

TeslaLyon commented 1 year ago

Thanks for the reply, I created a new folder and re-pulled the code, the result is normal operation, I still don't know what caused the problem.

DerBunteBall commented 1 year ago

Eventually incompatible cache files after a python version update (more something like 3.8 to 3.10 or so). Also corrupted cache files could lead to strange effects. Eventually a cleanup of them helps.

Cache files are located in __pycache__ folder and have .pyc extension. They contain the byte code. Very simple: They are used to run to make things faster. Also look here.