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

wordpress外贸建站公司wordpress page links to

wordpress外贸建站公司,wordpress page links to,长沙最坑装修公司,福建建设执业资格注册中心网站关于python环境变量相关的配置汇总(venv虚拟环境/conda环境/pip相关) 本文作者#xff1a; slience_me 文章目录 关于python环境变量相关的配置汇总(venv虚拟环境/conda环境/pip相关)1. python环境配置相关1.1 系统环境1.2 Anaconda环境相关1.2.1 安装1.2.2 查看python环境 1.…关于python环境变量相关的配置汇总(venv虚拟环境/conda环境/pip相关) 本文作者 slience_me 文章目录 关于python环境变量相关的配置汇总(venv虚拟环境/conda环境/pip相关)1. python环境配置相关1.1 系统环境1.2 Anaconda环境相关1.2.1 安装1.2.2 查看python环境 1.3 venv虚拟环境配置 2. pip相关操作 1. python环境配置相关 1.1 系统环境 输入以下指令查看python的软链接指向默认bin - usr/bin cd /bin ls -l可以看到如下图所示 python默认指向python2的环境python2默认指向python2.7环境python3默认指向python3.6的环境 输入指令python指令进入默认python环境如下图所示 输入指令python3指令进入python3环境如下图所示 如果想要修改默认的python指向python3环境有两种方式选择一种推荐后一种 ln -sf /usr/bin/python3 /usr/bin/python # 右侧指向左侧 -f 选项用于在存在同名文件时强制覆盖 或 cd /bin ln -sf python3 python执行完成后如下图所示python默认指向了python3 再输入python后即可进入python3环境 1.2 Anaconda环境相关 1.2.1 安装 在选择anaconda版本的时候需要查看 Linux 系统的架构可以使用 uname 命令。以下是查看系统架构的方法 uname -m运行上述命令后系统将返回一个字符串表示系统的架构。常见的架构包括 x86_64表示64位的 x86 架构通常用于现代的台式机和服务器。i686 或 i386表示32位的 x86 架构用于一些较旧的系统。arm表示ARM架构通常用于嵌入式系统和一些移动设备。aarch64表示64位的ARM架构。 例如如果返回的是 x86_64则表示你的系统是64位的 x86 架构。 例如我的是下图所示 在anaconda的 点击 下载链接 选择对应的版本 ubuntu操作步骤 运行指令bash Anaconda3-2021.11-Linux-x86_64.sh进入注册信息页面持续点击空格即可跳过注册信息 输入yes阅读注册信息然后输入yes查看文件即将安装的位置按enter即可安装安装完成后收到加入环境变量的提示信息输入yes重启终端会看到命令行前面出现base环境即可默认使用Anaconda3可以使用conda -V验证是否安装完毕若安装完成则会出现版本号。 执行下面指令后回车即可 [slience_meVM-24-2-centos ~]$ bash Anaconda3-2023.09-0-Linux-x86_64.sh Welcome to Anaconda3 2023.09-0 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue输入yes即可同意该使用协议 End User License Agreement - Anaconda DistributionCopyright 2015-2023, Anaconda, Inc. All rights reserved under the 3-clause BSD License: This End User License Agreement (the Agreement) is a legal agreement between you and Anaconda, Inc. (Anaconda) and governs your use of Anaconda Distribution (which was formerly known as Anaconda Individual Edition). ...... Do you accept the license terms? [yes|no] [no] yes选择安装的路径直接回车就使用默认路径/home/slience_me/anaconda3 Anaconda3 will now be installed into this location: /home/slience_me/anaconda3- Press ENTER to confirm the location- Press CTRL-C to abort the installation- Or specify a different location below[/home/slience_me/anaconda3] PREFIX/home/slience_me/anaconda3 Unpacking payload ... Installing base environment... Downloading and Extracting Packages Downloading and Extracting Packages Preparing transaction: done Executing transaction: \ Installed package of scikit-learn can be accelerated using scikit-learn-intelex.More details are available here: https://intel.github.io/scikit-learn-intelexFor example:$ conda install scikit-learn-intelex$ python -m sklearnex my_application.py done installation finished. Do you wish to update your shell profile to automatically initialize conda? This will activate conda on startup and change the command prompt when activated. If youd prefer that condas base environment not be activated on startup,run the following command when conda is activated: conda config --set auto_activate_base false是否初始化环境变量选择yes即可 You can undo this by running conda init --reverse $SHELL? [yes|no] [no] yes no change /home/slience_me/anaconda3/condabin/conda no change /home/slience_me/anaconda3/bin/conda no change /home/slience_me/anaconda3/bin/conda-env no change /home/slience_me/anaconda3/bin/activate no change /home/slience_me/anaconda3/bin/deactivate no change /home/slience_me/anaconda3/etc/profile.d/conda.sh no change /home/slience_me/anaconda3/etc/fish/conf.d/conda.fish no change /home/slience_me/anaconda3/shell/condabin/Conda.psm1 no change /home/slience_me/anaconda3/shell/condabin/conda-hook.ps1 no change /home/slience_me/anaconda3/lib/python3.11/site-packages/xontrib/conda.xsh no change /home/slience_me/anaconda3/etc/profile.d/conda.csh modified /home/slience_me/.bashrcFor changes to take effect, close and re-open your current shell. Thank you for installing Anaconda3!可以查看一下环境变量执行以下指令 vim ~/.bashrc发现有以下内容即是anaconda的环境变量配置 # conda initialize # !! Contents within this block are managed by conda init !! __conda_setup$(/home/slience_me/anaconda3/bin/conda shell.bash hook 2 /dev/null) if [ $? -eq 0 ]; theneval $__conda_setup elseif [ -f /home/slience_me/anaconda3/etc/profile.d/conda.sh ]; then. /home/slience_me/anaconda3/etc/profile.d/conda.shelseexport PATH/home/slience_me/anaconda3/bin:$PATHfi fi unset __conda_setup # conda initialize 1.2.2 查看python环境 激活conda环境执行以下环境 source ~/.bashrc如下图所示看到左边有(base)即激活了base环境进行一系列操作 如果想要修改系统的python指向anaconda的python环境执行以下指令 ln -sf /home/anaconda3/bin/python /usr/bin/python # python - /home/anaconda3/bin/python可以查看相关的虚拟环境 conda env list下面是一些相关的指令 我的指令本 # 激活环境 conda activate torch# 退出环境 conda deactivate# 对虚拟环境中安装额外的包 conda install -n your_env_name [package]# 检查更新当前conda conda update conda# 创建python版本为x.x名字为your_env_name的虚拟环境 conda create -n your_env_name pythonx.x# 删除虚拟环境 conda remove -n your_env_name --all# 删除环境钟的某个包 conda remove --name $your_env_name $package_name 1.3 venv虚拟环境配置 创建一个虚拟环境 # 创建虚拟环境venv python3 -m venv 包名然后可以执行以下指令激活环境 cd venv cd bin source activate然后执行相关的操作 2. pip相关操作 查看需要安装的模块的所有版本 pip index versions [your python module name]导出/入包环境为文件 pip freeze requirements.txt pip install -r requirements.txt pip list --formatfreeze requirements.txt conda install --yes --file requirements.txt conda install --use-local 包名称 # 安装根目录的pkgs文件下的本地包pip换源操作 # 临时换源 豆瓣源 pip3 install 模块 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com pip3 install 模块 -i http://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host tuna.tsinghua.edu.cn pip3 install 模块 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host aliyun.com防止权限不足 加 --user# pip相关 pip -V # 查询 pip list# 可选择的源 清华https://pypi.tuna.tsinghua.edu.cn/simple/阿里云http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/华中科技大学http://pypi.hustunique.com/山东理工大学http://pypi.sdutlinux.org/豆瓣http://pypi.douban.com/simple/中科大https://pypi.mirrors.ustc.edu.cn通过下面的操作进行pip全局换源 要永久更改 pip 的软件包源你可以编辑或创建 pip 的配置文件并在其中设置新的源。以下是具体的步骤 打开或创建 pip 的配置文件。配置文件通常位于用户主目录下的 .pip 目录中。你可以使用文本编辑器打开或创建这个文件。如果不存在 .pip 目录你可以创建它。 mkdir -p ~/.pip在 .pip 目录中创建一个文件命名为 pip.conf如果使用的是 Python 3可能需要创建 pip.ini 文件。 touch ~/.pip/pip.conf打开 pip.conf 文件并添加以下内容 [global] index-url https://pypi.org/simple/上述示例将 index-url 设置为 Python Package IndexPyPI的默认源。你可以将 https://pypi.org/simple/ 替换为其他源的地址如清华大学的镜像源等。 [global] index-url https://pypi.tuna.tsinghua.edu.cn/simple保存并关闭文件。 现在pip 将使用你指定的源来安装软件包。这样设置后你不再需要每次使用 pip install 命令时都手动指定源。
http://www.zqtcl.cn/news/759574/

