我想知道为什么我不能import GoogleStockDataExtract from google_screener_data_extract
。感谢任何帮助或建议。步骤如下。
pip install google_screener_data_extract
from google_screener_data_extract import GoogleStockDataExtract
from google_screener_data_extract import GoogleStockDataExtract
Traceback (most recent call last):
File "C:\Users\voyma\Anaconda3\envs\Python_ST\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-27-aff6e099a353>", line 1, in <module>
from google_screener_data_extract import GoogleStockDataExtract
File "C:\Users\voyma\Anaconda3\envs\Python_ST\lib\site-packages\google_screener_data_extract\__init__.py", line 1, in <module>
from .google_screener_data_extract import GoogleStockDataExtract
File "C:\Users\voyma\Anaconda3\envs\Python_ST\lib\site-packages\google_screener_data_extract\google_screener_data_extract.py", line 158
print hh.result_google_ext_df.head()
^
SyntaxError: invalid syntax
答案 0 :(得分:0)
您是否正在使用Python 3?您可以根据python --version
看起来google_screener_data_extract
声称与Python 3兼容,但是this line无效的Python 3代码:
print hh.result_google_ext_df.head()
应为:
print(hh.result_google_ext_df.head())
该项目三年没有更新,所以最好的选择是分叉,进行更改并使用分叉。