【Joblib】DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.

本文针对在使用Spark过程中遇到的关于sklearn.externals.joblib的警告信息进行了解释,并提供了解决方案。建议直接从joblib库导入功能,避免使用即将在sklearn中废弃的模块。

一、错误

在跑spark的时候,出现了一个警告,虽然没啥事,可是老是出现,也觉得挺烦的,所以就百度了下怎么解决。

警告信息

/root/anaconda3/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+.

意思也很明确,

sklearn.externals.joblib 在 0.21 被废弃并将在 0.23 移除。请使用 pip 安装 joblib 后直接 import 它。如果是在加载 pickled 模型时产生这个警告的话,你可能需要使用 scikit-learn 0.21 或以上版本中重新序列化这些模型。

二、解决方法

可以直接升级成高版本的,至于怎么升级,可以看我的博客的其他文章。

本文解决方法,则很直接:

不用再 from sklearn.externals import joblib
直接 import joblib

[root@yfw jsxc-master]# npx webpack serve --mode development --host 0.0.0.0 --port 8091 --hot git: 'git' is not a git command. See 'git --help'. The most similar command is init [Git] Not available: Command failed: git git rev-parse HEAD git: 'git' is not a git command. See 'git --help'. The most similar command is init ℹ 「wds」: Project is running at http://0.0.0.0:8091/ ℹ 「wds」: webpack output is served from /dist/ ℹ 「wds」: Content not from webpack is served from /www/wwwroot/szrengjing.com/jsxc/jsxc-master Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 10 │ @import "../fonts/jsxc-icons"; │ ^^^^^^^^^^^^^^^^^^^^^ ╵ scss/main.scss 10:9 root stylesheet Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 12 │ @import "modules/all"; │ ^^^^^^^^^^^^^ ╵ scss/main.scss 12:9 root stylesheet Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 13 │ @import "vendor/all"; │ ^^^^^^^^^^^^ ╵ scss/main.scss 13:9 root stylesheet Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 20 │ @import "partials/avatar"; │ ^^^^^^^^^^^^^^^^^ ╵ scss/main.scss 20:9 root stylesheet Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. More info and automated migrator: https://sass-lang.com/d/import ╷ 21 │ @import "partials/button"; │ ^^^^^^^^^^^^^^^^^ ╵ scss/main.scss 21:9 root stylesheet Deprecation Warning [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use map.get instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 67 │ content: map-get($jsxc-icons-map, "attachment"); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ fonts/jsxc-icons.scss 67:14 @import scss/main.scss 10:9 root stylesheet Deprecation Warning [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use map.get instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 70 │ content: map-get($jsxc-icons-map, "bell"); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ fonts/jsxc-icons.scss 70:14 @import scss/main.scss 10:9 root stylesheet Deprecation Warning [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use map.get instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 73 │ content: map-get($jsxc-icons-map, "bookmark"); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ fonts/jsxc-icons.scss 73:14 @import scss/main.scss 10:9 root stylesheet Deprecation Warning [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use map.get instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 76 │ content: map-get($jsxc-icons-map, "camera-disabled"); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ fonts/jsxc-icons.scss 76:14 @import scss/main.scss 10:9 root stylesheet Deprecation Warning [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use map.get instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 79 │ content: map-get($jsxc-icons-map, "camera"); │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ fonts/jsxc-icons.scss 79:14 @import scss/main.scss 10:9 root stylesheet Deprecation Warning [color-functions]: lighten() is deprecated. Suggestions: color.scale($color, $lightness: 20%) color.adjust($color, $lightness: 20%) More info: https://sass-lang.com/d/color-functions ╷ 60 │ $gray20: lighten($black, 20%); │ ^^^^^^^^^^^^^^^^^^^^ ╵ scss/modules/_colors.scss 60:10 @import scss/modules/_all.scss 1:9 @import scss/main.scss 12:9 root stylesheet Deprecation Warning [color-functions]: lighten() is deprecated. Suggestions: color.scale($color, $lightness: 30%) color.adjust($color, $lightness: 30%) More info: https://sass-lang.com/d/color-functions ╷ 61 │ $gray30: lighten($black, 30%); │ ^^^^^^^^^^^^^^^^^^^^ ╵ scss/modules/_colors.scss 61:10 @import scss/modules/_all.scss 1:9 @import scss/main.scss 12:9 root stylesheet Deprecation Warning [color-functions]: lighten() is deprecated. Suggestions: color.scale($color, $lightness: 50%) color.adjust($color, $lightness: 50%) More info: https://sass-lang.com/d/color-functions ╷ 62 │ $gray50: lighten($black, 50%); │ ^^^^^^^^^^^^^^^^^^^^ ╵ scss/modules/_colors.scss 62:10 @import scss/modules/_all.scss 1:9 @import scss/main.scss 12:9 root stylesheet Deprecation Warning [color-functions]: lighten() is deprecated. Suggestions: color.scale($color, $lightness: 60%) color.adjust($color, $lightness: 60%) More info: https://sass-lang.com/d/color-functions ╷ 63 │ $gray60: lighten($black, 60%); │ ^^^^^^^^^^^^^^^^^^^^ ╵ scss/modules/_colors.scss 63:10 @import scss/modules/_all.scss 1:9 @import scss/main.scss 12:9 root stylesheet Deprecation Warning [color-functions]: lighten() is deprecated. Suggestions: color.scale($color, $lightness: 70%) color.adjust($color, $lightness: 70%) More info: https://sass-lang.com/d/color-functions ╷ 64 │ $gray70: lighten($black, 70%); │ ^^^^^^^^^^^^^^^^^^^^ ╵ scss/modules/_colors.scss 64:10 @import scss/modules/_all.scss 1:9 @import scss/main.scss 12:9 root stylesheet Warning: 241 repetitive deprecation warnings omitted. ℹ 「wdm」: assets by path images/emojione/*.svg 3.05 MiB 1832 assets assets by path images/icons/*.svg 95.1 KiB 42 assets assets by path images/filetypes/ 29.9 KiB 40 assets assets by path example/ 249 KiB 12 assets assets by path images/*.svg 14.8 KiB 9 assets assets by path assets/ 262 KiB 6 assets assets by path images/emoticons/*.svg 36.7 KiB 6 assets assets by path images/presence/*.svg 9.21 KiB 5 assets assets by path sound/ 102 KiB 4 assets assets by path fonts/ 28 KiB 4 assets assets by chunk 13.1 MiB (name: main) 2 assets + 4 assets Entrypoint main [big] 13.1 MiB (262 KiB) = styles/jsxc.bundle.css 300 KiB jsxc.bundle.js 12.8 MiB 6 auxiliary assets runtime modules 30.3 KiB 17 modules modules by path ./node_modules/ 3.13 MiB 387 modules modules by path ./src/ 1.12 MiB 226 modules modules by path ./template/ 95.6 KiB 32 modules modules by path ./locales/ 462 KiB 31 modules modules by path ./sound/*.mp3 158 bytes ./sound/notification.mp3 55 bytes [built] [code generated] + 2 modules modules by path ./scss/*.scss 365 bytes (javascript) 299 KiB (css/mini-extract) ./scss/main.scss 365 bytes [built] [code generated] css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/sass-loader/dist/cjs.js!./scss/main.scss 299 KiB [built] [code generated] modules by path ./images/ 106 bytes ./images/XMPP_logo.png 52 bytes [built] [code generated] ./images/icons/placeholder.svg 54 bytes [built] [code generated] + 6 modules webpack 5.102.1 compiled successfully in 18090 ms ℹ 「wdm」: Compiled successfully. ERROR in src/api/v1/register.ts:140:44 TS2345: Argument of type 'string' is not assignable to parameter of type 'Record<string, string>'. 138 | 139 | if (values && values.length === 1) { > 140 | queryStanza.c(allowedField, values[0]).up(); | ^^^^^^^^^ 141 | } 142 | } 143 | } ERROR in src/connection/AbstractConnection.ts:222:29 TS2345: Argument of type '{ xmlns: any; hash: string; node: string; ver: String; }' is not assignable to parameter of type 'Record<string, string>'. Property 'ver' is incompatible with index signature. Type 'String' is not assignable to type 'string'. 'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible. 220 | let presenceStanza = $pres(); 221 | > 222 | presenceStanza.c('c', this.generateCapsAttributes()).up(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 223 | 224 | if (typeof presence !== 'undefined' && presence !== Presence.online) { 225 | presenceStanza.c('show').t(Presence[presence]).up(); ERROR in src/connection/services/MUC.ts:130:27 TS2345: Argument of type 'string' is not assignable to parameter of type 'Record<string, string>'. 128 | 129 | if (exitMessage) { > 130 | pres.c('status', exitMessage); | ^^^^^^^^^^^ 131 | } 132 | 133 | return this.send(pres); ERROR in src/connection/services/PubSub.ts:243:13 TS2322: Type 'IJID' is not assignable to type 'string'. 241 | .c('options', { 242 | node, > 243 | jid: this.jid, | ^^^ 244 | }); 245 | 246 | if (subId) { ERROR in src/connection/services/Vcard.ts:64:16 TS2345: Argument of type 'XMLDocument' is not assignable to parameter of type 'Element'. Type 'XMLDocument' is missing the following properties from type 'Element': attributes, classList, className, clientHeight, and 99 more. 62 | type: 'set', 63 | to: jid.bare, > 64 | }).cnode(newVCard.get(0)); | ^^^^^^^^^^^^^^^ 65 | 66 | return this.sendIQ(setVcardIQStanza); 67 | } ERROR in src/connection/xmpp/ConnectHelper.ts:1:10 TS2305: Module '"strophe.js"' has no exported member 'Strophe'. > 1 | import { Strophe } from 'strophe.js'; | ^^^^^^^ 2 | import Log from '../../util/Log'; 3 | import SM from '../../StateMachine'; 4 | import Client from '../../Client'; ERROR in src/plugins/AvatarPEPPlugin.ts:92:13 TS2322: Type 'number' is not assignable to type 'string'. 90 | }) 91 | .c('info', { > 92 | bytes: imageSize, | ^^^^^ 93 | id: imageId, 94 | type: 'image/png', 95 | }) ERROR in src/plugins/httpUpload/HttpUploadService.ts:48:10 TS2322: Type 'number' is not assignable to type 'string'. 46 | xmlns: this.namespace, 47 | filename: file.name, > 48 | size: file.size, | ^^^^ 49 | 'content-type': file.type, 50 | }); 51 | ERROR in src/plugins/omemo/lib/Bundle.ts:40:13 TS2322: Type 'number' is not assignable to type 'string'. 38 | xmlBundle 39 | .c('signedPreKeyPublic', { > 40 | signedPreKeyId: this.bundle.signedPreKey.getId(), | ^^^^^^^^^^^^^^ 41 | }) 42 | .t(ArrayBufferUtils.toBase64(this.bundle.signedPreKey.getPublic())) 43 | .up(); ERROR in src/plugins/omemo/lib/Bundle.ts:54:16 TS2322: Type 'number' is not assignable to type 'string'. 52 | xmlBundle 53 | .c('preKeyPublic', { > 54 | preKeyId: preKey.getId(), | ^^^^^^^^ 55 | }) 56 | .t(ArrayBufferUtils.toBase64(preKey.getPublic())) 57 | .up(); ERROR in src/plugins/omemo/lib/BundleManager.ts:134:32 TS2322: Type 'number' is not assignable to type 'string'. 132 | 133 | for (let id of deviceIds) { > 134 | xmlList.c('device', { id }).up(); | ^^ 135 | } 136 | 137 | return this.pepService.publish(NS_DEVICELIST, xmlList.tree(), 'current'); ERROR in src/plugins/omemo/util/Stanza.ts:12:10 TS2322: Type 'number' is not assignable to type 'string'. 10 | 11 | encryptedElement.c('header', { > 12 | sid: ownDeviceId, | ^^^ 13 | }); 14 | 15 | for (let key of <EncryptedDeviceMessage[]>message.keys) { ERROR in src/plugins/omemo/util/Stanza.ts:25:36 TS2345: Argument of type '{ rid: number; prekey: any; }' is not assignable to parameter of type 'Record<string, string>'. Property 'rid' is incompatible with index signature. Type 'number' is not assignable to type 'string'. 23 | } 24 | > 25 | encryptedElement.c('key', attrs).t(btoa(key.getCiphertext().body)).up(); | ^^^^^ 26 | } 27 | 28 | encryptedElement.c('iv', ArrayBufferUtils.toBase64(message.iv)).up().up(); ERROR in src/plugins/omemo/util/Stanza.ts:28:32 TS2345: Argument of type 'string' is not assignable to parameter of type 'Record<string, string>'. 26 | } 27 | > 28 | encryptedElement.c('iv', ArrayBufferUtils.toBase64(message.iv)).up().up(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 29 | 30 | encryptedElement.c('payload').t(ArrayBufferUtils.toBase64(message.payload)); 31 | ERROR in src/vendor/Strophe.ts:3:63 TS2339: Property '$iq' does not exist on type 'typeof import("/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/@types/strophe.js/index")'. 1 | import * as StropheLib from 'strophe.js'; 2 | > 3 | export let $iq: (attrs?: any) => Strophe.Builder = StropheLib.$iq; | ^^^ 4 | export let $build: (name: string, attrs?: any) => Strophe.Builder = StropheLib.$build; 5 | export let $msg: (attrs?: any) => Strophe.Builder = StropheLib.$msg; 6 | export let $pres: (attrs?: any) => Strophe.Builder = StropheLib.$pres; ERROR in src/vendor/Strophe.ts:4:80 TS2339: Property '$build' does not exist on type 'typeof import("/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/@types/strophe.js/index")'. 2 | 3 | export let $iq: (attrs?: any) => Strophe.Builder = StropheLib.$iq; > 4 | export let $build: (name: string, attrs?: any) => Strophe.Builder = StropheLib.$build; | ^^^^^^ 5 | export let $msg: (attrs?: any) => Strophe.Builder = StropheLib.$msg; 6 | export let $pres: (attrs?: any) => Strophe.Builder = StropheLib.$pres; 7 | export let Strophe = StropheLib.Strophe; ERROR in src/vendor/Strophe.ts:5:64 TS2339: Property '$msg' does not exist on type 'typeof import("/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/@types/strophe.js/index")'. 3 | export let $iq: (attrs?: any) => Strophe.Builder = StropheLib.$iq; 4 | export let $build: (name: string, attrs?: any) => Strophe.Builder = StropheLib.$build; > 5 | export let $msg: (attrs?: any) => Strophe.Builder = StropheLib.$msg; | ^^^^ 6 | export let $pres: (attrs?: any) => Strophe.Builder = StropheLib.$pres; 7 | export let Strophe = StropheLib.Strophe; 8 | export let NS = StropheLib.Strophe.NS; ERROR in src/vendor/Strophe.ts:6:65 TS2339: Property '$pres' does not exist on type 'typeof import("/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/@types/strophe.js/index")'. 4 | export let $build: (name: string, attrs?: any) => Strophe.Builder = StropheLib.$build; 5 | export let $msg: (attrs?: any) => Strophe.Builder = StropheLib.$msg; > 6 | export let $pres: (attrs?: any) => Strophe.Builder = StropheLib.$pres; | ^^^^^ 7 | export let Strophe = StropheLib.Strophe; 8 | export let NS = StropheLib.Strophe.NS; 9 | export let Status: IStatus = StropheLib.Strophe.Status; ERROR in src/vendor/Strophe.ts:7:33 TS2339: Property 'Strophe' does not exist on type 'typeof import("/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/@types/strophe.js/index")'. 5 | export let $msg: (attrs?: any) => Strophe.Builder = StropheLib.$msg; 6 | export let $pres: (attrs?: any) => Strophe.Builder = StropheLib.$pres; > 7 | export let Strophe = StropheLib.Strophe; | ^^^^^^^ 8 | export let NS = StropheLib.Strophe.NS; 9 | export let Status: IStatus = StropheLib.Strophe.Status; 10 | ERROR in src/vendor/Strophe.ts:8:28 TS2339: Property 'Strophe' does not exist on type 'typeof import("/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/@types/strophe.js/index")'. 6 | export let $pres: (attrs?: any) => Strophe.Builder = StropheLib.$pres; 7 | export let Strophe = StropheLib.Strophe; > 8 | export let NS = StropheLib.Strophe.NS; | ^^^^^^^ 9 | export let Status: IStatus = StropheLib.Strophe.Status; 10 | 11 | interface IStatus { ERROR in src/vendor/Strophe.ts:9:41 TS2339: Property 'Strophe' does not exist on type 'typeof import("/www/wwwroot/szrengjing.com/jsxc/jsxc-master/node_modules/@types/strophe.js/index")'. 7 | export let Strophe = StropheLib.Strophe; 8 | export let NS = StropheLib.Strophe.NS; > 9 | export let Status: IStatus = StropheLib.Strophe.Status; | ^^^^^^^ 10 | 11 | interface IStatus { 12 | ATTACHED: number;
最新发布
11-11
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小胡同1991

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值