Comments (5)
Hi @HANK538,
You should not install "analytics", which is not used by twstock, twstock is using its analytics module (twstock/analytics.py
), since you install analytics
package (pip install analytics
), it caused python to find another package.
You can remove the analytics package by $ pip uninstall analytics
, it should solved this issue.
Anyway, it is encouraged to use $ python -m pip ...
to execute pip, since using pip
alone you will not sure which python interpreter is been used for the pip.
from twstock.
Hi mlouielu
Thanks for your reply.
But I encountered below issue after uninstalled analytics.
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 21, in
from codes import codes
ModuleNotFoundError: No module named 'codes'
Any solution?
from twstock.
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
from twstock.
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.
http://yhhuang1966.blogspot.com/2019/04/twstock.html
Thanks a lot.
from twstock.
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.
from twstock.
Related Issues (20)
- twstock.realtime.get() 查無資料 HOT 19
- 有提供盤中零股五檔報價功能嗎
- fetch 時間頗久
- 股票 1102 抓取1年內的資料遇到問題
- 抓取00878 30日收盤價 出現錯誤 HOT 1
- 取得資料和預期的不一致(證交所問題) HOT 2
- realtime 的 latest_trade_price 並未顯示查詢時最後的成交價 HOT 1
- 連線嘗試失敗 HOT 3
- SSL: CERTIFICATE_VERIFY_FAILED HOT 2
- realtime SSL issue HOT 1
- 我第一次要執行,發現股票清單比較舊,執行twstock -U卻始終timeout HOT 1
- stockcode '00878', '6669' 讀不到 HOT 2
- http.client.RemoteDisconnected: Remote end closed connection without response
- 請問可以查詢ETF嗎 HOT 4
- 抓取大盤指數
- 查詢代號:1795時程式會出現錯誤 HOT 6
- realtime的latest_trade_price股價為 '-'
- Config file pyproject.toml does not exist after $flit init HOT 2
- 60日線 跟 240日線 無法顯示 HOT 2
- Unittest 總是遇到 AssertError HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twstock.