相关文章:

  • 网站策划报告公司简介模板范文高大上
  • 做信息图的免费网站如何获取网站是哪个公司制作
  • 乐清建设网站哪家好seo一个月赚多少钱
  • 哈尔滨专业官网建站企业h5公众号开发
  • 商城网站建设精英wordpress实例配置
  • 国内网站开发语言模板兔自用主题WordPress
  • 天津营销网站建设公司哪家好市场营销平台
  • 上海企业响应式网站建设推荐网站建设类织梦模板
  • 洛阳最好的做网站的公司哪家好信誉好的邢台做网站
  • 织梦 旅游网站模板seo百家外链网站
  • 做网站提升公司形象摄影网站建设任务书
  • wordpress建站不好用wordpress共用用户多站点
  • 企业网站设计请示杭州做企业网站的公司
  • 苏宁易购网站建设的不足之处wordpress myisam
  • 互联网站建设维护是做什么的网站建设模板成功案例
  • 制作网站需要什么语言wordpress 免签约支付宝
  • 西安网站开发的未来发展易企网络网站建设
  • 贵州做网站怎么推广vs2012 做网站教程
  • 完全菜鸟七天学会建网站网络营销的四大基础理论
  • 东莞网站优化案例网站职业技术培训学校
  • 银川网站建设公司电话公司在百度做网站找谁
  • 交换链接适用于哪些网站网络规划与设计的目的
  • 网站做标签寺院网站模板
  • 高端h5网站柳州建站
  • 百度商桥网站郑州有做网站的公司没
  • 做专业网站济南品牌网站建设低价
  • 网站制作客户寻找数据中台厂商
  • 免费找图片素材的网站西安企业seo
  • 网站建设 名词解释国内网站建设建设
  • 文山州建设局网站域名查询seo