[Tutor] IOError when importing nose

Albert-Jan Roskam fomcl at yahoo.com
Sat Jul 13 18:33:41 CEST 2013


______________________________

> From: Walter Prins <wprins at gmail.com>
>To: 
>Cc: Python Mailing List <tutor at python.org> 
>Sent: Saturday, July 13, 2013 4:54 PM
>Subject: Re: [Tutor] IOError when importing nose
>

>On 13 July 2013 15:14, Albert-Jan Roskam <fomcl at yahoo.com> wrote:
>
>IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pypi_classifiers-0.1-py2.7.egg/EGG-INFO/top_level.txt'
>>>>> quit()
>>antonia at antonia-HP-2133 /usr/local/lib/python2.7/dist-packages/pypi_classifiers-0.1-py2.7.egg/EGG-INFO $ ls -l
>>total 24
>>-rw------- 1 root staff    1 Jan 26 14:36 dependency_links.txt
>>-rw------- 1 root staff 1311 Jan 26 14:36 PKG-INFO
>>drwxr-sr-x 2 root staff 4096 Jan 26 14:36 scripts
>>-rw------- 1 root staff  269 Jan 26 14:36 SOURCES.txt
>>-rw------- 1 root staff   16 Jan 26 14:36 top_level.txt
>>-rw-r--r-- 1 root staff    1 Jan 26 14:36 zip-safe

>It appears to me this is not directly a problem with your nose installation.  As you can see it's apparently some other package (pypi_classifiers) which has previously been installed and has incorrect file permissions on some files that's causing trouble.  
>
>(As an aside re your nose installation, note that on Linux it's slightly preferable to use the package manager if available to install even Python packages, instead of pip if possible, e.g on Debian and variants (Ubuntu, Mint etc) you'd use: sudo apt-get install python-nose)
>
>That said, if you want to try and blanket fix your current permissions to give group and world (other) readability on all the files in dist-packages (probably a reasonable fix to do) you can do:
>
>sudo chmod -R go+r /usr/loca/lib/python2.7/dist-packages
>
>Some clarification of options:
>-R = recursive
>go = apply to "group" and "other"
>+ = add permissions
>r = read permission
>
>You can also try uninstalling via pip again (sudo pip uninstall nose) and then try installing via the package manager again to see if this helps (but as above, I don't think it will, the problem appears to me not to be directly related to your nose installation.)

Hi Walter,

Fantastic, that worked! Thank you! I was hesitant to use chmod because I hadn't (at least not that I was aware of) been messing with the file permissions. Any idea what this may have caused? Before I had problems with this after I temporarily copied a directory (a repository) to a Windows NTFS partition. But that was on a different computer. Even though one learns a thing or two when this happens, it *always* happens on a wrong moment. ;-)

Best wishes,
Albert-Jan



More information about the Tutor mailing list