Anaconda下的Pytorch安装问题

时间:2018-08-07 20:36:10

标签: anaconda pytorch

我按照此处的链接使用pip install git+https://github.com/fastai/fastai.git

安装fastai库

它给了我以下错误信息。即使我使用conda install pytorch-cpu -c pytorch成功安装了Pytorch,这些消息也保持不变 和pip3 install torchvision。可能是什么原因?

Collecting torch<0.4 (from fastai==0.7.0)
  Using cached https://files.pythonhosted.org/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 "<string>", line 1, in <module>
      File "C:\Users\shuxi\AppData\Local\Temp\pip-install-7sjptuad\torch\setup.py", line 11, in <module>
        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\shuxi\AppData\Local\Temp\pip-install-7sjptuad\torch\

1 个答案:

答案 0 :(得分:1)

要解决此问题,请执行以下操作:

Fatal Exception: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
       at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:7901)
       at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1322)
       at android.view.View.requestLayout(View.java:21049)
       at android.view.View.requestLayout(View.java:21049)
       at android.view.View.requestLayout(View.java:21049)
       at android.view.View.requestLayout(View.java:21049)
       at android.view.View.requestLayout(View.java:21049)
       at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:360)
       at android.view.View.requestLayout(View.java:21049)
       at android.widget.TextView.checkForRelayout(TextView.java:8621)
       at android.widget.TextView.setText(TextView.java:5131)
       at android.widget.TextView.setText(TextView.java:4956)
       at android.widget.TextView.setText(TextView.java:4931)
       at com.flurry.sdk.hq$2.run(SourceFile:123)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6776)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

OR

$ pip install --upgrade git+https://github.com/fastai/fastai.git

您的命令可能失败,因为您在一段时间前安装了旧版本的割炬(0.1.2)。该版本的割炬安装不支持$ pip install --no-cache-dir git+https://github.com/fastai/fastai.git ,pip而是将用户重定向到在浏览器中打开pytorch.org。就您而言,pip正在重用此缓存的程序包。 pip强制pip选择所有依赖程序包的最新版本。