Python Module with a dash, or hyphen (-) in its name

前端 未结 3 524
抹茶落季
抹茶落季 2020-11-28 12:43

I have an existing python module with a dash in its name, foo-bar.py

Changing the module name is something I would prefer to avoid as the module is shared, and I wou

3条回答
  •  [愿得一人]
    2020-11-28 13:01

    Try using underscore instead of a hyphen.

    import pymysql_utils

    worked for me even though import pymysql-utils was the name of the module used by pip

提交回复
热议问题