Pytorch: rebuild pip wheels with manylinux

Created on 23 Jan 2017  ·  60Comments  ·  Source: pytorch/pytorch

For install instructions please go to http://pytorch.org

This is needed to work across many different linux distros, new and old.

manylinux will build the wheel on a CentOS5 (yes!) Docker machine.

todo

Most helpful comment

I had the same problem and I've found the solution. Basically, pip is trying to run "pip install torch" because torch is listed in the dependencies and it does not detect the previously build version with wheel. So just run "pip install --no-deps torchvision" and it should work.

And this could be permanently fixed by updating the setup.py file in torchvision repository.

All 60 comments

this is really dumb, but after reading PEP-513 and looking at what TF and others do, all the user-failures came down to the name of the file.

I fixed the filenames on the website pip install commands.

I'm still going to setup manylinux wheels, but de-prioritizing this down to low.

Running pip install pytorch prints RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566). That doesn't seem related to this issue at all, maybe #939 was meant, or #707?

If you don't support pypi, why send users here and not to http://pytorch.org/ ?
Or even tell them directly to

pip install http://download.pytorch.org/whl/torch-0.1.10.post1-cp35-cp35m-macosx_10_6_x86_64.whl
pip install torchvision 

etc, depending on the platform

hi guys, I got an error when I execute the second command "pip install torchvision", and the error report is

Collecting torchvision
Using cached torchvision-0.1.8-py2.py3-none-any.whl
Collecting torch (from torchvision)
Using cached torch-0.1.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "\ File "/tmp/pip-build-hho2Nf/torch/setup.py", line 11, in \ raise RuntimeError(README)
RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).
Please follow the instructions at http://pytorch.org/ to install with miniconda instead.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hho2Nf/torch/

The problem that confused me is that "/tmp/pip-build-hho2Nf/torch/setup.py", where the error happens, seems to be a temporary file and I don't know what's in its line 11, so I can't start to debug the problem. Can any one tell me what is this setup.py file?

My computer needs proxy, but I don't think this is relevant because pip command works fine with other packages on my computer. Meanwhile, when I downloaded the torchvision whl file and try to install it locally, the same error happens.

My operating system is Linux mint 18, a derivative of Ubuntu 16 LTS. It strange that these two pip command in my laptop(also a mint 18 system) works fine.

Thank you for you help and time.

@Lowpassfilter first install pytorch, and then install torchvision

@soumith do you mean the following two commands:

pip install http://download.pytorch.org/whl/cu75/torch-0.1.12.post2-cp27-none-linux_x86_64.whl
pip install torchvision

everything goes fine with the first command, however, the second command will produce the error I mentioned above.

problem is that it is using a cached file Using cached torch-0.1.2.post1.tar.gz. You can try to remove the pip cache: rm -rf ~/.cache/pip

I came across the same problem as Lowpossfilter, and this did not work

so uuuh. what's the status here? Those instructions don't work for me for me with the same exact error on the torchvision step:

RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566)

