服务器没有管理权限怎么安装pytorch
或许连home目录也没有
作为普通用户,通常是没有管理员权限的,甚至连自己的home目录都没有
假设自己只能在/export/terry下写入文件
我在自己的目录安装了Anaconda3-5.3.0-Linux-x86_64.sh,而且配置了环境变量
export PATH=/export/terry/anaconda3/bin:$PATH
但conda安装仍然不能用(因为没有home目录)
terry@gpu6:/$ conda install torchvision==0.2.2 cudatoolkit=9.0 -c pytorch
Solving environment: failed
NotWritableError: The current user does not have write permissions to a required path.
path: /home/terry/.conda/pkgs/urls.txt
uid: 582
gid: 585
If you feel that permissions on this path are set incorrectly, you can manually
change them by executing
$ sudo chown 582:585 /home/terry/.conda/pkgs/urls.txt
In general, it's not advisable to use 'sudo conda'.
好在pip还可以用,不过直接pip install pytorch也不行,文件只会下载到其他人的目录,然后无法打开读取,无法安装
所以要使用,可以同时加上-i换成清华源
pip download torch -d /export/terry -i https://pypi.tuna.tsinghua.edu.cn/simple/
然后使用本地安装方法安装
pip install "/export/terry/torch-1.7.1-cp37-cp37m-manylinux1_x86_64.whl"
MobaXterm可以右键复制绝对路径
进python环境验证
Python 3.7.0 (default, Jun 28 2018, 13:15:42)
[GCC 7.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.7.1'