Closed TeslaLyon closed 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.
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.
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.
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)