'import pandas throws TypeError: expected string or bytes-like object

After pip installing a private repo in my Conda environment I now get the error TypeError: expected string or bytes-like object when trying to import pandas. I tried reinstalling pandas but I still get the same error.

Full error message:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-ebe8ac2ac4b6> in <module>
      1 import numpy
      2 numpy.version.version
----> 3 import pandas as pd

~\anaconda3\envs\arcgis_add_packages\lib\site-packages\pandas\__init__.py in <module>
     20 
     21 # numpy compat
---> 22 from pandas.compat import (
     23     np_version_under1p18 as _np_version_under1p18,
     24     is_numpy_dev as _is_numpy_dev,

~\anaconda3\envs\arcgis_add_packages\lib\site-packages\pandas\compat\__init__.py in <module>
     21     np_version_under1p20,
     22 )
---> 23 from pandas.compat.pyarrow import (
     24     pa_version_under1p0,
     25     pa_version_under2p0,

~\anaconda3\envs\arcgis_add_packages\lib\site-packages\pandas\compat\pyarrow.py in <module>
      7 
      8     _pa_version = pa.__version__
----> 9     _palv = Version(_pa_version)
     10     pa_version_under1p0 = _palv < Version("1.0.0")
     11     pa_version_under2p0 = _palv < Version("2.0.0")

~\anaconda3\envs\arcgis_add_packages\lib\site-packages\pandas\util\version\__init__.py in __init__(self, version)
    337 
    338         # Validate the version and parse it into pieces
--> 339         match = self._regex.search(version)
    340         if not match:
    341             raise InvalidVersion(f"Invalid version: '{version}'")

TypeError: expected string or bytes-like object


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source