bmxbmx3/cn_sort

小问题修一下

lonsty opened this issue · 3 comments

  1. setup.py install_requires 加入 openpyxl
>>> from cn_sort.process_cn_word import sort_word_list
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/site-packages/cn_sort/__init__.py", line 2, in <module>
    from .process_cn_word import *
  File "/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/site-packages/cn_sort/process_cn_word.py", line 8, in <module>
    import openpyxl
ModuleNotFoundError: No module named 'openpyxl'
  1. 文件路径兼容 Unix,\\ 改成 /

找不到文件导致的错误:

>>> from cn_sort.process_cn_word import sort_word_list
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/site-packages/cn_sort/__init__.py", line 2, in <module>
    from .process_cn_word import *
  File "/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/site-packages/cn_sort/process_cn_word.py", line 24, in <module>
    logging.config.fileConfig("".join([current_package_path, "\\res\\logging.conf"]))
  File "/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/logging/config.py", line 76, in fileConfig
    formatters = _create_formatters(cp)
  File "/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/logging/config.py", line 109, in _create_formatters
    flist = cp["formatters"]["keys"]
  File "/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/configparser.py", line 959, in __getitem__
    raise KeyError(key)
KeyError: 'formatters'

logging.config.fileConfig("".join([current_package_path, "\\res\\logging.conf"]))

/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/site-packages/cn_sort/process_cn_word.py:24:logging.config.fileConfig("".join([current_package_path, "\\res\\logging.conf"]))
/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/site-packages/cn_sort/process_cn_word.py:47:    all_word_json_path = "".join([current_package_path, "\\res\\all_word.json"])
/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/site-packages/cn_sort/process_cn_word.py:403:    logging_file_path = "".join([current_package_path, "\\res\\logging.conf"])  # 日志配置文件路径
/home/ubuntu/.pyenv/versions/3.6.13/lib/python3.6/site-packages/cn_sort/decorator.py:38:        logging.config.fileConfig("".join([current_package_path,"\\res\\logging.conf"]))

已修复,这个

抱歉啊,装饰器那边的日志路径忘记改了。

已经改完了