Skip to content Skip to sidebar Skip to footer

Python3.6 Can Not Reopen .pyc File With Chinese Path

run pyc in cmd 1.with Chinese path py -3.6 'D:\实施项目\牡丹江高分农业示范\资料\clip.cpython-36.pyc' python: Can't reopen .pyc file 2.with English path py -3.6 'D:\

Solution 1:

This is because Python's default path encoding on Windows is ASCII, not UTF-8, and therefore Chinese symbols are treated as something like D:\Ko&z\Za@e -_~u\:;\clip.cpython-36.pyc, and the NTFS just cannot find such path and results in WinError, which is overlapped by python: can't reopen .pyc file in the console window. In fact, you just cannot open .pyc files in non-ASCII paths.


Workaround

Move your .pyc file into a directory which does NOT contain non-ASCII characters in its pathname, or create a symbolic link, junction point or a hardlink, to reflect your .pyc file into some other directory. But the most preferred way is to rename your pathname into a pathname without any non-ASCII characters, this will help others understand you in the Stack Overflow community

Post a Comment for "Python3.6 Can Not Reopen .pyc File With Chinese Path"