Python Forum

Full Version: Issues installing xlrd
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been experimenting with Pandas the last few days and needed to install xlrd to read excel files. Something is blowing up and I don't know why.

Here is my pip install xlrd-1.2.0 and the result. I'm baffled:

Output:
Traceback (most recent call last): File "c:\python\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\python\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Python\Scripts\pip.exe\__main__.py", line 5, in <module> File "c:\python\lib\site-packages\pip\__init__.py", line 26, in <module> from pip.utils import get_installed_distributions, get_prog File "c:\python\lib\site-packages\pip\utils\__init__.py", line 27, in <module> from pip._vendor import pkg_resources File "c:\python\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3018, in <module> @_call_aside File "c:\python\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3004, in _call_aside f(*args, **kwargs) File "c:\python\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3046, in _initialize_master_working_set dist.activate(replace=False) File "c:\python\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2578, in activate declare_namespace(pkg) File "c:\python\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2152, in declare_namespace _handle_ns(packageName, path_item) File "c:\python\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2092, in _handle_ns _rebuild_mod_path(path, packageName, module) File "c:\python\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2121, in _rebuild_mod_path orig_path.sort(key=position_in_sys_path) AttributeError: '_NamespacePath' object has no attribute 'sort'
Thanks!
try to upgrade pip and setuptools
pip install --upgrade pip setuptools
possibly uninstall and then install again setupttols (some report upgrade didn't fix it, but reinstall did)
from https://github.com/pypa/setuptools/issues/885
It took a little finagling to get a fresh copy of PIP and setuptools installed but after doing so the prior issue is resolved. Thanks @Buran!