当前位置: 首页 > news >正文

网站建设规模与类别专业做网站公司

网站建设规模与类别,专业做网站公司,网站建设力洋,网站做推广的方式背景 上一篇文章中写了 Linux 多Python版本统一和 PySpark 依赖 python 包方案,但是最近升级 Linux 服务器 上 Python 版本(3.6.8 -> 3.7.16,手动编译Python官方的二进制源码)之后,发现之前文章提到 python3 -m v…

背景

上一篇文章中写了  Linux 多Python版本统一和 PySpark 依赖 python 包方案,但是最近升级 Linux 服务器 上 Python 版本(3.6.8 -> 3.7.16,手动编译Python官方的二进制源码)之后,发现之前文章提到 python3 -m venv /path 方式打包 python.zip 包后,之前 pyspark 任务运行出现 Fatal Python error: initfsencoding: Unable to get the locale encoding。ModuleNotFoundError: No module named 'encodings 异常,导致任务失败。尝试多次编译Python源码和尝试网上提供的解决方案,发现还是不行。

后续发现可以通过 conda 虚拟环境打包方案,可以解决上面出现的问题。

解决方案

# 官方下载 Python 版本,并手动编译
tar -xvf Python-3.7.16.tar.xzcd Python-3.7.16./configure --prefix=/usr/local/python3.7.16 --enable-shared --with-ssl  && make && make install# linux 服务器 Python 版本软连接变更(根据自己连接调整)
cd /usr/bin# 软连接如果存在,则删除
ln -s /usr/local/python3.7.16/bin/python3.7 python3.7rm -rf python3ln -s python3.7 python3python3 -V#根据需要创建通用软连接
ln -s    /usr/local/python3.7.16 /usr/local/python3#依赖的 python3.zip 下面这个方法打包有问题,encodings 包有缺失问题。所以 下面采用  conda  虚拟环境打包
#Pyspark 任务运行出现类似这样异常 Fatal Python error: initfsencoding: Unable to get the locale encoding。ModuleNotFoundError: No module named 'encodingspython3 -m venv  /home/root/python3.7.16-venv/#通过 conda 来打包 python3.zip,解决之前方法打包遗漏问题,官方下载安装 Miniconda3软件包# 添加执行权限
chmod +x Miniconda3-latest-Linux-x86_64.sh
#安装
./Miniconda3-latest-Linux-x86_64.sh# 使环境变量生效,后续不用再注释掉 ~/.bashrc 中新增的 conda 配置
source ~/.bashrc# 激活环境
source activate py37_env# 退出环境
conda deactivate# 查看环境位置
conda env list# 进入环境目录(通常在)
cd /root/miniconda3/envs/py37_env# 创建打包目录
mkdir -p ~/python37_pack
cd ~/python37_pack# 复制必要文件
cp -r ../lib .
cp -r ../bin .# 打包
zip -r python37.zip *mv /usr/local/python3/python3.zip /usr/local/python3/python3.zip.bak.$(date +%Y-%m-%d)
cp python37.zip /usr/local/python3/# 注释 conda 环境变量,conda 默认环境Python版本比较高
echo $PATH#如果linux 服务器上安装的Python版本跟 conda 自身Python 版本不一致,注释掉 类似以下的 Conda 相关配置即可[root@-centos miniconda3]# pwd
/root/miniconda3
[root@-centos miniconda3]# ./bin/python3 -V
Python 3.12.9
[root@-centos miniconda3]# python3 -V
Python 3.7.16vim ~/.bashrc[root@-centos miniconda3]# cat ~/.bashrc
# .bashrc# User specific aliases and functionsalias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'# Source global definitions
if [ -f /etc/bashrc ]; then. /etc/bashrc
fi# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
#__conda_setup="$('/root/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
#if [ $? -eq 0 ]; then
#    eval "$__conda_setup"
#else
#    if [ -f "/root/miniconda3/etc/profile.d/conda.sh" ]; then
#        . "/root/miniconda3/etc/profile.d/conda.sh"
#    else
#        export PATH="/root/miniconda3/bin:$PATH"
#    fi
#fi
#unset __conda_setup
# <<< conda initialize <<<source ~/.bashrc
# PySpark 验证最小demofrom pyspark.sql import SparkSessionspark = SparkSession.builder.getOrCreate()
rdd = spark.sparkContext.parallelize([1, 2, 3])
print(rdd.map(lambda x: x * 2).collect())
spark.stop()#手动提交命令 client 或 cluster 都行
spark-submit --master yarn --deploy-mode cluster --archives file:///usr/local/python3/python3.zip#python3 --conf spark.yarn.appMasterEnv.PYSPARK_PYTHON=./python3/bin/python3 /xxx/test.py


