Install a gcc on your system. Preferably 4.9. Mine is 4.8.5 and it works as well.
Try to python setup.py install. I think what’ll happen is that something will complain that it can’t find the right compilers, at which point you can symlink your local system gcc and g++ to the respective places.
Did you install a gcc via conda? (conda list | grep gcc) That one takes precedence over your system gcc for building pytorch.
If not, then could I see a larger chunk of the output? You could dump it into a pastebin or gist.
But even if I ran conda install gcc, and made sure that this time conda list | grep gcc returned a proper result gcc 4.8.5 libgcc-ng 7.2.0
The next attempt for python setup.py install still failed with the same exception message just as above.
The whole chunk is bigger than the byte limit here. I wonder how to upload a .txt file for this.
Thanks for your advice, and I’ve tried it twice after that.
Unfortunately, it returned a good result succeeded in installing, as well as a
Traceback (most recent call last):
File “”, line 1, in
File “/home/thomas/anaconda3/envs/pytorch-dev/lib/python3.6/site-packages/torch/init.py”, line 53, in
from torch._C import *
ImportError: libmkl_intel_lp64.so: cannot open shared object file: No such file or directory
For what it’s worth, I recommend trying this in a clean virtual (or physical) machine. I haven’t tried to build PyTorch recently in Ubuntu 17.04, but I did recently struggle with Ubuntu 16.04, and I can confirm that the following sequence works:
Install anaconda 5
Activate it (eg “. anaconda3/bin/activate” - don’t forget the dot before the command)
I ran sudo find / -name "mkl", and it returned
so I wrote export LD_LIBRARY_PATH="/home/thomas/anaconda3/lib/python3.6/site-packages/mkl" in ~/.bashrc.
But still, nothing changed. Only to return the same ImportError: libmkl_intel_lp64.so: cannot open shared object file: No such file or directory as before.
Well, I’m in China and this means that my approach through conda install pytorch -c soumith can be easily cut down for every second, and also means that if not so, the speed of download should be a poor 3Kb/s or so. I mean - here in China, ways for conda-ing packages usually is to just fetch it from the tsinghua mirrors: http://mirrors.tuna.tsinghua.edu.cn/help/anaconda/ But, well, it seems that it is not being maintained by now.
So installing from git sources is the only way to me.
Sorry for a late reply,
I’ve tried for the docker, but it seems that thousands of attempts before have ruined my linux storage, and that when the Docker image asks for a 4G or so space, my NEW-INSTALLED ubuntu refused that.
Alright, have to say goodbye then…
If you can find a VPS beyond the GREAT WALL, you can make it by the following way.
Install Anaconda on your VPS
Create virtual python envs (e.g. conda create -n py3_pytorch python=3.6 )
Activate your virtual envs and install pytorch
Find the directory of your envs (maybe it will be here ~/anaconda2/envs/py3_pytorch) and copy the whole directory to you own machine and place it in the dicectory your_machine/anaconda2/envs/
Then you can use it by directly activate the virtual envs (source activate py3_pytorch)
Ecauchy,i have the same problem with you ,have you solve it?
Than you very much
/home/wyy/anaconda3/compiler_compat/ld: cannot find -lm
/home/wyy/anaconda3/compiler_compat/ld: cannot find -lpthread
/home/wyy/anaconda3/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status