当我用cx\u freeze来打包一个带有xgboost和sklearn的程序时,为什么消息会一直输出?

2024-04-25 18:59:00 发布

您现在位置:Python中文网/ 问答频道 /正文

测试.py

import xgboost as xgb
from sklearn.externals import joblib
#import pandas as pd
print ('i will be crazy!!!')

运行python3 test.py,结果是:

/usr/local/python3/lib/python3.7/site-packages/sklearn/externals/joblib/__init__.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
  warnings.warn(msg, category=DeprecationWarning)
i will be crazy!!!

当我使用cx\u freeze打包时,运行python3 setup.py build

/usr/local/python3/lib/python3.7/site-packages/sklearn/externals/joblib/__init__.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
                      warnings.warn(msg, category=DeprecationWarning)
i will be crazy!!!
/usr/local/python3/lib/python3.7/site-packages/sklearn/externals/joblib/__init__.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
                      warnings.warn(msg, category=DeprecationWarning)
i will be crazy!!!
...

它不断地输出上面的信息。 为什么?只有这两个包有问题。你知道吗

版本信息:

  • Python 3.7.0

  • Cx\u冻结6.0b1


Tags: infrompyimportismodelswithbe

热门问题