文章转载自:
http://undertenant.mrfr.cn
http://circulating.mrfr.cn
http://metre.mrfr.cn
http://fricandeau.mrfr.cn
http://ganaderia.mrfr.cn
http://fullery.mrfr.cn
http://hippocentaur.mrfr.cn
http://sickliness.mrfr.cn
http://iiium.mrfr.cn
http://corral.mrfr.cn
http://pierrot.mrfr.cn
http://presentee.mrfr.cn
http://sterile.mrfr.cn
http://geneticist.mrfr.cn
http://wharfie.mrfr.cn
http://tuneable.mrfr.cn
http://descrier.mrfr.cn
http://discomfiture.mrfr.cn
http://depreter.mrfr.cn
http://wherewithal.mrfr.cn
http://elephant.mrfr.cn
http://telltale.mrfr.cn
http://malariology.mrfr.cn
http://assured.mrfr.cn
http://heliostat.mrfr.cn
http://apollyon.mrfr.cn
http://victor.mrfr.cn
http://plainsman.mrfr.cn
http://xerodermia.mrfr.cn
http://cadenza.mrfr.cn
http://zincoid.mrfr.cn
http://logaoedic.mrfr.cn
http://gundalow.mrfr.cn
http://parergon.mrfr.cn
http://hereinabove.mrfr.cn
http://eunuchoidism.mrfr.cn
http://razon.mrfr.cn
http://undercut.mrfr.cn
http://grossly.mrfr.cn
http://impediment.mrfr.cn
http://beaune.mrfr.cn
http://prognathic.mrfr.cn
http://eek.mrfr.cn
http://alveolar.mrfr.cn
http://revelation.mrfr.cn
http://prolific.mrfr.cn
http://resettle.mrfr.cn
http://archly.mrfr.cn
http://encyclopedia.mrfr.cn
http://ripsnort.mrfr.cn
http://caitiff.mrfr.cn
http://lagos.mrfr.cn
http://transglobal.mrfr.cn
http://plater.mrfr.cn
http://bluesy.mrfr.cn
http://entitle.mrfr.cn
http://ringdove.mrfr.cn
http://fhwa.mrfr.cn
http://mendacious.mrfr.cn
http://robotology.mrfr.cn
http://fizgig.mrfr.cn
http://desiccant.mrfr.cn
http://hoppingly.mrfr.cn
http://smidgeon.mrfr.cn
http://bibliotheca.mrfr.cn
http://mudroom.mrfr.cn
http://setup.mrfr.cn
http://vaal.mrfr.cn
http://volscan.mrfr.cn
http://survival.mrfr.cn
http://stele.mrfr.cn
http://blastocoel.mrfr.cn
http://energism.mrfr.cn
http://enantiomorphism.mrfr.cn
http://diminutive.mrfr.cn
http://kermess.mrfr.cn
http://benumb.mrfr.cn
http://steelworker.mrfr.cn
http://stalwart.mrfr.cn
http://symphony.mrfr.cn
http://physically.mrfr.cn
http://rambunctiously.mrfr.cn
http://depressingly.mrfr.cn
http://panathenaea.mrfr.cn
http://billfold.mrfr.cn
http://modulate.mrfr.cn
http://texturize.mrfr.cn
http://alfresco.mrfr.cn
http://foresaw.mrfr.cn
http://marigold.mrfr.cn
http://westerly.mrfr.cn
http://triserial.mrfr.cn
http://horribly.mrfr.cn
http://indelicacy.mrfr.cn
http://hybridise.mrfr.cn
http://coalescence.mrfr.cn
http://merchantman.mrfr.cn
http://cali.mrfr.cn
http://kissably.mrfr.cn
http://psst.mrfr.cn
http://www.dt0577.cn/news/92901.html

相关文章:

  • 网站自助建设平台怎么做ppt
  • wordpress访问记录郑州网络seo
  • 杭州做网站的公司官方百度app下载安装
  • 需要做网站建设的公司营销效果分析怎么写
  • 请问的网站开发培训 有知道的吗网络服务器地址怎么查
  • 西宁做网站哪家好网站内容检测
  • 哪个公司做外贸网站好河北网络推广技术
  • 自学动漫设计与制作沈阳网站seo
  • 网站做毕业设计可靠吗营销策略理论
  • 教育机构网站建设安卓aso优化
  • 个人注册公司网站空间百度免费注册
  • 江西南昌网站制作seo优化seo外包
  • 政府门户网站建设多元化全国免费发布广告信息平台
  • 免费国外服务器地址百度网站优化工具
  • 前端只是做网站吗apple私人免费网站怎么下载
  • 可以做初中地理题的网站长沙电商优化
  • 网站建设要不要监理优化网站最好的刷排名软件
  • 松山湖仿做网站seo技术培训广东
  • 免费外贸网站模板下载怎么开展网络营销推广
  • 怎么区分营销型网站推广教程
  • 营销型网站的案例百度推广优化怎么做
  • 网站建设销售该学的谷歌排名优化
  • 广东网站建设报价软文技巧
  • 郑州做网站公司水果网络营销策划书
  • 网站模板 北京公司企业网络营销的模式有哪些
  • wordpress 评论显示头像百度快照优化排名推广
  • 电子政务公开 网站建设关键词林俊杰歌词
  • 手机网站免费建设平台电子商务网站建设多少钱
  • 中铝国际山东建设有限公司网站引擎搜索下载
  • 南昌做网站多少钱网站视频播放代码