Skip to content
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: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' #202

Open
IamBusy opened this issue Oct 15, 2022 · 12 comments

Comments

@IamBusy
Copy link

IamBusy commented Oct 15, 2022

Follow the installation doc,I get the error:
python -m pip install -U zvt

Traceback (most recent call last):
  File "/Users/william/development/python/py3.10/bin/zvt", line 5, in <module>
    from zvt.main import main
  File "/Users/william/development/python/py3.10/lib/python3.10/site-packages/zvt/main.py", line 1, in <module>
    import dash_bootstrap_components as dbc
  File "/Users/william/development/python/py3.10/lib/python3.10/site-packages/dash_bootstrap_components/__init__.py", line 6, in <module>
    from . import _components
  File "/Users/william/development/python/py3.10/lib/python3.10/site-packages/dash_bootstrap_components/_components/__init__.py", line 1, in <module>
    from .Alert import Alert
  File "/Users/william/development/python/py3.10/lib/python3.10/site-packages/dash_bootstrap_components/_components/Alert.py", line 3, in <module>
    from dash.development.base_component import Component, _explicitize_args
  File "/Users/william/development/python/py3.10/lib/python3.10/site-packages/dash/__init__.py", line 1, in <module>
    from .dash import Dash, no_update  # noqa: F401
  File "/Users/william/development/python/py3.10/lib/python3.10/site-packages/dash/dash.py", line 22, in <module>
    from werkzeug.debug.tbtools import get_current_traceback
ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' (/Users/william/development/python/py3.10/lib/python3.10/site-packages/werkzeug/debug/tbtools.py)
@foolcage
Copy link
Member

@IamBusy please use python 3.8

@xinmans
Copy link

xinmans commented Oct 19, 2022

python3 -V
Python 3.8.10 also have same problem

@xinmans
Copy link

xinmans commented Oct 19, 2022

any docker image can be used

@xinmans
Copy link

xinmans commented Oct 19, 2022

SinaBlockRecorder:Block
SinaChinaBlockStockRecorder:BlockStock
Traceback (most recent call last):
File "/usr/local/bin/zvt", line 5, in
from zvt.main import main
File "/usr/local/lib/python3.8/site-packages/zvt/main.py", line 1, in
import dash_bootstrap_components as dbc
File "/usr/local/lib/python3.8/site-packages/dash_bootstrap_components/init.py", line 6, in
from . import _components
File "/usr/local/lib/python3.8/site-packages/dash_bootstrap_components/_components/init.py", line 1, in
from .Alert import Alert
File "/usr/local/lib/python3.8/site-packages/dash_bootstrap_components/_components/Alert.py", line 3, in
from dash.development.base_component import Component, _explicitize_args
File "/usr/local/lib/python3.8/site-packages/dash/init.py", line 1, in
from .dash import Dash, no_update # noqa: F401
File "/usr/local/lib/python3.8/site-packages/dash/dash.py", line 22, in
from werkzeug.debug.tbtools import get_current_traceback
ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' (/usr/local/lib/python3.8/site-packages/werkzeug/debug/tbtools.py)

@JY0284
Copy link

JY0284 commented Oct 19, 2022

@IamBusy @xinmans I have met the same problem in Python 3.8 and solved it by:

pip uninstall werkzeug
pip install -v https://github.com/pallets/werkzeug/archive/refs/tags/2.0.1.tar.gz

Solution from https://stackoverflow.com/questions/71654590/dash-importerror-cannot-import-name-get-current-traceback-from-werkzeug-debu.

@xinmans
Copy link

xinmans commented Oct 22, 2022

@IamBusy @xinmans I have met the same problem in Python 3.8 and solved it by:

pip uninstall werkzeug
pip install -v https://github.com/pallets/werkzeug/archive/refs/tags/2.0.1.tar.gz

Solution from https://stackoverflow.com/questions/71654590/dash-importerror-cannot-import-name-get-current-traceback-from-werkzeug-debu.

