
On Wed, Feb 16, 2022 at 07:01:42PM -0600, Tim Peters wrote:
You may not realize how easy this is? Just in case: go to a shell and type
pip install regex
(or, on Windows, "python -m pip install regex" in a DOS box).
That's it. You're done.
Easier said than actually done. https://discuss.python.org/t/pip-missing-from-my-python-download/13750/1 That's not the only failure mode. https://duckduckgo.com/?q=pip+install+error https://www.google.com/search?q=pip+install+error I'm especially fond of questions from people who have successfully installed some library using pip, and then can't import that library from Python. That's always fun to diagnose. And just in case using pip was too hard for the newbie, don't worry, we can always make it harder by telling them to set up an venv first o_O In many workplaces (and schools), with strict rules about not installing unapproved software on company machines (instant firing offence), you are right: just run pip install and you're done. I've worked at some of them. Pip is a good hammer, and many people see every problem as a nail to be solved with "just use pip" -- but very few of them hang around on user forums to help beginners when "just use pip" fails, as if often does :-(
Now you can use regex. In some cases, you can put "import regex as re" at the top of a module At worst, replace instances of "re" with "regex". Stay away from the new features, and it's highly compatible with Python;s re.
If you're only using the features that re supports, wouldn't it be easier to just use re? -- Steve