简体   繁体   English

如何使托管在 PCF 中的 python 代码从网络共享驱动器读取 excel 文件

[英]How to make my python code that is hosted in PCF to read excel file from network shared drive

I could able to read excel that is there in the network shared drive when i run python code in my local, but when i try to do the same in PCF, it is throwing error like "No such file or directory", what should i do to make my code to read excel in PCF?当我在本地运行 python 代码时,我可以读取网络共享驱动器中存在的 excel,但是当我尝试在 PCF 中执行相同操作时,它会抛出类似“没有这样的文件或目录”的错误,我应该怎么办如何让我的代码在 PCF 中读取 excel?

Shared drive path: df=pd.read_excel('//X//Proj//app//Data//sep.xlsm')共享驱动器路径:df=pd.read_excel('//X//Proj//app//Data//sep.xlsm')

error in PCF: 2020-12-23T13:53:15.77+0530 [APP/PROC/WEB/0] ERR with open(filename, "rb") as f: 2020-12-23T13:53:15.77+0530 [APP/PROC/WEB/0] ERR FileNotFoundError: [Errno 2] No such file or directory: '//X//Proj//app//Data//sep.xlsm' PCF 中的错误:2020-12-23T13:53:15.77+0530 [APP/PROC/WEB/0] ERR with open(filename, "rb") as f: 2020-12-23T13:53:15.77+0530 [APP /PROC/WEB/0] ERR FileNotFoundError: [Errno 2] 没有这样的文件或目录:'//X//Proj//app//Data//sep.xlsm'

It seems like you dint mount the file share to your app and hence the issue....似乎您将文件共享挂载到您的应用程序,因此问题....

If file share is mounted and accessible from pcf then would suggest to try with fully qualified name (like //fs00ab01.svr.net/Proj/app/Data/sep.xlsm) rather the X drive or something..如果文件共享已安装并可从 pcf 访问,则建议尝试使用完全限定名称(如 //fs00ab01.svr.net/Proj/app/Data/sep.xlsm)而不是 X 驱动器或其他东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Pydrive:如何从共享驱动器读取文件? - Pydrive : How to read file from Shared Drive? 如何在PCF上托管的python CGI文件中刷新STDOUT? - How to flush STDOUT in python CGI file hosted on PCF? 从 Python 中的共享驱动器读取不带扩展名的文件 - Read file without extension from shared drive in Python 如何使用Python将共享的网络文件设置为只读? - How do you make a shared network file read-only using Python? 如何使用 Python 从 Windows 共享网络驱动器获取文件并上传到 Azure Data Lake Storage 位置? - How to fetch files from Windows Shared Network Drive and upload to Azure Data Lake Storage location using Python? 如何将csv文件上传到谷歌驱动器并将其从同一个文件中读取到python中 - How to upload csv file into google drive and read it from same into python 使用 Python 从共享的 Google 驱动器文件夹中读取多个 csv - Read multiple csv from Shared Google drive folder using Python 如何在 Python 3 中从 AWS 读取 Excel 文件? - How to read Excel File from AWS in Python 3? 如何从python中的excel文件中读取日期? - How to read date from an excel file in python? Virtualenv:如何使自定义Python包含由uWSGI托管的多组件共享 - Virtualenv: How to make a custom Python include shared by multicomponents hosted by uWSGI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM