我试图将.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