腾讯云服务器购买搭建过程

腾讯云服务器的购买及python环境搭建过程

  • 1.购买服务器
  • 2.配置腾讯云服务器
  • 3.配置python环境
  • 4. 配置jupyter环境

  • 1.购买服务器

    购买腾讯云服务器第一步是要 注册腾讯云账号

    腾讯云账号注册
    百度搜索 腾讯云学生服务器 ,登陆注册的账号。选择操作系统为Centos 7.5 64位

    在这里插入图片描述
    购买成功后进入腾讯云实例控制台进行查看

    在这里插入图片描述


    2.配置腾讯云服务器

    下载mobaxterm工具,通过SSH连接云服务器

    在这里插入图片描述
    在这里插入图片描述


    3. 配置python环境

    通过本地浏览器下载 Anaconda3-5.3.1-Linux-x86_64.sh镜像文件, 然后将下载的镜像文件通过mobaxterm上传至云服务器。

    在这里插入图片描述

    使用命令安装Anaconda3,接受协议(yes),自动生成环境变量,不安装VScode

    # bash Anaconda3-5.3.1-Linux-x86_64.sh
    
    Anaconda3 will now be installed into this location:
    /root/anaconda3
     
      - Press ENTER to confirm the location
      - Press CTRL-C to abort the installation
      - Or specify a different location below
     
    [/root/anaconda3] >>> /root/usr/anaconda3  #更改安装位置
    

    编辑 vi /root/.bashrc 这个配置文件,更改其中的内容export PATH=/root/usr/anaconda3/bin:$PATH
    然后使用source ~/.bashrc使环境配置生效。
    查看python版本------------------- python -V
    查看pip版本------------------------ pip -V
    查看conda版本-------------------- conda -V

    在这里插入图片描述
    在这里插入图片描述


    4. 配置jupyter环境

    (1)生成密令

    在这里插入图片描述
    (2)修改生成的配置文件

    c.NotebookApp.ip='*' #*代表所有IP
    c.NotebookApp.password = u'xxxx'  #xxxx为生成的密令
    c.NotebookApp.open_browser = False
    c.NotebookApp.port =8888    #使用默认端口8888
    
    

    (3)允许8888端口通过防火墙

    systemctl start firewalld.service  #启动防火墙    
    firewall-cmd --zone=public --add-port=8888/tcp --permanent #开启8888端口
    firewall-cmd --reload   #重启防火墙
    

    (4)启动jupyter notebook

    jupyter notebook --allow-root
    

    在这里插入图片描述
    (5)本地浏览器登录http://服务器公网ip:8888

    在这里插入图片描述

    在这里插入图片描述

    在这里插入图片描述

    在这里插入图片描述

    发布了5 篇原创文章 · 获赞 4 · 访问量 536

    猜你喜欢

    转载自blog.csdn.net/zenghongju/article/details/103864019
    今日推荐