3

I am trying to use py2app to generate a App. it constantly throws out this error "module 'string' has no attribute 'maketrans'.

Python version: 3.54

  File "/Users/Kevin_t/opt/anaconda3/envs/python3/lib/python3.5/site-packages/py2app/build_app.py", line 838, in run
    self._run()
  File "/Users/Kevin_t/opt/anaconda3/envs/python3/lib/python3.5/site-packages/py2app/build_app.py", line 1053, in _run
    self.run_normal()
  File "/Users/Kevin_t/opt/anaconda3/envs/python3/lib/python3.5/site-packages/py2app/build_app.py", line 1266, in run_normal
    o = __import__(m1, fromlist=[m2])
  File "/Users/Kevin_t/opt/anaconda3/envs/python3/lib/python3.5/site-packages/PyQt5/uic/port_v2/ascii_upper.py", line 27, in <module>
    _ascii_trans_table = string.maketrans(string.ascii_lowercase,
AttributeError: module 'string' has no attribute 'maketrans'

I looked into the source code. it seems that it is originated from this function "ascii_upper". This part is from the python source code. I am not sure how can I fix this error.

I found some other questions on this site about similar error message. AttributeError: 'module' object has no attribute 'maketrans' The suggestion is to change some line in this folder/usr/lib64/python3.2/site-packages/gi/module.py.

However, the above fix was intended for python 3.2, and I could not find similar gi/module.py file in my python 3.54 package. I also tried changing to different python version. (3.4/3.6/3.7) they have some the same issue. I also tried different py2app version. (0.7, 0.14,0.19). I still could not fix it. So I am kind of stuck.

I would really appreciates some helps!

ascii_upper

Kevin T
  • 43
  • 1
  • 5

0 Answers0