【发布时间】:2019-06-28 18:02:03
【问题描述】:
我创建了一个代码来从 sharepoint 中提取数据,它在我的本地环境(Spyder Python 3.6)上就像魅力一样。 但是当我尝试在生产环境(Python 2.7.12)上部署它时,由于缺少包加密而失败。 当我尝试将密码学从 github 添加到 Python 2.7 库时,它会丢失文件 _constant_time。 但是当我尝试将库文件从 anaconda (python 3.6 ) 复制到生产 (python 2.7) 时,_constant_time 文件在那里,但它现在显示 cannot import lib 错误。
为什么 github 和 anaconda 上的密码库文件存在差异以及如何解决该问题? PS- 我无法从 Python 2.7 更改生产版本
import sys
from os.path import join as filejoin
from os.path import dirname as file_dirname
from os.path import abspath as file_abspath
binPath=file_dirname(sys.argv[0])
CustomLibraryPath=filejoin(file_abspath(binPath+'/../..'),'CustomLibrary')
print(CustomLibraryPath)
sys.path.append(CustomLibraryPath)
from requests_ntlm import HttpNtlmAuth
from shareplum import Site
import pandas as pd
username = """xxxxxxx"""
password = "xxxxxxxx"
site_url="xxxxxxx"
auth=HttpNtlmAuth(username, password)
site = Site(site_url, auth=auth)
sp_list = site.List('xxxxxxx')
data = sp_list.GetListItems("All Items")
df=pd.DataFrame(data)
print (df.head())
【问题讨论】:
标签: python python-3.x python-2.7 anaconda