-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError not clear when causing by import lxml failed #69
Comments
Hi @HANK538, You should not install "analytics", which is not used by twstock, twstock is using its analytics module ( You can remove the analytics package by Anyway, it is encouraged to use |
Hi mlouielu Thanks for your reply. Traceback (most recent call last): Any solution? |
Hi @HANK538 I suggest you can open the file "C:\Users\10802304\AppData\Roaming\Python\Python37\site-packages\twstock\stock.py", and find maybe at line 16 have this: try:
from . import analytics
from .codes import codes
except ImportError:
import analytics
from codes import codes Please replace it to this try:
from . import analytics
from .codes import codes
except ImportError as e:
print('Error: ', e)
import analytics
from codes import codes Check and paste the otuput of what causing this ImportError, thanks |
Thank you for the prompt reply! ModuleNotFoundError: No module named 'lxml' It works now after installed twstock and lxml package. By the way, I just followed below blog so that's why I installed analytics package. Thanks a lot. |
Thanks for your reply, this should consider as a bug that not intent to be (Is because the dependency lxml didn't install, not because import relative package causing an error). I'll reopen this issue to fix it. |
Hi
I already installed package as below
pip install twstock
pip install analytics
But when I start coding via import twstock
Traceback (most recent call last):
File "d:/Project/A00 Test/stock.py", line 1, in
import twstock
File "C:\Users\10802304\AppData\Roaming\Python\Python37\site-packages\twstock_init_.py", line 3, in
from twstock import stock
File "C:\Users\10802304\AppData\Roaming\Python\Python37\site-packages\twstock\stock.py", line 20, in
import analytics
File "C:\Users\10802304\AppData\Local\Continuum\anaconda3\lib\site-packages\analytics_init_.py", line 23
except Exception, e:
^
SyntaxError: invalid syntax
It seems analytics is incompatible with twstock due to using python2 older version.
Any idea?
The text was updated successfully, but these errors were encountered: