Python Forum
I can write to but cannot read from Excel using python.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I can write to but cannot read from Excel using python.
#1
I have import xlsxwriter in my code but am not sure what I did to enable that one. (:
Now I want to read from a cell but import xlrd fails. I looked it up but every set of directions fail almost at the first step.

From various web sites, I see the following:
$ pip install xlrd What is the $ prompt?
xlrd-1.1.0-py2.py3-none-any.whl (md5) I unzipped using 7-zip but don;t know understand how the system will see it. Maybe someone can tell me where to put it....

Am I in t4eh ball park or still out in the parking lot?
Is there a different way to do this?
Reply
#2
$ is linux specific and means you need to run the command as regular user (not root).
On any OS the command is just pip install xlrd
if you downloaded the whl file you can do also pip install xlrd-1.1.0-py2.py3-none-any.whl assuming whl file is in CWD. otherwise you need to specify the full path to the file.
Reply
#3
(Feb-13-2018, 01:55 AM)Emerogork Wrote: What is the $ prompt?
As mention is linux specific,the same in Windows is command line cmd.
C:\Windows\System32>cd\

# pip most work like this and you should be using 3.6
C:\>pip -V
pip 9.0.1 from c:\python36\lib\site-packages (python 3.6)

C:\>pip install xlrd
Collecting xlrd
  Using cached xlrd-1.1.0-py2.py3-none-any.whl
Installing collected packages: xlrd
Successfully installed xlrd-1.1.0

C:\>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlrd
>>> xlrd.__VERSION__
'1.1.0'
>>> exit()

C:\>
To make sure it work like this Python 3.6 and pip installation under Windows
Did you read my reply in your last post?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 1,430 Nov-09-2023, 10:56 AM
Last Post: mg24
Question Special Characters read-write Prisonfeed 1 612 Sep-17-2023, 08:26 PM
Last Post: Gribouillis
  How do I read and write a binary file in Python? blackears 6 6,513 Jun-06-2023, 06:37 PM
Last Post: rajeshgk
  How do I write all csv records to Excel ? Revox 2 953 Mar-29-2023, 03:53 PM
Last Post: deanhystad
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,091 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Read text file, modify it then write back Pavel_47 5 1,589 Feb-18-2023, 02:49 PM
Last Post: deanhystad
  how to read txt file, and write into excel with multiply sheet jacklee26 14 9,908 Jan-21-2023, 06:57 AM
Last Post: jacklee26
  Openpyxl manipulate excel write formula SamLiu 0 1,052 Nov-04-2022, 03:00 PM
Last Post: SamLiu
  Read JSON via API and write to SQL database TecInfo 5 2,189 Aug-09-2022, 04:44 PM
Last Post: TecInfo
  Write and read back data Aggie64 6 1,865 Apr-18-2022, 03:23 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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