Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I work on sql server 2017 I run python script read file from shared path
i get error
when run the line below
excel_header = list(pd.read_excel(FullFilePath).columns)

error details
Error in execution.  Check the output for more information.
Traceback (most recent call last):
  File "<string>", line 5, in <module>
  File "D:\ProgramData\MSSQLSERVER\Temp-PY\Appcontainer1\6D0E822A-D7E1-4DCE-BAB5-449D89FEAD53\sqlindb_0.py", line 49, in transform
    excel_header = list(pd.read_excel(FullFilePath).columns)
  File "D:\SQL Data\MSSQL15.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\pandas\util\_decorators.py", line 178, in wrapper
    return func(*args, **kwargs)
  File "D:\SQL Data\MSSQL15.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\pandas\util\_decorators.py", line 178, in wrapper
    return func(*args, **kwargs)

Msg 39019, Level 16, State 2, Line 1
An external script error occurred: 
  File "D:\SQL Data\MSSQL15.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\pandas\io\excel.py", line 307, in read_excel
    io = ExcelFile(io, engine=engine)
  File "D:\SQL Data\MSSQL15.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\pandas\io\excel.py", line 394, in __init__
    self.book = xlrd.open_workbook(self._io)
  File "D:\SQL Data\MSSQL15.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\xlrd\__init__.py", line 111, in open_workbook
    with open(filename, "rb") as f:
PermissionError: [Errno 13] Permission denied: '//192.168.7.7/ExportExcel/ComplianceSample.xlsx'


when fullpath=
\\192.168.7.7\ExportExcel\ComplianceSample.xlsx

issue display
but if
fullpath=D:\ExportExcel\ComplianceSample.xlsx

issue not display
so how to solve this issue please
why i can read from local path
and by ip can't read file
I need mandatory shared path because i can't access shared path from another pc

What I have tried:

I give access to folder ExportExcel to have everyone permission
and all_packages and give full control and read and write

also i can open this path from server 7.7
\\192.168.7.7\ExportExcel\ComplianceSample.xlsx


sql server 2017 and python and files all exist on server 7.7

when make run and write path i can open path

also i can read write on path above .
Posted
Updated 5-May-22 6:09am
v2

Try using system.file[^]. Also refer to documentation[^].
Other things to note are,
1. Verify if the file is already open
2. If permission is available
3. File path is correct or not.
 
Share this answer
 
v2
First, is a Share setup on that folder? Is Share named "ExportExcel"?

Is the server machine hosting the share part of a AD Domain? Is the workstation trying to access the share part of the same AD Domain?

Does the user that is trying to get at the files in the share have permissions on the Share to access it?

Does the user that is trying to get at the files in the share have NTFS (filesystem) permissions to access the files in that folder?

These are the questions you have to answer to make sure it's not a networking/NTFS permissions problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900