How to deal with sudden exceptions in python
三叔
三叔 2017-06-12 09:22:52
0
1
1093

1. When using RF automation, python suddenly reports the following error. It has occurred once before. It is suspected that the file is damaged due to an exception in the RF framework. The previous solution was to reinstall python and rf

D:\python27\Scripts>python
Traceback (most recent call last):
  File "D:\python27\lib\site.py", line 62, in <module>
    import os
  File "D:\python27\lib\os.py", line 63, in <module>
    import ntpath as path
  File "D:\python27\lib\ntpath.py", line 15, in <module>
    from genericpath import _unicode
ImportError: cannot import name _unicode

If anyone has encountered it, please help me find out how to deal with it!

三叔
三叔

reply all(1)
仅有的幸福

I searched for a long time but couldn’t find a solution, so I finally deleted it and reinstalled it.
Note here when reinstalling:

    1、提前将site-package里面的文件保存
    2、将d:\python27下所有文件删除
    3、重新安装python,如果安装界面提示的是change、repair、remove,选择repair,完成后,再重新安装执行remove,完成后再重新安装,安装界面应该就是正常的安装步骤了
    4、安装wxpython 一般是这个文件名 wxPython2.8-win32-unicode-2.8.12.1-py27.exe
    4、将之前的site-packages里的文件覆盖到对应文件夹下
    5、重新安装robotframework robotframework-ride ,如果提示已安装,使用命令 pip uninstall xx卸载后,重新安装。
    6、最后cmd中 d:python27\scripts\python ride.py
    It's done
    附带文件目录:
    robotframework-ride (1.5.2.1)
    robotframework-sshlibrary (2.1.2)
    wxPython2.8-win32-unicode-2.8.12.1-py27.exe
    python2.7.11
    
    
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template