If this is explicitly not supported why are there instructions on the pytorch website for pip?
Seems like things work fine for 2.7 but not 3.5 oddly enough. (speaking of which those instructions are off anyways since it's pip3 for python 3)

@soumith I have done it, and this didn't work for me.

clueless, what are we supposed to do ?

problem is that it is using a cached file Using cached torch-0.1.2.post1.tar.gz. You can try to remove the pip cache: rm -rf ~/.cache/pip

That's not the problem here.

The torch-0.1.2 tarball at https://pypi.python.org/pypi/torch is broken (the raise RuntimeError(README) error reported above). pip install torchvision tries to install torch as its dependency, and that's where things currently fail. To avoid that, one can try:

$ sudo apt-get install cmake   # if not already installed
$ pip install git+https://github.com/pytorch/pytorch

That will at least get past the issue in the setup.py file in the PyPI tarball, but gives me a compile error in the end:

In file included from /tmp/pip-D56ElD-build/torch/lib/TH/THVector.c:3:0:
/tmp/pip-D56ElD-build/torch/lib/TH/generic/THVectorDispatch.c: In function ‘THFloatVector_vectorDispatchInit’:
/tmp/pip-D56ElD-build/torch/lib/TH/generic/simd/simd.h:114:3: error: inconsistent operand constraints in an ‘asm’
   asm volatile ( "cpuid\n\t"
   ^
/tmp/pip-D56ElD-build/torch/lib/TH/generic/simd/simd.h:114:3: error: inconsistent operand constraints in an ‘asm’
   asm volatile ( "cpuid\n\t"
   ^
make[2]: *** [CMakeFiles/TH.dir/THVector.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/TH.dir/all] Error 2
make: *** [all] Error 2

I'm on a quite standard Ubuntu install with gcc 4.8.4, so maybe current master is also not in an installable state right now.

looks like the error is back for me. What is the root of this problem? How can we find it?

same here!

yeah well, just go to:

http://pytorch.org/

and install it using the given address, in my case (osx 2.7 no cuda) was:

pip install http://download.pytorch.org/whl/torch-0.1.12.post2-cp27-none-macosx_10_7_x86_64.whl
pip install torchvision

have fun!

Those install instructions do not work for everybody. I've just come across two more machines (of colleagues of mine) that have this error. It seems to occur at random and the error message is entirely unhelpful.

It seems odd that this bug is tagged "low priority" considering how many people use pip to install things. Difficulty of installation is the number one thing I've seen turn away students and amateurs from choosing a first tool to learn. Perhaps I'm not experienced enough to say, but this seems like something that affects the level to which pytorch will be adopted in the future.

How can we help to resolve this?

Agree with @ThaHypnotoad. I've been waiting for this fix for more than a month now. During the same month, I've gotten more comfortable with Tensorflow, which makes my switch to pytorch doubtful.

Will opening a new 'issue' move things?

I had the same problem and I've found the solution. Basically, pip is trying to run "pip install torch" because torch is listed in the dependencies and it does not detect the previously build version with wheel. So just run "pip install --no-deps torchvision" and it should work.

And this could be permanently fixed by updating the setup.py file in torchvision repository.

I can confirm that @DjAntaki s solution works on every machine I've seen have this issue on.

@DjAntaki Thanks!

Still now I am not able to install pytorch
I ran this command:

~ pip install http://download.pytorch.org/whl/cu75/torch-0.2.0.post1-cp36-cp36m-manylinux1_x86_64.whl 
pip install torchvision

And the output which I am getting is:

torch-0.2.0.post1-cp36-cp36m-manylinux1_x86_64.whl is not a supported wheel on this platform.
Collecting torchvision
Using cached torchvision-0.1.9-py2.py3-none-any.whl
Collecting torch (from torchvision)
Using cached torch-0.1.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-Qy2Ipn/torch/setup.py", line 11, in
raise RuntimeError(README)
RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).

Please follow the instructions at http://pytorch.org/ to install with miniconda instead.


----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Qy2Ipn/torch/

I am using Ubuntu 16.04 LTS. Is there any other way out ?

Check the version of "pip". If you have multiple pythons and pips, It could be either pip2 or pip3. I feel like the instructions should be more explicit om the website.

Observation:
$pip install torchvision works
$sudo pip install torchvision doesn't work. Not sure why.

Updates on this?

So this is a blocker why pytorch is not on PyPI?

currently, we are waiting on the PyPI team to increase our binary size limit, so that we can upload pytorch to PyPI. the wheels are built as manylinux1.

@soumith any clue or issue when PyPi are going to increase the size?

I do not know. I have pinged them again. I hope they reply / increase the size soon.

CUT AND PASTE FROM ABOVE FROM @DjAntaki:
So just run "pip install --no-deps torchvision" and it should work.

This worked for me on Ubuntu 16.04 LTS

@DjAntaki 's solution works.

And i find another one :
using virtualenv
nothing goes wrong on Ubuntu 16.04 LTS

@soumith How about contacting @dstufft? See https://github.com/pypa/packaging-problems/issues/86#issuecomment-263464389

it got approved recently. we are planning to upload the next version of pytorch on pypi

@Lowpassfilter I have the same problem. And I found the reason is that the pip version is too old.
So I use "pip install --upgrade pip" to upgrade the pip. Then the problem disappeared.

@thuwyq I work behind a proxy, and unfortunately, the newest version of pip will fail behind a proxy, so I have to use the old version of pip. Lucky, the answer of @jlquinn helps me. It works with --no-deps.

Please pin the comment from @DjAntaki to the top of this issue so people don´t have to read all to the end. Simple solution for an annoying issue.

@soumith Looking forward to your upload in PyPI.

Is there still a plan to release PyTorch 0.3.0 on PyPI?

there is. i am trying to fix a segfault folks are seeing on the pip package (related to libstdc++ static linkage), once that's done I'll upload the packages on PyPI

@soumith Hey, any updates?

@prajjwal1
I had a similar error. Sudo solved it.

I had a similar error too. Sudo solved it.

I confirm that DjAntaki's solution worked for me on Ubuntu 17.10 with the system's builtin Python 3.6.3. The provided directions on the pytorch.org website are still out of date. The directions should be updated.

I can confirm that upgrading pip and using sudo works, though it feels a bit dirty. Any idea why sudo is needed after running pip3 install --upgrade pip?

Just in case someone is confused, what I did to get this work (on Ubuntu 17.10):

  • pip3 install http://download.pytorch.org/whl/cu90/torch-0.3.1-cp36-cp36m-linux_x86_64.whl
  • pip3 install --upgrade pip
  • sudo pip3 install torchvision

Looks like the last step changes permissions on pip and forces the use of sudo? Any idea how to make it work without sudo as well?

i have the same problem. i sloved it in this way:
pip3 install --upgrade pip
sudo pip3 install torchvision

mine is ubuntu16.04,cpu,python3.5

So, PyTorch does not currently provide packages for PyPI (at least for the moment).
The interpreter is trying to run pip install torch or pip install torchvision.
The solution that worked for me (In order to add pytorch module in working PyCharm project):

  1. Install pytorch from the website (pytorch.org) using pip or conda (miniconda in my case)
  2. Go to Settings -> Project Interpreter
  3. Go to Add Local Python Interpreter and choose Existing environment
  4. Choose your python environment where pytorch was installed with conda or pip.

_My setup: Ubuntu 16.04, Python 2.7, miniconda_

Hope this helps!

What is the status on this?

this can be closed. we have pip wheels built and uploaded to PyPI

`RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).

Please follow the instructions at http://pytorch.org/ to install with miniconda instead.
I was using pip to install pytorch with the following command: pip3 install torch torchvision`
which I found in pytorch.org. Is this issue really resolved?
On my mac os everything works fine (python 3.6), however, when I tried to install it on a linux gpu server (python 3.4), I got the above error.

@salavi pytorch doesn't provide packages for 3.4. It only provides packages for 3.5, 3.6, 2.7 at the moment (and 3.7 from next release)

win10
pip3 install torchvision does not work
pip install torchvision works

import torch works on terminal,but unwork on pycharm(win7)

Where can I find a list for wheels???!! Older versions for ubuntu

hi

hi ,I am in Win10 .Python version is 3.6.5. pip version is 19.0.3
I can run pip install --no-deps torchvision and can install it successfully.
But, I try to install torch,It fail.
I try to run these:
pip3 install torch
pip install torch
pip3 install --no-deps torch
pip install --no-deps torch
All fail.Get the same error :

c:>pip install --no-deps torch -i https://pypi.mirrors.ustc.edu.cn/simple/
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Collecting torch
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/5f/e9/bac4204fe9cb1a002ec6140b47f51affda1655379fe302a1caef421f9846/torch-0.1.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\65140\AppData\Local\Temp\pip-install-417u5z60torchsetup.py", line 11, in
raise RuntimeError(README)
RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).

Please follow the instructions at http://pytorch.org/ to install with miniconda instead.


----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\65140\AppData\Local\Temp\pip-install-417u5z60torch\

I have solved this problem.
You should download whl file.
I try this command:

pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision

This problem, I mean -> RuntimeError: PyTorch does not currently provide packages for PyPI (see status at #566). -> in my case (on Windows) was solved by installing the 64-bit version of Python and rewriting path variables to Python and its libraries. After updating the path try rebooting. And after that I could freely install PyTorch without any errors.

我有同样的问题,我找到了解决方案。基本上,pip正在尝试运行“pip install torch”,因为火炬列在依赖项中并且它不会检测以前使用wheel的构建版本。所以,只需运行“pip install --no-deps torchvision”即可。

这可以通过更新torchvision存储库中的setup.py文件来永久修复。

正在尝试该方法,不是是否可以解决这个问题。

(pytorch) C:\Windows\system32>pip install torch
Collecting torch
Using cached https://files.pythonhosted.org/packages/5f/e9/bac4204fe9cb1a002ec6140b47f51affda1655379fe302a1caef421f9846/torch-0.1.2.post1.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "C:\Users\PanPan\AppData\Local\Temp\pip-install-a6nog5b5torchsetup.py", line 11, in
raise RuntimeError(README)
RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).

Please follow the instructions at http://pytorch.org/ to install with miniconda instead.

----------------------------------------

ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\PanPan\AppData\Local\Temp\pip-install-a6nog5b5torch\

@Man1029, you can get latest torch or torchvision package through command:
conda install pytorch-cpu torchvision-cpu -c pytorch (cpu only)
Basically, it uses conda packages available at Anaconda cloud

I had the same problem and I've found the solution. Basically, pip is trying to run "pip install torch" because torch is listed in the dependencies and it does not detect the previously build version with wheel. So just run "pip install --no-deps torchvision" and it should work.

And this could be permanently fixed by updating the setup.py file in torchvision repository.

Thanks buddy!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SeparateReality picture SeparateReality  ·  3Comments

szagoruyko picture szagoruyko  ·  3Comments

bartolsthoorn picture bartolsthoorn  ·  3Comments

negrinho picture negrinho  ·  3Comments

miguelvr picture miguelvr  ·  3Comments