Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issues installing xlrd
#1
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!
Through a cloudy window,
Kip...

“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis
Reply
#2
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
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!
Through a cloudy window,
Kip...

“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Selecting correct xlrd version Kithsiri 4 526 Feb-27-2024, 07:09 AM
Last Post: Kithsiri
Shocked Issues Installing Pyenv/Python 3.9.1 Brandon_Contactum 1 2,517 Feb-22-2022, 06:32 PM
Last Post: snippsat
  Does "import xlrd" work in Thonny? cnutakor 3 3,002 Apr-30-2020, 12:41 AM
Last Post: Larz60+
  XLRD Package not be able to call dhiliptcs 2 2,293 Sep-24-2019, 05:21 PM
Last Post: dhiliptcs
  ImportError: No module named xlrd dhiliptcs 5 17,477 Sep-21-2019, 12:17 PM
Last Post: brighteningeyes
  Does XLRD have a method to extract embedded objects (pdf) from an excel sheet? matthewme 1 2,493 Jun-13-2019, 10:00 PM
Last Post: Larz60+
  Help | float to Int in xlrd Vinci141 0 3,004 May-13-2019, 07:00 AM
Last Post: Vinci141
  How to obtain the background color of a cell using xlrd? Krszt 1 12,477 Mar-12-2019, 11:23 PM
Last Post: hshivaraj
  Iterate over excel-sheets using xlrd tobbs 6 12,403 Feb-28-2019, 08:33 PM
Last Post: tobbs
  pip install xlrd error sandy 3 12,637 Jan-19-2019, 08:01 AM
Last Post: hbknjr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020