Python / Caffe2:ImportError:没有名为tools.setup_helpers.env

时间:2018-08-16 16:09:05

标签: python pip caffe caffe2

我无法从PyPi存储库安装Python caffe2 模块。发出sudo pip install caffe2时发生以下错误:

$ sudo pip install caffe2
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting caffe2
  Downloading https://files.pythonhosted.org/packages/0f/b5/b4824aeeef2fc0a54e6f9f090545a486c2e5db0e18faae011c16465ee917/caffe2-0.5.0a0.dev100.tar.gz (10.7MB)
    100% |████████████████████████████████| 10.7MB 3.3MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "", line 1, in 
      File "/tmp/pip-install-C5vRaw/caffe2/setup.py", line 108, in 
        from tools.setup_helpers.env import check_env_flag, check_negative_env_flag
    ImportError: No module named tools.setup_helpers.env

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-C5vRaw/caffe2/

我已阅读installation documentation,并拥有所有dependencies installed,但是此错误仍然存​​在。 GitHub上有一个similar issue,但答案尚不清楚,也无法解决我的问题。有人知道如何解决此问题或安装模块的解决方法吗?

使用pip3代替pip(2)时,会出现相同的问题。

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

此软件包需要PyTorch。 tools.setup_helpers是PyTorch中的软件包。

查看在https://caffe2.ai/docs/getting-started.html上安装Caffe2的其他方法