First, let's take a look at the error. This was encountered during the upgrade from Ubuntu 13.04 to 13.10, as shown below:
Traceback (most recent call last ):
File "/usr/lib/python2.7/runpy. py", line 162, in _ run_module_as_main
"_ Main _", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy. py", line 72, in _ run_code
Exec code in run_globals
File "/usr/lib/python2.7/py_compile.py", line 183, in <module>
Sys. exit (main ())
File "/usr/lib/python2.7/py_compile.py", line 165, in main
Compile (filename, doraise = True)
File "/usr/lib/python2.7/py_compile.py", line 136, in compile
OS. rename (path_tmp, cfile)
OSError: [Errno 21] Is a directory
Dpkg: error processing scons (-- configure ):
The subprocess has installed the post-installation script and Returns Error 101.
An error occurred during processing:
Scons
After reading the above information, I first thought of google to see if there is any solution. After looking for a while, I felt that I had little hope. So I began to find a solution myself. Fortunately, it was the step of python, in addition, there is a detailed traceback. As for what scons, there are a lot to look for on the Internet, it is a tool for generating compilation projects automatically.
The following describes in detail the process and ideas for solving this problem:
Use traceback to locate the number of lines in the file/usr/lib/python2.7/py_compile.py. Mine is 136. the corresponding error function is OS. rename (path_tmp, cfile), and provides detailed error information, which is a directory. The rename function of python requires that both files be used. Knowing this, I added two lines of code before the OS. rename function in the source code, namely print path_tmp and print cfile. Finally, the wrong file name path is output through these two codes. Then, go to the path and check that the corresponding renamed file is a directory (the target file name already exists and is a directory ), so an error is reported. There are two other empty directories. Of course, I don't know how these two empty directories come from. If I find the problem, it will be much simpler and I will delete the corresponding empty directories, reinstall everything.
The key to solving the problem is to find the correct solution. Otherwise, it will not be able to solve the problem effectively if you waste a lot of time. Let's talk about an error and solution that we often encounter when upgrading ubuntu software,
The problem is: failed download of an upgraded software package (deb package), the failure information will give the specific url Connection.
Solution: manual download, through wget url, basically will not fail. Copy all downloaded packages to the/var/cache/apt/archives/directory and run the upgrade command again.
For more information about how to install Ubuntu 13.10 on a hard drive in Windows 7, see
Ubuntu 13.10 download, installation, and configuration summary page
Configure root login in Ubuntu 13.10
Use fcitx Input Method in Ubuntu 13.10
Ubuntu 13.10 compilation and installation of Wine 1.7