4000-520-616
欢迎来到免疫在线!(蚂蚁淘生物旗下平台)  请登录 |  免费注册 |  询价篮
主营:原厂直采,平行进口,授权代理(蚂蚁淘为您服务)
咨询热线电话
4000-520-616
当前位置: 首页 > 新闻动态 >
新闻详情
科学网—windows max path导致的问题ValueError: source code...
来自 : blog.sciencenet.cn/blog-337396 发布时间:2021-03-24

【版权所有,转载请注明出处】

问题描述:运行python程序,在import语句部分出现:ValueError: source code string cannot contain null bytes

错误

网络搜索出来的结果:

解决方案:linux下面运行sed -i s/\\x0//g Filename

测试方法:无效

问题回想:本机安装python 3的时候有一个

Disable path length limit的选项,但是服务器上安装的时候没有,所有猜测与这个有关。

查看系统配置:本机(Win 10 1709)服务器(Win10 1511)

检索到的帖子:http://mspoweruser.com/ntfs-260-character-windows-10/

Open Group Policy Editor (Press Windows Key and typegpedit.mscand hitEnterkey.

Navigate to the following directory:Local Computer Policy Computer Configuration Administrative Templates System Filesystem NTFS.

ClickEnable NTFS long pathsoption and enable it.

来自 http://mspoweruser.com/ntfs-260-character-windows-10/

查看本机的配置【计算机配置-管理模板-文件系统】

\"1.png\"

\"2.png\"


查看服务器的竟然没有这个

\"3.png\"

好吧,所以问题的解决方案来了。

想方设法把path(from module import * 中的module的路径)的长度改短一些(比如重命名,比如移动文件夹and so on)。果然,问题迎刃而解!




转载本文请联系原作者获取授权,同时请注明本文来自于留传科学网博客。
链接地址:http://blog.sciencenet.cn/blog-3373964-1101916.html

上一篇:尾部的零

本文链接: http://maxsource16.immuno-online.com/view-708009.html

发布于 : 2021-03-24 阅读(0)
公司介绍
联络我们
服务热线:4000-520-616
(限工作日9:00-18:00)
QQ :1570468124
手机:18915418616
官网:http://