OSError: [Errno 1] Operation not permitted: Extras/lib/python/six-1.4.1-py2.7.egg-info’

After upgrading some things using homebrew, this error started coming up on a coworker’s machine when he tried to pip install virtualenvwrapper.

This error was coming up right before the operation not permitted:

Installing collected packages: six
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:

The solution we found was to ignore the installed six version:

pip install virtualenvwrapper --upgrade --ignore-installed six

I’m not sure how, but this did the trick. I learned about the --ignore-installed option here.
https://github.com/pypa/pip/issues/3165

Posted in Mac OS X, python | Comments Off on OSError: [Errno 1] Operation not permitted: Extras/lib/python/six-1.4.1-py2.7.egg-info’

How to reset lost QNAP iscsi CHAP password

I wanted to change the password for one of my QNAP ISCSI luns, but there really is no way to do that with the current software.

Fortunately you can recover your password by using ssh to login to your qnap, and look in /etc/config/iscsi_trgt.conf. Search for CHAPPasswd. The CHAP user is stored there as well, in case you forgot that too.

Posted in QNAP | Comments Off on How to reset lost QNAP iscsi CHAP password

ImportError: cannot import name sanitizer when trying to run django

I hope this saves you a couple hours of headaches that I experienced recently.

If you get the dreaded error:

from html5lib import sanitizer, serializer, treebuilders, treewalkers
ImportError: cannot import name sanitizer

Never fear. The fix is easy once you know how. Add this exact line to your requirements file and redeploy:

html5lib<0.99999999

This will fix it.

Posted in django, python, Web Programming | Comments Off on ImportError: cannot import name sanitizer when trying to run django

KeyError: ‘en-us’ when doing a reverse() lookup in urls.py

If you’re getting an error like this:


... in reverse_dict
return self._reverse_dict[language_code]
KeyError: 'en-us'

If your urls.py file contains a reverse() call, that is the reason.  You’re calling reverse before all the urls are loaded and everything is ready.  You need to use reverse_lazy() instead.:


url(r'^password/reset/$',
password_reset,
{'post_reset_redirect': reverse('password_reset_done'),
'html_email_template_name': 'registration/html_password_reset_email.html'},
name="password_reset"),

Change the reverse() call into a reverse_lazy() call and the problem will go away!

Posted in django, python, Web Programming | Comments Off on KeyError: ‘en-us’ when doing a reverse() lookup in urls.py

How to get rid of winmail.dat attachments when using Office365 and Outlook 2016

Sometimes Outlook 2016 decides to send the body every email as a winmail.dat attachment. This works fine when the person you are sending the email to is using Outlook. But other mail users will get a blank message with a winmail.dat attachment that they can’t open.

This frustrating problem can be fixed by doing this:

  1. Login to office365 as an administrator
  2. Click the Admin Icon
    screen-shot-2016-09-30-at-12-43-23-pm
  3. Expand the Admin Centers Menu, and click Exchange
    screen-shot-2016-09-30-at-12-45-52-pm
  4. On the left, click “mail flow”, then click “remote domains”, make sure “Default, *” is selected, and click the Edit Pencil icon.
    screen-shot-2016-09-30-at-12-48-36-pm
  5. Edit the settings with arrows, and click Save.screen-shot-2016-09-30-at-12-51-12-pm
  6. Enjoy
Posted in Exchange, Office 365 | Comments Off on How to get rid of winmail.dat attachments when using Office365 and Outlook 2016