我試圖將.py腳本轉換爲.exeCXfreeze - 需要appdirs包
Cxfreeze成功編譯exe文件。然而,當我運行exe文件時,它拋出這個錯誤:
ImportError: The 'appdirs' package is required; normally this is bundled with th
is package so if you get this warning, consult the packager of your distribution
這裏是我的setup.py
從cx_Freeze進口設置,可執行
setup(
name = "dbx_sharelink" ,
version = "0.1" ,
description = " " ,
executables = [Executable("dbx_sharelink.py")] ,
)
源碼Python腳本
import sys
import dropbox
import pandas as pd
import sys
import os
dbx = dropbox.Dropbox('xxxxxxxxxxxxxxxxx')
def getSharedLink(full_path):
try:
link = dbx.sharing_create_shared_link(full_path).url
except dropbox.exceptions.ApiError as err:
print('*** API error', err)
return None
return link
print(sys.argv[1])
link = getSharedLink("/A_DATA/data")
df = pd.DataFrame([{'link':link}])
df.to_clipboard(index=False,header=False)
os.system("pause")
如何解決此錯誤?
你能分享你試圖凍結的Python腳本嗎? –
我現在將源代碼添加到我的問題中。 – jortiexx