pytorch 源码安装的问题记录

1,下载第三方库

git submodule update --init --recursive


这个初始化下载指令 必须运行完毕。中途中断很可能后续安装失败

2,python setup.py install

报出的环境缺少库文件  请对应查找环境  conda 和pip最好不要混用,conda优先,查看你的pip指令是否在conda内,apt get 也是必须需要的。

我的缺少

Traceback (most recent call last):
  File "setup.py", line 145, in
    from setuptools import setup, Extension, distutils, Command, find_packages
ImportError: No module named setuptools

解决: sudo apt-get install -y python-setuptools

Traceback (most recent call last):
  File "setup.py", line 710, in
    build_deps()
  File "setup.py", line 275, in build_deps
    check_pydep('yaml', 'pyyaml')
  File "setup.py", line 315, in check_pydep
    raise RuntimeError(missing_pydep.format(importname=importname, module=module))
RuntimeError: Missing build dependency: Unable to `import yaml`.
Please install it via `conda install pyyaml` or `pip install pyyaml`

解决:conda install pyyaml

 

3,反复增删源码 产生的git问题

git clone --recursive https://github.com/pytorch/pytorch
Cloning into 'pytorch'...
fatal: unable to access 'https://github.com/pytorch/pytorch/': error setting certificate verify locations:
  CAfile: /home/f1684326/.conda/envs/caffe2/ssl/cacert.pem
  CApath: /home/f1684326/.conda/envs/caffe2/ssl/cacert.pem

解决

(caffe2) :~/github$ git config --system http.sslverify false

 

 

你可能感兴趣的:(pytorch 源码安装的问题记录)