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

detail = re.sub(ur'(\(.{1}\))\[([^倫]{1})\]([^\b\r\n])',r'[\2]\n\1\3', detail) SyntaxError: invalid syntax #36

Open
net-wayfarer opened this issue Sep 30, 2023 · 1 comment

Comments

@net-wayfarer
Copy link

系統: Linux
Python3 版本: 3.11
pip3 版本: 23.2.1
setuptools 版本: 65.5.0
xlrd3 版本: 1.1.0

Steps to reproduce:

$ git clone https://github.com/g0v/moedict-process.git ; cd moedict-process
$ mkdir dict_revised ; wget https://raw.githubusercontent.com/g0v/moedict-data/master/dict_revised/dict_revised_1.xlsx -O dict_revised/dict_revised_1.xlsx
$ python -m venv .venv
$ source .venv/bin/activate
(.venv) $ pip3 --require-virtualenv install -r requirements.txt
Collecting xlrd3==1.1.0 (from -r requirements.txt (line 1))
  Downloading xlrd3-1.1.0-py2.py3-none-any.whl (105 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 105.3/105.3 kB 486.5 kB/s eta 0:00:00
Installing collected packages: xlrd3
Successfully installed xlrd3-1.1.0
(.venv) $ make json
python parse.py
  File "/home/user/Projects/moedict-process/parse.py", line 84
    detail = re.sub(ur'(\(.{1}\))\[([^倫]{1})\]([^\b\r\n])',r'[\2]\n\1\3', detail)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax
make: *** [Makefile:8: dict-revised.json] Error 1
(.venv) $ pip3 list
Package    Version
---------- -------
pip        23.2.1
setuptools 65.5.0
xlrd3      1.1.0

爲了需要xlrd3版本是比較老的版本,和Python3當時改變 (英文)用virtualenv來代替這些問題。可是改了requirements.txt使用新的版本還是會出現同樣的問題。

@lanfon72
Copy link
Contributor

lanfon72 commented Oct 3, 2023

parser 使用的版本是 python2 (是的沒有錯...)
雖然有點強人所難,但也許在你的環境上用 python2 跑看看?

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