Install jupyterlab in pip3 throws 'TypeError: expected string or bytes-like object'

The true fix is just bite the bullet and use virtual environments to ensure packages work, whether that's using Anaconda or directly via the command line.

I was in a time crunch, and the answer below by Wʜᴀᴄᴋᴀᴍᴀᴅᴏᴏᴅʟᴇ3000 gave me the band-aid to complete what I needed to do. I'm going to leave it here for archival purposes.


Per ᴡʜᴀᴄᴋᴀᴍᴀᴅᴏᴏᴅʟᴇ3000 answer in the comments, which was deleted, this fixed it. If you are ᴡʜᴀᴄᴋᴀᴍᴀᴅᴏᴏᴅʟᴇ3000 and see this edit, feel free to make a comment and I can flag it as the 'accepted answer.' Per Greg Schmit's suggestion, I moved the answer to this section too. I'm new to stackexchange, so if you know how to contact ᴡʜᴀᴄᴋᴀᴍᴀᴅᴏᴏᴅʟᴇ3000, please do help. This is the answer for now unless someone can provide more insight. Not sure if this complication may be cygwin related or not.

  • Opened file "/usr/lib/python3.6/site-packages/packaging/version.py"

  • Changed the code on line 200 from match = self._regex.search(version) to match = self._regex.search(str(version))

  • Re-ran the code pip3 install jupyterlab

Now the python3 pandas module is recognized inside jupyterlab when I run import pandas as pd


I had some issue with existing *.egg-info files, removing those allowed pip to work again