简体   繁体   中英

python3 ImportError: cannot import name 'rand_str'

Im getting this error when starting my software i dont know how to repair this

Traceback (most recent call last):
  File "/root/findex/lib/python3.5/site-packages/findex_gui/main.py", line 208, in web
    run_async()
  File "/root/findex/lib/python3.5/site-packages/findex_gui/main.py", line 201, in run_async
    from findex_gui.web import app
  File "/root/findex/lib/python3.5/site-packages/findex_gui/web.py", line 41, in <module>
    from findex_gui.orm.connect import Database
  File "/root/findex/lib/python3.5/site-packages/findex_gui/orm/connect.py", line 12, in <module>
    from findex_gui.orm.models import BASE
  File "/root/findex/lib/python3.5/site-packages/findex_gui/orm/models.py", line 22, in <module>
    from findex_common.utils import rand_str
ImportError: cannot import name 'rand_str'

I'm not familiar with the libraries in question, but it seems the maintainer renamed this function in 0.15.14 of findex-common here: development

This has been adjusted for in findex-gui on the master branch though it seems it has not seen a release. Here's the commit which fixes the import: Forgot what I was doing - Ill just push it all ¯_(ツ)_/¯

One short term fix would be to downgrade to findex-common==0.15.13 and perhaps follow up by raising an issue on either project since the change seems non-ideal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM