Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Help - I corrupted my Pythonista somehow
-
I am not sure how I have managed to do this. But I have corrupted my Pythonista v311008. If I import json I get the below traceback. I only get the traceback after I restart, because if I tap the print traceback the app quits. The corruption seems to be limited to importing json. I had been playing with shelve when the Corruption started ( I was using faker and adding a lot of records into shelve).
Not sure if there is an easy way to fix this. I don't want to delete the app. My thoughts are that I download the App Store version, then install the test flight version after. Just wanted to ask first, so I don't screw it up.--edit if I run with 2.7, I don't get the problem. Also I should mention I did a full restart of my ipad
Traceback (most recent call last):
File "/var/containers/Bundle/Application/EA1EEECB-E4B2-4C5F-ACE0-B7287FEACF04/Pythonista3.app/Frameworks/Py3Kit.framework/pykit_startup.py", line 51, in <module>
main()
File "/var/containers/Bundle/Application/EA1EEECB-E4B2-4C5F-ACE0-B7287FEACF04/Pythonista3.app/Frameworks/Py3Kit.framework/pykit_startup.py", line 47, in main
import importcompletion
File "/var/containers/Bundle/Application/EA1EEECB-E4B2-4C5F-ACE0-B7287FEACF04/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/importcompletion.py", line 26, in <module>
import imp
File "/var/containers/Bundle/Application/EA1EEECB-E4B2-4C5F-ACE0-B7287FEACF04/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/imp.py", line 28, in <module>
import tokenize
File "/var/containers/Bundle/Application/EA1EEECB-E4B2-4C5F-ACE0-B7287FEACF04/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/tokenize.py", line 34, in <module>
import re
File "/var/containers/Bundle/Application/EA1EEECB-E4B2-4C5F-ACE0-B7287FEACF04/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/re.py", line 143, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag' -
in Safari, go to the following URLs:
-
@ccc , sorry I was not clear. I am not locked out of Pythonista, but I have corrupted the json lib by the looks of things. I can use it anymore. Just importing it creates the error
-
Possibly using stash to update it may work, but i was unsure. Might make things worse
-
Did you quit Pythonista and try my suggestions anyway?
-
@ccc , yes i did. The first 2 cmds load Pythonista 2 app which i still have. But i did try it in case there was some magic I didn't know about. I also disabled my startup script.
-
@Phuket2 Do you have an
enum.py
module orenum
folder in yoursite-packages
orsite-packages-3
?enum.IntFlag
(the class that's missing and causing the exception) is new in Python 3.6, so if you manually installed a different version of theenum
module previously, you need to delete it or update it. -
@dgelessus , i have a enum folder in my site-packages folder. Should I just delete it? I didn't Install it directly, maybe a package i installed, installed it
-
Rename
enum
in your site-packages towas-enum
and completely reboot. -
@ccc , thanks , that fixed it. Not sure how that enum dir got in there. I was using shelve and json. But fixed now, and it inspired me to do a full backup :)