-
Python报错ERROR: Command errored out with exit status 1:
2019-08-22 16:12:59因为Pycharm最近老是弹出RELP COMMUNICATIONS,非常影响代码运行的效率。 REPL(Read-Eval-Print Loop),翻译过来就是“读取-求值-输出”循环,是一个简单的...ERROR: Command errored out with exit status 1: ...2020.08.24更新:似乎产生这个的原因,就是因为Python 2和Python 3默认的编码格式不一样。
Python 2是GBK,而Python 3是UTF-8。所以有些老旧的包在安装时,会产生编码的问题。
因为Pycharm最近老是弹出RELP COMMUNICATIONS,非常影响代码运行的效率。
REPL(Read-Eval-Print Loop),翻译过来就是“读取-求值-输出”循环,是一个简单的交互式的编程环境。
听起来似乎挺有用,所以想直接在Pycharm中pip这个REPL。
结果报错:
ERROR: Command errored out with exit status 1:
主要错误显示在最后几行:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 1246: illegal multibyte sequence
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.定位问题:
UnicodeDecodeError,表明是编码的问题。
具体就是在setup.py文件中的第10行和第17行,读取文件的编码方式为GBK,而并非UTF-8,因此报错使得无法安装。
更新成功解决的方法:
由于不能使用 Pycharm 里的 Project Interpreter。
解决思路:下载源码的包,进行代码改动之后install。
1、找到原始package的文件,找到报错的那一行。
REPL的官方地址是:https://github.com/mbr/repl。查看报错的setup文件的源码。
定位问题:源码中没有指定open时的编码方式,使得默认为gbk编码。
报错的源码:
def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read()
2、下载原始包文件后,解压找到setup.py文件,修改文件里的这一行,即加上encoding='utf-8',保存后打包为新的安装包。
修改后的代码:
def read(fname): return open(os.path.join(os.path.dirname(__file__), fname),encoding='utf-8').read()
3、输入 pip install repl-1.0.tar.gz,用新的安装包来进行install。成功!
这个问题困扰了我一周,后来发现其实解决方法非常简单!
解决问题最重要的是要定位报错产生的原因,然后根据原因一步步找到解决的方法。
-
python安装第三方库遇到 ERROR: Command errored out with exit status 1:
2019-08-16 18:33:05python安装第三方库遇到 ERROR: Command errored out with exit status 1:…的问题 先来看看错误提示: 本来想用python弄个词云玩玩,没想到在安装wordcloud库的时候居然给我这一大串红叉叉,很是奔溃,出师不利啊!...python安装第三方库遇到 ERROR: Command errored out with exit status 1:…的问题
先来看看错误提示:
本来想用python弄个词云玩玩,没想到在安装wordcloud库的时候居然给我这一大串红叉叉,很是奔溃,出师不利啊!
报错的部分内容如下:
ERROR: Command errored out with exit status 1:
command: ‘c:\users\15870\appdata\local\programs\python\python37-32\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\15870\AppData\Local\Temp\pip-install-2wcyweho\wordcloud\setup.py’"’"’; file=’"’"‘C:\Users\15870\AppData\Local\Temp\pip-install-2wcyweho\wordcloud\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\15870\AppData\Local\Temp\pip-record-9qx3thr5\install-record.txt’ --single-version-externally-managed --compile说实话作为一个渣渣新手,我是真的是看不懂这是个啥错误,但是,没关系,做为非专业人人士搞不懂错因也问题不大,能解决问题就行了,于是,经过一番查询,算是找到一个解决方法如下:
-
先打开python看看自己的python是什么版本的,多少位的。像我的就是3.7.3版本32位;
-
去https://www.lfd.uci.edu/~gohlke/pythonlibs/找到对应版本的whl文件,我的话就是找wordcloud-1.5.0-cp37-cp37m-win32.whl这一个,其中cp37代表3.7版本,win32代表Windows系统32位机。
-
下载对应的whl文件后,在cmd下进入whl所在的文件夹
-
最后再输入pip install wordcloud-1.5.0-cp37-cp37m-win32.whl进行安装就可以了。
最后就可以用了,希望对大家能有帮助!
-
-
Linux下提示bash:command not found解决方法小结
2019-04-19 14:33:580x00 前言 文章中的文字可能存在语法错误以及...1.前几次还好用的命令,这次再输入就出现-bash: ***: command not found的情况; 2.第一次使用就出现 -bash: ** : command not found的情况。 导致这种问题的原...0x00 前言
文章中的文字可能存在语法错误以及标点错误,请谅解;
如果在文章中发现代码错误或其它问题请告知,感谢!
0x01 解决方法
我们在使用linux开发编译的时候可能会遇到:
1.前几次还好用的命令,这次再输入就出现-bash: ***: command not found的情况;
2.第一次使用就出现 -bash: ** : command not found的情况。
导致这种问题的原因有很多(就像导致肚子疼痛的原因各种各样),有可能是环境变量配置问题,也可能某一个bin文件夹下的内容全部删除导致等,所以现在将主要导致bash:command not found的原因写在下面,希望对大家的开发过程有帮助。1.检查该命令工具是否安装
出现这个问题时,首先用whereis命令确定该指令工具是否安装,例如确定gcc是否安装
whereis gcc
,如果此时显示gcc:/usr/bin/gcc
则说明已经安装好,可以接着用下面的方法继续找原因,如果只是显示gcc:
,则说明gcc没有下载,此时进行下载就可以。Centos(Rehat系列)系统下载gcc命令:
yum install gcc
Ubuntu系统下载gcc命令:apt-get inatall gcc
2.检查各个bin文件夹的内容是否非空
在使用其它相对更复杂的手段“还原”到之前好用的状态之前,应该先检查的bin文件夹里的命令是否都在,这个方法最简单也最直观。如果自己需要用到的命令所在的bin文件夹为空,那么就会理所应当的出现-bash: ***: command not found情况。要检查的bin文件夹有以下几个:
/bin, /usr/bin, /sbin, /usr/sbin查看这四个里面的是否为空,若出现为空的情况,那么解决办法就是找一个同样系统版本的linux把对应文件夹的内容复制到本地空的bin文件夹中。例如我的linux版本是CentOS release 6.8,我输入gcc命令编译的时候出现
bash: gcc: command not found
,通过查看四个目录发现其中 /usr/bin内容为空,然后自己通过将同样的CentOS release 6.8系统下的 /usr/bin内容全部复制到本地的/usr/bin中,然后再次gcc编译,通过。
注意,这种排查方法适用在输入类似ls、tty这种常见指令以前可用但最近出现not found的情况。3.检查是否是$PATH设置是否正确
$PATH决定了shell到哪些目录下去寻找命令或工具,PATH的值是一系列目录,当程序运行时,Linux系统会到这些目录下进行搜索,所以当出现 -bash: ** : command not found可能因为是PATH没有设置。PATH设置格式:
PATH = $PATH:<PATH1>:<PATH2>:<PATH3>:...:<PATH N>
可以将自己指定的路径加到PATH中(见上,若有多个变量路径则在中间用冒号":"隔开),例如:
export PATH=/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH
,设置成功之后,使用echo查看是否配置成功:[root@localhost u-boot-sh4]# echo $PATH /opt/STM/STLinux-2.3/devkit/sh4/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
上述方法添加PATH 在终端关闭后会消失。建议通过 vi /etc/profile 修改PATH,也可修改主用户目录下的 .bashrc,这样可以永久生效。若使用前一种方法,则输入指令
vi /etc/profile
,然后在该文件最后添加:export PATH="/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH"
保存后,退出,再执行:
[root@localhost etc]# source /etc/profile
不报错就成功。
当然,可能还有其它原因导致bash:command not found,这时候就需要在网上仔细找,把导致该问题的前因后果都说清楚(配置了什么,删掉了什么),相信问题最后一定能解决。
以上。
参考文档:
1.https://blog.csdn.net/awenluck/article/details/25233883
2.https://blog.csdn.net/panjiao119/article/details/79790324
3.https://blog.csdn.net/zq199692288/article/details/78871046
4.https://blog.csdn.net/FightForProgrammer/article/details/41960707 -
【解决】io.lettuce.core.RedisCommandTimeoutException: Command timed out
2018-03-20 19:18:23springboot(spring也一样的)整个redis 的时候报如下错误:org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: ...springboot(spring也一样的)整个redis 的时候报如下错误:
org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:70) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:257) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceConnection.pSubscribe(LettuceConnection.java:747) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.listener.RedisMessageListenerContainer$SubscriptionTask.eventuallyPerformSubscription(RedisMessageListenerContainer.java:783) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.listener.RedisMessageListenerContainer$SubscriptionTask.run(RedisMessageListenerContainer.java:750) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151] Caused by: io.lettuce.core.RedisCommandTimeoutException: Command timed out at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:114) ~[lettuce-core-5.0.2.RELEASE.jar:na] at io.lettuce.core.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:62) ~[lettuce-core-5.0.2.RELEASE.jar:na] at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80) ~[lettuce-core-5.0.2.RELEASE.jar:na] at com.sun.proxy.$Proxy70.psubscribe(Unknown Source) ~[na:na] at org.springframework.data.redis.connection.lettuce.LettuceSubscription.doPsubscribe(LettuceSubscription.java:54) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.connection.util.AbstractSubscription.pSubscribe(AbstractSubscription.java:130) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceConnection.pSubscribe(LettuceConnection.java:745) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] ... 3 common frames omitted
错误原因:连接超时时间设置的过于短暂(我这边设置成了0),修改为5000左右即可
# REDIS (RedisProperties) # Redis数据库索引(默认为0) spring.redis.database=0 # Redis服务器地址 spring.redis.host=192.168.30.103 # Redis服务器连接端口 spring.redis.port=6379 # Redis服务器连接密码(默认为空) spring.redis.password= # 连接池最大连接数(使用负值表示没有限制) spring.redis.jedis.pool.max-active=8 # 连接池最大阻塞等待时间(使用负值表示没有限制) spring.redis.jedis.pool.max-wait=-1 # 连接池中的最大空闲连接 spring.redis.jedis.pool.max-idle=8 # 连接池中的最小空闲连接 spring.redis.jedis.pool.min-idle=0 # 连接超时时间(毫秒) spring.redis.timeout=5000
-
Design Pattern - Command(C#)
2019-02-11 15:59:07分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!... Definition Encapsulate a request as an object, thereby letting you parameterize clients with different ... -
PS CC2019 安装过程中遇到 Command line option syntax error. Type Command /? for Help.
2019-02-15 09:47:57背景前言: 昨天买了一块高漫WH...那就是Command line option syntax error. Type Command /? for Help. what?? 什么鬼.为什么会这样,!! OK经过各种度娘.说是安装路径有中文名称.好吧奶奶个腿; 仔细检查没有啊,... -
解决mac安装homebrew后报错-bash: brew: command not found
2016-09-18 10:32:36参照官网上很简单的一句安装命令, /usr/bin/ruby -e "...安装完毕后,发现使用brew命令,却总是提示:-bash: brew: command not found 于是怀疑安装过程出现问题,打算重装,重装却报: ... -
解决:bash: make: command not found
2017-06-19 15:44:17一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make、vim等常用命令,直接yum安装下即可。 yum -y install gcc automake autoconf libtool make -
SpringBoot报错Error running 'Application': Command line is too long.Shorten command line for
2019-03-30 14:34:28Command line is too long.Shorten command line for Application or also for Spring Boot default configuration. 二、报错原因 springboot项目启动命令过长 三、解决办法 点击项目启动配置项 -> short..... -
Command line is too long. Shorten command line for SpringBootMainApplication or also for Application
2018-12-03 18:09:02Error running 'SpringBootMainApplication': Command line is too long. Shorten command line for SpringBootMainApplication or also for Application default configuration. 解决方案: 修改项目下 .... -
command1&&command2||command3
2017-03-24 15:14:20类似于C++中的?: 若command1为真,则执行command2,否则执行command3 a=1 [ $a -eq 1 ]&&b=1||b=2 echo $b 输出: 1 (&&是前者为真再执行后者,||是前者执行失败再执行后者) -
Linux安装Git命令(docker环境下提示git command not found)
2020-11-12 14:18:02git clone直接报错git command not found 解决 因为机器上面已经安装了docker仓库,docker可以拉取tomcat和jdk,就习惯的docker pull git, #docker pull git Using default tag: latest Error response from daemon... -
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
2020-03-04 11:18:03Please run next command `npm update` 按照提示操作,运行npm update也没有解决。 于是我查询了一下npm手册,得知是不能直接运行npm update的,必须带上包名,所以应该这样写命令: npm update caniuse-lite... -
Command line is too long. Shorten command line for
2019-05-20 15:56:16Error running 'ServiceStarter': Command line is too long. Shorten command line for ServiceStarter or also for Application default configuration. 解法: 修改项目下 .idea\workspace.xml,找到标签<... -
Command line is too long问题解决
2018-07-09 20:38:59Idea启动项目报错:Command line is too long. Shorten command line for className or also for JUnit defaultconfiguration.如下图所示:解决方法:在该项目文件夹.idea/workspace.xml中找到<component name... -
成功解决ERROR: Command errored out with exit status 1: command: 'f:\program files\python\python36\...
2020-01-07 22:12:39成功解决ERROR: Command errored out with exit status 1: command: 'f:\program files\python\python36\pyt 解决问题 Building wheel for av (setup.py) ... error ERROR: Command errored out with exit ... -
Intellij IDEA运行报Command line is too long解法
2018-06-07 16:22:42报错内容:Error running 'ServiceStarter': Command line is too long. Shorten command line for ServiceStarter or also for Application default configuration.解法:修改项目下 .idea\workspace.xml,找到标签 ... -
安装 brew command not found
2019-08-14 17:36:02-bash: brew: command not found 解决 有两种原因,一种是不在path目录下,一种是没有安装。 首先安装一下试试: /usr/bin/ruby -e "$(curl -fsSL ... -
idea启动服务的时候报:Command line is too long错误
2019-04-11 15:31:43Idea启动项目报错:Command line is too long. Shorten command line for App or also for Spring Boot default configuration. 如下图所示: 解决方法: 在该项目文件夹.idea/workspace.xml中找到 <... -
MongoDB executeCommand返回结构 CommandResult解析
2016-07-24 09:38:21如果查询结果为List时:CommandResult result = this.mongoTemplate.executeCommand(command); BasicDBList list = (BasicDBList)result.get("values"); List<String>retList = new ArrayList(); retList.a -
Mac OS zsh: command not found: mysql解决方案
2018-12-28 15:45:31打开终端,命令行输入:mysql,总是返回:zsh:command not found: mysql 网上的各种方法都试过了,比如ln -s 系列的改路径,command+R的改权限,统统都不行。 后来找到方法,轻松解决问题,在这里记录一下: ... -
archive_command、restore_command 的常见设置
2018-09-14 14:16:40archive_command 是 postgresql.conf 里的参数。 restore_command 是 recovery.conf 里的参数。 非压缩 archive_command = 'cp %p /data/backup/pgwalarchive/%f &amp;amp;&amp;amp; ... -
-bash: wget: command not found解决方法
2019-05-14 13:56:46-bash: wget: command not found 很显然,问题出现的原因是由于没有安装wget命令,可以通过以下两种方法来安装: 1、rpm安装 wget的RPM包下载地址:http://www.rpmfind.net/linux/rpm2html/search.php?query=wget... -
Mac command+c或command+v失效解决办法之一
2020-06-20 17:00:17热键冲突的问题,若Mac开启了有道词典自动取词功能,退出取词功能即可! ...退出了就好了,或者是把command转移换成其他的不常用的键,移位试试,可以自定义把不常用的大写锁定键改成command键 ... -
Command line is too long,Shorten command line for WebApplication or also for Spring Boot 的解决办法
2020-01-03 23:15:24在使用IntelliJ IDEA工具开发项目的过程中遇到一个梗,项目准备就绪,可是启动不起来,报 “Command line is too long,Shorten command line for WebApplication or also for Spring Boot default configuration.... -
-bash: flutter: command not found 或者 zsh: command not found: flutter
2019-05-31 09:40:27-bash: flutter: command not found 或者 zsh: command not found: flutter 在配置flutter的时候,配到path的地方就遇到了问题,按官方文档的方法去配zsh: command not found: flutter的问题,废话少说,上方案: ... -
Intellij IDEA运行报command line is too long. shorten command line for xxx 解法
2020-01-09 14:57:05Intellij IDEA运行报command line is too long. shorten command line for xxx 解法 -
Unknown CMake command
2019-05-12 23:43:00Unknown CMake command “add_clang_library”.等 在官网上照着打 发现上面错误 结果是版本问题 选好版本和选项catkin还是rosbuild -
HystrixCommand注解含义
2019-09-18 16:26:05public interface HystrixCommand { // HystrixCommand 命令所属的组的名称:默认注解方法类的名称 String groupKey() default ""; // HystrixCommand 命令的key值,默认值为注解方法的名称 String commandKey... -
Mac 使用git出现xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
2019-03-11 10:14:01xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun 解决方法 终端输入 xcode-select --install 按...
-
转行做IT-第8章 类与对象、封装、构造方法
-
AI-人脸口罩识别特训营
-
Qt项目实战之基于Redis的网络聊天室
-
微弱信号高精度线性放大电路的设计
-
全网唯一的为GIS+BIM而生的cesiumjs或cesium视频教程
-
基于LPP_SIFT和巴氏距离相结合的人脸识别算法
-
浅析在招投中ITSS运维资质为何被成为竞标的重要资质
-
jdk api 1.8_google.zip
-
转行做IT-第6章 IDEA、方法
-
Linux与数据库基础
-
JavaEE框架(Maven+SSM)全程实战开发教程(源码+讲义)
-
Linux命令之apt-get命令
-
手势解锁-canvas-javascript实战
-
Qt QSS选择器说明
-
商业的本质——杰克·韦尔奇著
-
S7-1200-1500.zip
-
微信支付V3版微信小程序支付PYTHON版
-
cfa一级2021年2月最新的百题,免费下载哦
-
Multiavatar 多元文化头像生成器
-
Laya 2.0 开发3D小游戏 入门教学