文章目录

  • 错误集合_20210131
    • [shell脚本遇到问题"\r': command not found"](https://www.cnblogs.com/bugutian/p/11492157.html)
    • bash: dos2unix: command not found
    • concurrent_log_handler shutdown close()
    • wins10安装 ConcurrentRotatingFileHandler日志处理包
    • 报错py4j.protocol.Py4JError:
    • Py4JJavaError: An error occurred while calling o139.collectToPython.
    • wins10上使用pyspark,相关软件安装
      • hadoop-2.7.1.tar解压时报错
    • mysql workbench8.0:work bench SSL connection error: SSL is required but the server doesn't support it
    • 'gcc' failed
    • [CentOS7 下报错sasl/sasl.h: No such file or directory](https://blog.csdn.net/vkingnew/article/details/86506876)
    • [no mechanism available: No worthy mechs found](https://blog.csdn.net/youngqj/article/details/50954275)
    • hive安装impyla时的报错
    • python在linux下生成文件,增加执行权限
    • fbprophet安装
    • 安装MinGW-w64-gcc编译器
    • win10安装fbprophet:
    • conda更改下载的镜像源:

错误集合_20210131

此部分内容主要是工作中遇到的一些报错,简单的解决方案会直接贴出来,链接一般为问题解决方案详细解释。

shell脚本遇到问题"\r’: command not found"

shell脚本写得一切正常,但是一执行就报错:line: XXX “$’\r’: command not found”

问题原因:文件格式问题(虽然在window和linux上选择的都是UTF-8,然而并没有用),因为我是直接复制了一个别的文件,然后在那个基础上改的。解决方法:dos2unix XXX.sh

然后执行脚本,问题解决。

bash: dos2unix: command not found

sudo yum install -y dos2unix

concurrent_log_handler shutdown close()

[MainThread 13992 Tue Jan 25 17:45:32 2022] In close():

File “/home/upython/anaconda/anaconda3/lib/python3.8/logging/init.py”, line 2123, in shutdown

​ h.close()

File “/home/upython/anaconda/envs/flask_sanic_env/lib/python3.8/site-packages/concurrent_log_handler/init.py”, line 437, in close

​ self._console_log(“In close()”, stack=True)

File “/home/upython/anaconda/envs/flask_sanic_env/lib/python3.8/site-packages/concurrent_log_handler/init.py”, line 314, in _console_log

​ stack_str = “:\n” + “”.join(traceback.format_stack())

在程序结尾加

log.handlers.clear()

wins10安装 ConcurrentRotatingFileHandler日志处理包

pip install ConcurrentLogHandler

调用方式

from cloghandler import ConcurrentRotatingFileHandler

在wins10使用报错如下,在linux系统下正常使用

Traceback (most recent call last):File "C:\Users\yuhai\Anaconda3\envs\ppt\lib\site-packages\portalocker\portalocker.py", line 71, in lockmsvcrt.locking(file_.fileno(), mode, lock_length)
OSError: [Errno 36] Resource deadlock avoided

报错py4j.protocol.Py4JError:

org.apache.spark.api.python.PythonUtils.isEncryptionEnabled does not exist in the JVM

#添加此代码

import findspark

findspark.init()

#添加此代码

# 作用就是初始化找到本机安装的spark的环境

from pyspark import SparkConf, SparkContext

Py4JJavaError: An error occurred while calling o139.collectToPython.

Py4JJavaError: An error occurred while calling o139.collectToPython.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0) (Hayden.mshome.net executor driver): org.apache.spark.SparkException: Python worker failed to connect back.

wins10上使用pyspark,相关软件安装

hadoop-2.7.1.tar解压时报错

D:\hadoop-2.7.1\lib\native\libhadoop.so

D:\hadoop-2.7.1\lib\native\libhdfs.so

mysql workbench8.0:work bench SSL connection error: SSL is required but the server doesn’t support it

新版本:Basically, create new connection using the advanced tab by entering “useSSL=0” in the ‘Others’ tab.

‘gcc’ failed

gcc: error trying to exec ‘cc1plus’: execvp: Permission denied

​ error: command ‘gcc’ failed with exit status 1

安装g++:sudo yum install gcc-c++

CentOS7 下报错sasl/sasl.h: No such file or directory

报错信息:

sasl/sasl.h: No such file or directory

– 解决办法:

# yum search sasl

– 安装:

yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-lib

no mechanism available: No worthy mechs found

yum install cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi

hive安装impyla时的报错

需要安装包:

six==1.12.0
bit_array==0.1.0
thrift==0.9.3
thrift_sasl==0.2.1
sasl==0.2.1
impyla==0.13.8

error: command ‘C:\Users\yuhai\Anaconda3\envs\tf2\Library\mingw-w64\bin\gcc.exe’ failed with exit code 1

改配置:compiler=mingw32---->compiler=msvc

“sasl/sasl.h”: No such file or directory:去网站下载packagehttps://www.lfd.uci.edu/~gohlke/pythonlibs/#sasl

python在linux下生成文件,增加执行权限

python基础一 ------linux某目录下批量的为特定文件加入可执行权限

python修改linux中文件(文件夹)的权限属性

fbprophet安装

https://blog.csdn.net/qq_40583178/article/details/105130423

安装MinGW-w64-gcc编译器

https://www.jianshu.com/p/5490a044c92d

win10安装fbprophet:

https://blog.csdn.net/qq_40583178/article/details/105127517

WARNING:pystan:MSVC compiler is not supported:https://blog.csdn.net/u012111465/article/details/89115582

conda更改下载的镜像源:https://zhuanlan.zhihu.com/p/95100538

清华镜像源:https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/

新增:

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/

显示通道地址:

conda config --set show_channel_urls yes

删除镜像源:

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/

更改虚拟环境的python版本

conda install python==3.8 -n “指定虚拟环境的名字”

安装python包时报错

Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: https://visualstudio.microsoft.com/visual-cpp-build-tools/

解决方法:https://blog.csdn.net/qq_38161040/article/details/87929616

文件官网链接https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=53840

安装fbprophet时报c++14:https://blog.csdn.net/bkdly9/article/details/99312509

python模型结构不能打印的问题

https://blog.csdn.net/hopedu/article/details/121008167

最终将from keras.utils import plot_model改为from keras.utils.vis_utils import plot_model成功运行

我的也没成功

https://www.jianshu.com/p/35b12da0c8c0

成功打印模型结构,更改完环境变量重启电脑,64位的graphviz不行就试下32位的

linux定时任务

crontab -e 在当前用户下设置定时任务

*/2 * * * * /home/upython/single_time_series/sh_test/hello.sh

sudo vi /etc/crontab # 这种方式需要指定定时任务的用户

*/2 * * * * upython /home/upython/single_time_series/sh_test/hello.sh

在hello.sh调用python文件,如果里面有使用到路径,要使用绝对路径,要不然文件自动到/home/upython/下,即用户的家目录。

查看定时任务记录

sudo tail -f /var/log/cron

给python和shell文件加权限

普通用户 下 bash single_tms.sh 可以正常运行

但是在定时任务中不可以运行,因为定时任务用的是root权限,默认使用了python2,所以有各种报错。之前报字符串格式化问题,我换了种方式,然后又报没有numpy包,让人有点不可信。所以推测是版本问题。

nohup /home/upython/anaconda/envs/flask_sanic_env/bin/python {basepath}/hello_sh.py --num1 1 --str1 {basepath} > ${basepath}/run_sh_test1.out 2>&1 &

在使用python是指定python版本位置

Linux 退出所有已登录的用户

ps aux | grep bash | awk '{print $2}' | xargs kill -9

no crontab for root 解决方案

主要原因是由于这个liunx服务器 第一次使用 crontab ,还没有生成对应的文件导致的,执行了 编辑(crontab -e)后 就生成了这个文件

任务日志logging

python前端打印格式设置:高亮,颜色,背景色

开头部分:

\033[0m 默认字体正常显示,不高亮

\033[32;0m 红色字体正常显示

\033[1;32;40m 显示方式: 高亮 字体颜色:绿色 背景色:黑色

\033[0;31;46m 显示方式: 正常 字体颜色:红色 背景色:青色

结尾部分:

\033[0m

linux图片不显示中文字体

/home/upython/anaconda/envs/flask_sanic_env/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc

按上面教程操作即可,其中改配置时把SimHei换成simhei即可

linux安装anaconda

wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh

清华anaconda镜像

https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

https://cloud.tencent.com/developer/article/1676592

linux anaconda 安装python包,虚拟环境退出,激活,查看,删除,依赖环境生成

https://blog.csdn.net/shu616048151/article/details/103922017

执行pip3 install virtualenv出现WARNING错误:

The script virtualenv is installed in ‘/home/upython/.local/bin’ which is not on PATH.

解决方法

echo ‘export PATH=/home/upython/.local/bin:$PATH’ >>~/.bashrc

source ~/.bashrc

先卸载再安装

pip3 uninstall virtualenv

pip3 install virtualenv

linux安装python

python2与python3切换

python依赖环境

pip3 freeze > requirements.txt

xxx is not in the sudoers file.This incident will be reported.的解决方法

ps:这里说下你可以sudoers添加下面四行中任意一条youuser ALL=(ALL) ALL%youuser ALL=(ALL) ALLyouuser ALL=(ALL) NOPASSWD: ALL%youuser ALL=(ALL) NOPASSWD: ALL

第一行:允许用户youuser执行sudo命令(需要输入密码).第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).第三行:允许用户youuser执行sudo命令,并且在执行的时候不输入密码.第四行:允许用户组youuser里面的用户执行sudo命令,并且在执行的时候不输入密码.

wget: unable to resolve host address解决方法

更改linux用户名

pycharm专业版破解

pycharm专业版破解:版本pycharm-professional-2020.3.5

http://www.python66.com/bbs/140.html

插件:一直更新首次试用时间

python包阿里镜像http://mirrors.aliyun.com/pypi/simple

sublime破解版

错误集合_20220131相关推荐

  1. PCL安装常见的错误集合解决方案(一)

    常见的错误集合解决方案(一) No.1 提示错误 'Microsoft.VC90.CRT,version="9.0.21022.8" 把Microsoft.NET Framewor ...

  2. Mapx 错误集合(转载)

    Mapx 错误集合(转载) 2011年10月04日 This is a table of the MapX errors encountered when writing MapX applicati ...

  3. Anaconda prompt常用语句以及常见错误集合啦!

    前言 版本说明:本机现为win10系统+Anaconda3-4.0.0-Windows-x86_64(清华大学开源镜像网站)其内置Python版本为3.5.一次偶然的机会,打开了jupyter,就有点 ...

  4. swift 错误集合 ------持续更新中

    从今天开始凡是在用swift中遇到的错误都会在本博客持续更新 便于自己学习和快速开发 2017.7.20 如果你的程序写的有进入后台的方法,例如我的博客中点击home进入后台持续定位的那篇文章,发信进 ...

  5. python常见错误集合

    使用python会出现各种各样的错误,LZ专门设立了一个博客,在今后使用的过程中,遇到不同的问题都会把它整理到这个博客下面. 1.ValueError: 'Conv2d_1a_3×3' is not ...

  6. highcharts图表组件常见问题:highcharts图表组件错误集合分析大放送

    hicharcharts  常见错误  :http://www.stepday.com/topic/?917 转载于:https://blog.51cto.com/5148737/1662011

  7. yolov3 pytorch错误集合

    File "D:\tmp\pytorch-yolo3\cfg.py", line 134, in print_cfg assert(prev_width == out_widths ...

  8. 【Android应用开发】Android Studio 错误集锦 -- 将所有的 AS 错误集合到本文

    . 一. 编译错误 1. "AndroidManifest.xml file not found" 错误 (1) 报错信息 报错信息 : -- Message Make : Inf ...

  9. C++编译-链接错误集合

    1,无法解析的外部符号,链接错误,原因:没找到某个符号(变量或函数)的定义体,一般是对应函数没实现,或第三方库没有添加到工程设置中 2,重复链接链接错误,一个定义体(实现体)被多个CPPP文件包含,导 ...

最新文章

  1. 蚂蚁金服面试经历-临场发挥
  2. wps如何和matlab兼容,怎样使wps和office兼容
  3. 三级栏目选项卡 html,李长河 中文主页 实验题目三级页面(隐藏栏目,用于放置对应三级页面) 中国地质大学(武汉)教师个人主页系统...
  4. 架构师必须掌握的各种编码:ASCII、ISO-8859-1、GB2312
  5. 用数据结构c语言写成绩排序,C语言数据结构 快速排序实例详解
  6. 用css实现模仿火狐社区的一个提示框
  7. 铁路系统的在线检测系统讲座
  8. java json转map_Java 把json对象转成map键值对的方法
  9. 自己写的一个校验IP、IP掩码、IP段的方法封装到了JQ中,方便了使用者的使用...
  10. Github上传代码及解决main主分支问题
  11. 动态规划——详细入门讲解
  12. 计算机语言工资排行,Python位居编程语言薪资排行榜前列!风变编程打造职场竞争力...
  13. java 位掩码_奇怪的知识——位掩码
  14. 新建word文档没保存能恢复吗(已有579人收藏)
  15. 为艺术而生的惊艳算法
  16. 【华为OD机试真题2023 JAVA】不含101的数
  17. Visual Studio 2008 安装出错 无法安装 的解决办法
  18. 4.1 集成运算放大电路概述
  19. Linux下数据库表结构导入导出
  20. [转帖]关于 /dev/urandom 的流言终结 | Linux 中国

热门文章

  1. 成为顶尖架构师必须要面对的面试题
  2. websql使用实例
  3. 每天备份NAS上的www目录到一块单独的硬盘上
  4. 谈谈软件工程与计算机科学的区别
  5. 转载 漫谈机器学习中的距离和相似性度量方法
  6. on the way
  7. 不想在博问中提出的问题
  8. Linux下如何发现内存泄漏问题(测试角度)
  9. selenium 定位方式3-css_selector
  10. java 16进制_JAVA十六进制数据接收与传输