How to use slugify in Python 3? : <p>I'm trying to use <a href="https://github.com/un33k/python-slugify" rel="noreferrer">slugify</a>, which I installed using <code>pip3 install slugify</code>. However, in the interpreter, if I try to slugify the string <code>'hello'</code> I see the following:</p>

<pre><code>Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython's features.
%quickref -&gt; Quick reference.
help      -&gt; Python's own help system.
object?   -&gt; Details about 'object', use 'object??' for extra details.

In [1]: from slugify import slugify

In [2]: slugify('hello')
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
&lt;ipython-input-2-a58110f37579&gt; in &lt;module&gt;()
----&gt; 1 slugify('hello')

/usr/local/lib/python3.5/dist-packages/slugify.py in slugify(string)
     22 
     23     return re.sub(r'[-\s]+', '-',
---&gt; 24             unicode(
     25                 re.sub(r'[^\w\s-]', '',
     26                     unicodedata.normalize('NFKD', string)

NameError: name 'unicode' is not defined

In [3]: slugify(u'hello')
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
&lt;ipython-input-3-acc9f7b8d41e&gt; in &lt;module&gt;()
----&gt; 1 slugify(u'hello')

/usr/local/lib/python3.5/dist-packages/slugify.py in slugify(string)
     22 
     23     return re.sub(r'[-\s]+', '-',
---&gt; 24             unicode(
     25                 re.sub(r'[^\w\s-]', '',
     26                     unicodedata.normalize('NFKD', string)

NameError: name 'unicode' is not defined
</code></pre>

<p>By contrast, in Python 2 the latter does work:</p>

<pre><code>Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython's features.
%quickref -&gt; Quick reference.
help      -&gt; Python's own help system.
object?   -&gt; Details about 'object', use 'object??' for extra details.

In [1]: from slugify import slugify

In [2]: slugify(u'hello')
Out[2]: u'hello'
</code></pre>

<p>How can I get this to work in Python 3?</p>
