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

安装遇到的问题并解决办法 #11

Open
suifengdou opened this issue Jan 7, 2024 · 1 comment
Open

安装遇到的问题并解决办法 #11

suifengdou opened this issue Jan 7, 2024 · 1 comment

Comments

@suifengdou
Copy link

今天安装了一天,遇到了几个问题,分享一下,方便后面类似遇到的同学。

1. python的版本问题:

  • 测试了多个python版本,最终完美的版本是3.11
  • 3.12版本imp模块已被移除。虽然官方有替代方案,我捣鼓半天失败了:(

2. pyahocorasick的安装问题:

  • AHOCORASICK_BYTES=1 pip install git+https://github.com/WojciechMula/pyahocorasick.git,我在虚拟环境下没有安装成功。
  • 我的摸索的方法,先git clone https://github.com/WojciechMula/pyahocorasick.git
  • 然后进入目录,打开setup.py。build_as_bytes 这个变量直接设置为True。保证AHOCORASICK_BYTES安装
  • 直接python setup.py install,当然,还需要一个C++的库,这个直接按照错误提示下载安装就好了,这个简单,就是有点大。

3. 会提示GBK编码问题(这个应该就是在windows中存在):

  • pieces = json.load(open(pieces))直接指定编码: pieces = json.load(open(pieces, encoding="utf-8"))
@bojone
Copy link
Owner

bojone commented Jan 17, 2024

非常感谢,已经很多年没有windows开发经验了😂

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

2 participants