zvt icon indicating copy to clipboard operation
zvt copied to clipboard

ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools'

Open IamBusy opened this issue 2 years ago • 12 comments

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)

IamBusy avatar Oct 15 '22 09:10 IamBusy

@IamBusy please use python 3.8

foolcage avatar Oct 17 '22 08:10 foolcage

python3 -V Python 3.8.10 also have same problem

xinmans avatar Oct 19 '22 13:10 xinmans

any docker image can be used

xinmans avatar Oct 19 '22 13:10 xinmans

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)

xinmans avatar Oct 19 '22 14:10 xinmans

@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.

JY0284 avatar Oct 19 '22 15:10 JY0284

@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 avatar Oct 22 '22 11:10 xinmans

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 avatar Oct 22 '22 12:10 xinmans

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

xinmans avatar Jan 19 '23 11:01 xinmans

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

davidmartinrius avatar Jan 20 '23 10:01 davidmartinrius

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

foolcage avatar Jan 29 '23 03:01 foolcage

3.7 3.8 3.10都启动不了

huanzhijin avatar Apr 14 '23 03:04 huanzhijin

pip install flask==2.1.3 werkzeug==2.0.1

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

xayjin avatar Apr 25 '23 03:04 xayjin