Centos7.5服务器安装(并添加用户) anaconda3 并配置 PyTorch1.0

===========================================================================================
[admin@localhost ~]$ sudo vim /etc/sudoers
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for admin:
admin is not in the sudoers file. This incident will be reported.
切换至root用户下
[admin@localhost ~]$ su root
Password:
[root@localhost admin]# ls -l /etc/sudoers
-r--r-----. 1 root root 4328 Oct 30 10:38 /etc/sudoers
[root@localhost admin]# chmod -v u+w /etc/sudoers
mode of ‘/etc/sudoers’ changed from 0440 (r--r-----) to 0640 (rw-r-----)
[root@localhost admin]# ls -l /etc/sudoers
-rw-r-----. 1 root root 4328 Oct 30 10:38 /etc/sudoers
[root@localhost admin]# vim /etc/sudoers
在 root ALL=(ALL) ALL 后面加上 username ALL = (ALL) ALL,其中username表示用户名
[root@localhost admin]# chmod -v u-w /etc/sudoers
mode of ‘/etc/sudoers’ changed from 0640 (rw-r-----) to 0440 (r--r-----)
[root@localhost admin]# ls -l /etc/sudoers
-r--r-----. 1 root root 4438 Mar 11 09:34 /etc/sudoers
退出root用户
[root@localhost admin]# exit
exit
[admin@localhost ~]$
添加用户
先切换至root用户下
adduser jiangshan
passwd jiangshan
adduser jinyan
passwd jinyan
chmod -v u+w /etc/sudoers
vim /etc/sudoers
在这一行root ALL=(ALL) ALL下
jiangshan ALL=(ALL) ALL # add by jiangshan with hands
jinyan ALL=(ALL) ALL # add by jiangshan with hands
chmod -v u-w /etc/sudoers
退出root用户
exit
===================================================================================================

安装wget
sudo yum install wget
下载 Anaconda3-2018.12-Linux-x86_64.sh
[jiangshan@localhost ~]$ wget https://repo.anaconda.com/archive/Anaconda3-2018.12-Linux-x86_64.sh
安装bzip2
sudo yum install -y bzip2
安装Anaconda3
bash Anaconda3-2018.12-Linux-x86_64.sh
######################################################
注意~初始设定的存放位置:
Do you wish the installer to initialize Anaconda3
in your /home/jiangshan/.bashrc ? [yes|no]
A backup will be made to: /home/jiangshan/.bashrc-anaconda3.bak
######################################################
使环境变量生效
$ source /home/jiangshan/.bashrc
测试
$ conda -V
conda 4.5.12
正常,下一步
安装PyTorch
设置镜像
# 添加Anaconda的清华镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes
##################################
###PyTorch Build Stable (1.0)###
###Your OS Linux ###
###Package Conda ###
###Language Python 3.7 ###
###CUDA None ###
##################################
$ conda install pytorch-cpu torchvision-cpu -c pytorch
若以上自动不好使,则手动下载,手动安装pytorch、torchvision
$ cd /home/jiangshan/anaconda3/pkgs
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/pytorch-cpu-1.0.1-py3.7_cpu_2.tar.bz2
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/torchvision-cpu-0.2.1-py37_1.tar.bz2
conda install pytorch-cpu-1.0.1-py3.7_cpu_2.tar.bz2
conda install torchvision-cpu-0.2.1-py37_1.tar.bz2
测试
(base) [jiangshan@localhost pkgs]$ conda -V
conda 4.5.12
(base) [jiangshan@localhost pkgs]$ python
Python 3.7.1 (default, Dec 14 2018, 19:28:38)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
‘1.0.1.post2‘

原文地址:https://www.cnblogs.com/jeshy/p/10516886.html

时间: 2024-08-13 23:16:57

Centos7.5服务器安装(并添加用户) anaconda3 并配置 PyTorch1.0的相关文章

centos7编译安装apache后添加用户认证和配置虚拟主机

编译安装apache后的目录文件:/usr/local/apache2 1:用户认证 主配置目录:/usr/local/apache2/conf/ 1)建立目录并设置用户认证: Alias  /1.php/ "/usr/local/apache2/htdocs/1.php" <Directory"/usr/local/apache2/htdocs/"> AllowOverride None Options None Order allow,deny De

Gitlab(Docker)中批量添加用户及邮件配置

gitlab页面可以添加用户,但是无法批量添加.可以使用api的方式批量添加用户: 1.创建token 在User Setting--Access Tokens中添加token: 复制创建好的token 2.配置脚本及用户信息文件 # vim userinfo.txt name username password user_email 例如: zhangshan zhangshan zhangshan123 [email protected] # vim user_add.sh #!/bin/b

centos7下PPTP脚本+添加用户脚本

需要输入你网卡名字,本地ip,和pptpd拨号客户端使用的IP ================================服务器================= 作者:木子贤 QQ:2574271652 转载请保留出处-------------------- 请支持老男孩培训 #!/bin/sh . /etc/init.d/functions read -p "input your intarfacename(ex:eth0):" d while true do read -p

Centos7 添加用户及设置权限

一.添加用户 1.登录root 用户 [[email protected] /]$ su Password: # 输入密码 [[email protected] /]# 2.添加用户 [[email protected] /]# useradd testuser [[email protected] /]# 3.设置用户密码 [[email protected] /]# passwd testuser Changing password for user testuser. New passwo

Centos7 Openstack - (第二节)添加认证服务(Keystone)

Centos7 install Openstack - (第二节)添加认证服务(Keystone) 我的blog地址:http://www.cnblogs.com/caoguo 根据openstack官方文档配置 官方文档地址: http://docs.openstack.org/juno/install-guide/install/yum/content/# 0x01.认证服务安装与配置(控制节点) [[email protected] ~]# mysql -uroot -p MariaDB

linux下添加用户并赋予root权限

1.添加用户,首先用adduser命令添加一个普通/系统用户,命令如下:# adduser [-r] –d /tommy tommy//添加一个名为tommy的用户 # passwd tommy   //修改密码Changing password for user tommy.New UNIX password:     //在这里输入新密码Retype new UNIX password:  //再次输入新密码passwd: all authentication tokens updated

for添加用户

添加10个用户user1到user10,密码同用户名:但要求只有用户不存在的情况下才能添加:接受一个参数:add: 添加用户user1..user10del: 删除用户user1..user10其它:退出 代码 #!/bin/bash # A=$1 if [ $A == add ];then   for I in {1..10};do     USER=user$I     if ! id $USER &> /dev/null ;then       useradd user$I &

linux 添加用户

1.添加用户 首先用adduser命令添加一个普通用户,命令如下:#adduser tommy  //添加一个名为tommy的用户#passwd tommy   //修改密码Changing password for user tommy.New UNIX password:     //在这里输入新密码Retype new UNIX password:  //再次输入新密码passwd: all authentication tokens updated successfully. 2.修改密

Linux中添加用户、删除用户时新手可能遇到的问题

Linux中添加用户.删除用户时新手可能遇到的问题  1.创建新用户后切换到新用户:No directory, logging in with HOME=/     添加用户     #sudo useradd -m -s /bin/bash -g group loginname     -m 创建home目录 (不加这个要手动添加目录,不然会出现No directory,Logging in with HOME=/ )     -s /bin/bash 使用bash( 默认为 /bin/sh