The slugify package you installed isn't built for python 3, it currently only supports python 2. And it is very unlikely it will get updated. One of the easiest way to tell is that throughout its source code, it used the python 2 keyword unicode in which it doesn't exist in python 3.

You probably did:

pip install slugify

That was an outdated package, not the one you linked.

To install the slugify package you linked, https://pypi.python.org/pypi/python-slugify, it's called python-slugify when you install it, it supports all recent python versions. And have way more functionalities.

pip install python-slugify

And import the same way as the other package:

from slugify import slugify

Note: YOU MUST DELETE THE ORIGINAL PACKAGE YOU INSTALLED, since they uses the same name.

Answer from Taku on Stack Overflow
🌐
PyPI
pypi.org › project › python-slugify
python-slugify · PyPI
6 days ago - Unicode-aware slug generation for Python, with explicit transliteration choices. 9+ releases ship the modern algorithm. Legacy behavior remains the default; use algorithm='modern' for the latest rules. See the migration guide before changing persisted URLs or keys. Install python-slugify, import slugify. Other similarly named distributions are not this package.
🌐
My Notes
blndxp.wordpress.com › 2016 › 03 › 04 › python-django-wagtail-slugify-name-unicode-is-not-defined
Python – Django – Wagtail – Slugify: Name ‘unicode’ is Not Defined
March 4, 2016 - PROBLEM name ‘unicode’ is not defined SOLUTION /opt/mysite/lib/python3.4/site-packages/slugify.py change return statement to: return re.sub(r'[-\s]+’, ‘-‘, (re.sub(r'[…
🌐
GitHub
github.com › Sygil-Dev › sygil-webui › issues › 1442
[Bug]: NameError: name 'unicode' is not defined - slugify.py - ERROR & FIX · Issue #1442 · Sygil-Dev/sygil-webui
October 6, 2022 - What happened? Got error: File "d:\Soft\Anaconda\envs\ldm\lib\site-packages\slugify.py", line 24, in slugify unicode( NameError: name 'unicode' is not defined Fix: pip uninstall slugify pip install python-slugify Version 0.0.1 (Default) ...
Author: Sygil-Dev
🌐
GitHub
github.com › un33k › python-slugify › issues › 151
Unicode does not work · Issue #151 · un33k/python-slugify
March 28, 2024 - Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/path_to_the_project/venv/lib/python3.7/site-packages/slugify.py", line 24, in slugify unicode( NameError: name 'unicode' is not defined
Author: un33k
🌐
GitHub
github.com › TheHive-Project › Synapse › issues › 14
NameError: name 'unicode' is not defined · Issue #14 · TheHive-Project/Synapse
November 12, 2018 - 2018-11-12 12:55:07,583 :: INFO :: objects.TempAttachment.getFileName starts 2018-11-12 12:55:07,583 :: ERROR :: Failed to create case from email Traceback (most recent call last): File "/opt/Synapse/workflows/Ews2Case.py", line 85, in connectEws tempAttachment = TempAttachment(attachmentLvl1) File "/opt/Synapse/workflows/objects/TempAttachment.py", line 60, in __init__ self.filename = self.getFilename() File "/opt/Synapse/workflows/objects/TempAttachment.py", line 83, in getFilename filename = slugify(filename) File "/usr/local/lib/python3.5/dist-packages/slugify.py", line 24, in slugify unicode( NameError: name 'unicode' is not defined
Author: TheHive-Project
🌐
GitHub
github.com › yhat › rodeo › issues › 90
slugify is not compatible with python3 · Issue #90 · yhat/rodeo
May 4, 2015 - packages\slugify.py", line 24, in slugify unicode( NameError: name 'unicode' is not defined · Reactions are currently unavailable · No one assigned · No labels · No labels · No type · No projects · No milestone · None yet · No branches or pull requests ·
Author: yhat
🌐
CSDN
devpress.csdn.net › python › 630455a17e6682346619a0c2.html
How to use slugify in Python 3? - DevPress官方社区
August 23, 2022 - In [1]: from slugify import slugify In [2]: slugify('hello') --------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-2-a58110f37579> in <module>() ----> 1 slugify('hello') /usr/local/lib/python3.5/dist-packages/slugify.py in slugify(string) 22 23 return re.sub(r'[-\s]+', '-', ---> 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 Traceb
Find elsewhere
🌐
Ubernation
ubernation.uk › docs › page.php
nameerror name 'unicode' is not defined slugify
Step install python-slugify module # pip install python-slugify Include slugify module in your model from slugify import slugify Where I am doing the wrong things? In a module in this package (algorithm.py) there are some lines that give me error, although it is part of the package. I am learning the python language by seeing some YouTube channels and from many tutorial-based blogs over the internet. I was using the wrong Python Version. NameError: global name 'unicode' is not defined-in Python 3 .
🌐
PyPI
pypi.org › project › unicode-slugify
unicode-slugify
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
GitHub
github.com › un33k › python-slugify › issues › 81
Name conflict with other slugify package · Issue #81 · un33k/python-slugify
July 27, 2019 - My IDE (PyCharm 2018.2.5) will suggest to automatically download a package, but the wrong one. And this results in an error: NameError: name 'unicode' is not defined
Author: un33k
🌐
Frugalbrenda
frugalbrenda.com › site › 2onnqlt.php
name 'unicode' is not defined slugify
This module provides access to ... which defines character properties for all Unicode characters. '_' is valid (but your choice, you did ask), unicode is as percent encoded chars.Thank you Mike. Private self-hosted questions and answers for your enterpriseProgramming and related technical career opportunitiesare you working with unicode alot? “NameError: name ‘slugify’ is not ...
🌐
Django
code.djangoproject.com › ticket › 8391
#8391 (slugify template filter poorly encodes non-English strings) – Django
If we can adequately provide IRIs, on the other hand, the slugify operation can be well-defined, eg. >>> slugify(u'Føø Bär Baß') u'føø-bär-baß' @bjornkri: You're still using UTF-8 encoded bytestrings. You must use unicode strings.
🌐
GitHub
github.com › lucainiaoge › jazzify › issues › 1
name 'unicode' is not defined · Issue #1 · lucainiaoge/jazzify
June 27, 2022 - <Trial 7132629 worker_0> jazzify $ python3 jazzify_nottingham.py 123 finished loading dataset, total number: 1168 Traceback (most recent call last): File "jazzify_nottingham.py", line 21, in piece = dataset.getitem(g_data_perm[g_data_counter]) File "/home/tiger/test9/jazzify/data/nottingham.py", line 68, in getitem title = slugify(piece["metadata"]["title"]) File "/home/tiger/.local/lib/python3.7/site-packages/slugify.py", line 24, in slugify unicode( NameError: name 'unicode' is not defined ·
Author: lucainiaoge
🌐
Python Clear
pythonclear.com › home › errors › nameerror: name unicode is not defined in python
NameError: Name Unicode Is Not Defined in Python - Python Clear
January 27, 2023 - Apart from that, the NameError ... modules. The name Unicode is not defined in python as a type of NameError that occurs while dealing with the Unicode objects in a code....
🌐
Django
code.djangoproject.com › ticket › 30892
#30892 (slugify() doesn't return a valid slug for "İ".) – Django
While working on an international project, we discovered that the turkish/azerbaijani letter İ can not be properly processed when SlugField and slugify are run with allow_unicode=True.