Traceback (most recent call last):
File "/usr/local/bin/zvt", line 5, in
from zvt.main import main
File "/usr/local/lib/python3.8/site-packages/zvt/main.py", line 1, in
import dash_bootstrap_components as dbc
File "/usr/local/lib/python3.8/site-packages/dash_bootstrap_components/init.py", line 6, in
from . import _components
File "/usr/local/lib/python3.8/site-packages/dash_bootstrap_components/_components/init.py", line 1, in
from .Alert import Alert
File "/usr/local/lib/python3.8/site-packages/dash_bootstrap_components/_components/Alert.py", line 3, in
from dash.development.base_component import Component, _explicitize_args
File "/usr/local/lib/python3.8/site-packages/dash/init.py", line 1, in
from .dash import Dash, no_update # noqa: F401
File "/usr/local/lib/python3.8/site-packages/dash/dash.py", line 20, in
import flask
File "/usr/local/lib/python3.8/site-packages/flask/init.py", line 4, in
from . import json as json
File "/usr/local/lib/python3.8/site-packages/flask/json/init.py", line 8, in
from ..globals import current_app
File "/usr/local/lib/python3.8/site-packages/flask/globals.py", line 56, in
app_ctx: "AppContext" = LocalProxy( # type: ignore[assignment]

@xinmans
Copy link

xinmans commented Oct 22, 2022

python3 -m pip install --upgrade werkzeug==2.0.3
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting werkzeug==2.0.3
Downloading https://mirrors.aliyun.com/pypi/packages/f4/f3/22afbdb20cc4654b10c98043414a14057cd27fdba9d4ae61cea596000ba2/Werkzeug-2.0.3-py3-none-any.whl (289 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 289.2/289.2 kB 2.9 MB/s eta 0:00:00
Installing collected packages: werkzeug
Attempting uninstall: werkzeug
Found existing installation: Werkzeug 2.2.2
Uninstalling Werkzeug-2.2.2:
Successfully uninstalled Werkzeug-2.2.2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
flask 2.2.2 requires Werkzeug>=2.2.2, but you have werkzeug 2.0.3 which is incompatible.
Successfully installed werkzeug-2.0.3

/mydev/zvt$ zvt
{'data_path': '/home/xinmans/zvt-home/data',
'log_path': '/home/xinmans/zvt-home/logs',
'tmp_path': '/home/xinmans/zvt-home/tmp',
'ui_path': '/home/xinmans/zvt-home/ui',
'zvt_home': '/home/xinmans/zvt-home'}
2022-10-22 20:28:14,404 INFO MainThread init config for zvt, current_config:{}
{}
2022-10-22 20:28:14,405 INFO MainThread current_config:{}
JoinquantIndexMoneyFlowRecorder:IndexMoneyFlow
{'password': '', 'token': '', 'username': ''}
JoinquantStockMoneyFlowRecorder:StockMoneyFlow
JoinquantHkHolderRecorder:HkHolder
JqChinaIndexKdataRecorder:IndexKdataCommon
JqChinaStockKdataRecorder:StockKdataCommon
JqChinaStockRecorder:Stock
JqChinaEtfRecorder:Etf
JqChinaStockEtfPortfolioRecorder:EtfStock
JqChinaFundRecorder:Fund
JqChinaFundStockRecorder:FundStock
StockTradeDayRecorder:StockTradeDay
MarginTradingRecorder:MarginTrading
JqChinaStockValuationRecorder:StockValuation
JqChinaEtfValuationRecorder:EtfValuation
MarginTradingSummaryRecorder:MarginTradingSummary
StockSummaryRecorder:StockSummary
CrossMarketSummaryRecorder:CrossMarketSummary
ExchangeIndexRecorder:Index
ExchangeIndexStockRecorder:IndexStock
ChinaETFListSpider:EtfStock
ExchangeStockMetaRecorder:Stock
ExchangeStockSummaryRecorder:StockSummary
EMStockKdataRecorder:StockKdataCommon
EMStockusKdataRecorder:StockusKdataCommon
EMStockhkKdataRecorder:StockhkKdataCommon
EMIndexKdataRecorder:IndexKdataCommon
EMIndexusKdataRecorder:IndexusKdataCommon
EMBlockKdataRecorder:BlockKdataCommon
EMFutureKdataRecorder:FutureKdataCommon
EMCurrencyKdataRecorder:CurrencyKdataCommon
EMIndexRecorder:Index
EMStockusRecorder:Stockus
EMCurrencyRecorder:Currency
EMStockhkRecorder:Stockhk
EMBlockRecorder:Block
EMFutureRecorder:Future
EMIndexusRecorder:Indexus
EMStockRecorder:Stock
EMTreasuryYieldRecorder:TreasuryYield
EMStockNewsRecorder:StockNews
EMDragonAndTigerRecorder:DragonAndTiger
EMStockTopTenFreeRecorder:StockTopTenFreeHolder
EMStockActorSummaryRecorder:StockActorSummary
EMStockTopTenRecorder:StockTopTenHolder
EMStockIIRecorder:StockInstitutionalInvestorHolder
WBCountryRecorder:Country
WBEconomyRecorder:Economy
EastmoneyBlockRecorder:Block
EastmoneyBlockStockRecorder:BlockStock
EastmoneyStockRecorder:Stock
EastmoneyStockDetailRecorder:StockDetail
TopTenHolderRecorder:TopTenHolder
TopTenTradableHolderRecorder:TopTenTradableHolder
EastmoneyActorRecorder:ActorMeta
ChinaStockFinanceFactorRecorder:FinanceFactor
ChinaStockIncomeStatementRecorder:IncomeStatement
ChinaStockBalanceSheetRecorder:BalanceSheet
ChinaStockCashFlowRecorder:CashFlowStatement
DividendDetailRecorder:DividendDetail
DividendFinancingRecorder:DividendFinancing
RightsIssueDetailRecorder:RightsIssueDetail
SPODetailRecorder:SpoDetail
ManagerTradingRecorder:ManagerTrading
HolderTradingRecorder:HolderTrading
ChinaETFDayKdataRecorder:Etf1dKdata
ChinaIndexDayKdataRecorder:Index1dKdata
SinaBlockMoneyFlowRecorder:BlockMoneyFlow
SinaStockMoneyFlowRecorder:StockMoneyFlow
SinaBlockRecorder:Block
SinaChinaBlockStockRecorder:BlockStock
Traceback (most recent call last):
File "/home/xinmans/.local/bin/zvt", line 5, in
from zvt.main import main
File "/home/xinmans/.local/lib/python3.8/site-packages/zvt/main.py", line 1, in
import dash_bootstrap_components as dbc
File "/home/xinmans/.local/lib/python3.8/site-packages/dash_bootstrap_components/init.py", line 6, in
from . import _components
File "/home/xinmans/.local/lib/python3.8/site-packages/dash_bootstrap_components/_components/init.py", line 1, in
from .Alert import Alert
File "/home/xinmans/.local/lib/python3.8/site-packages/dash_bootstrap_components/_components/Alert.py", line 3, in
from dash.development.base_component import Component, _explicitize_args
File "/home/xinmans/.local/lib/python3.8/site-packages/dash/init.py", line 1, in
from .dash import Dash, no_update # noqa: F401
File "/home/xinmans/.local/lib/python3.8/site-packages/dash/dash.py", line 20, in
import flask
File "/home/xinmans/.local/lib/python3.8/site-packages/flask/init.py", line 4, in
from . import json as json
File "/home/xinmans/.local/lib/python3.8/site-packages/flask/json/init.py", line 8, in
from ..globals import current_app
File "/home/xinmans/.local/lib/python3.8/site-packages/flask/globals.py", line 56, in
app_ctx: "AppContext" = LocalProxy( # type: ignore[assignment]
TypeError: init() got an unexpected keyword argument 'unbound_message'

@xinmans
Copy link

xinmans commented Jan 19, 2023

python3 -m pip install --upgrade flask==2.1.3 to fix it, now can work

refer: https://stackoverflow.com/questions/73337927/typeerror-init-got-an-unexpected-keyword-argument-unbound-message

@davidmartinrius
Copy link

@xinmans thank you, I had the same issue and your comments helped me to solve it.

@foolcage
Copy link
Member

Would update all the related dep soon, would solve this problem.

@huanzhijin
Copy link

3.7 3.8 3.10都启动不了

@xayjin
Copy link

xayjin commented Apr 25, 2023

pip install flask==2.1.3 werkzeug==2.0.1

这样就可以了,刚试了成功。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants