在Cygwin中的pip install找不到文件错误

时间:2015-11-30 14:47:10

标签: python-3.x cygwin pip anaconda parallels

我在Mac OS El Capitan上,在Parallels中运行Windows 10 64位VM。我安装了Cygwin和Anaconda3。我想用pip安装两个包(pyrsistent和rpy2)。它们都抛出错误"错误:[WinError 2]系统找不到指定的文件"没有指定它无法找到的文件。

这是输出:

$ pip install pyrsistent
Collecting pyrsistent
  Using cached pyrsistent-0.11.9.tar.gz
Requirement already satisfied (use --upgrade to upgrade): six in c:\anaconda3\lib\site-packages (from pyrsistent)
Building wheels for collected packages: pyrsistent
  Running setup.py bdist_wheel for pyrsistent
  Complete output from command C:\Anaconda3\python.exe -c "import setuptools;__file__='C:\\cygwin64\\tmp\\pip-build-sqcinj9m\\pyrsistent\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\cygwin64\tmp\tmpn25raothpip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.5
  copying _pyrsistent_version.py -> build\lib.win-amd64-3.5
  creating build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_checked_types.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_field_common.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_helpers.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_immutable.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_pbag.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_pclass.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_pdeque.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_plist.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_pmap.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_precord.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_pset.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_pvector.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\_transformations.py -> build\lib.win-amd64-3.5\pyrsistent
  copying pyrsistent\__init__.py -> build\lib.win-amd64-3.5\pyrsistent
  running build_ext
  building 'pvectorc' extension
  error: [WinError 2] The system cannot find the file specified

  ----------------------------------------
  Failed building wheel for pyrsistent
Failed to build pyrsistent
Installing collected packages: pyrsistent
  Running setup.py install for pyrsistent
    Complete output from command C:\Anaconda3\python.exe -c "import setuptools, tokenize;__file__='C:\\cygwin64\\tmp\\pip-build-sqcinj9m\\pyrsistent\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\cygwin64\tmp\pip-_wbdiief-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    running build_ext
    building 'pvectorc' extension
    error: [WinError 2] The system cannot find the file specified

    ----------------------------------------
Command "C:\Anaconda3\python.exe -c "import setuptools, tokenize;__file__='C:\\cygwin64\\tmp\\pip-build-sqcinj9m\\pyrsistent\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\cygwin64\tmp\pip-_wbdiief-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\cygwin64\tmp\pip-build-sqcinj9m\pyrsistent

python3和pip都在路径中:

$ which pip
/cygdrive/c/Anaconda3/Scripts/pip

$ which python
/cygdrive/c/Anaconda3/python

尝试安装rpy2时,错误是相同的,因此它不是我试图安装的软件包的特定内容。有没有人有问题的想法或故障排除的想法?我已尝试调试install.py,但抛出错误的代码在C中。我已经尝试以详细模式进行安装,但它仍然没有说明它找不到的文件那种情况。 (如果你想知道为什么我没有使用conda,那是因为它没有安装pyrsistent,而对于rpy2安装,它坚持将它链接到它自己的安装R,甚至在指定我自己的安装时,某些东西没有正确链接。我已经走了这条路,并且想坚持点。)

1 个答案:

答案 0 :(得分:0)

以下是阻止在Windows上安装python包的任何人的解决方法。有几个站点具有用于python包的Windows二进制文件。我能够为rpy2 here找到一个二进制文件,但是还有其他几个网站,如果你只是谷歌类似于" python Windows二进制文件"。然后我做了:

pip install rpy2-2.7.4-cp35-none-win_amd64.whl

pyrsistent不在该网站或我找到的其他几个二进制网站中。但我的开发团队中的其他人向我发送了他的Anaconda3 / Lib / site-packages目录中的/ pyrsistent目录,并在将其复制到我的机器上的同一目录后,我也能够导入pyrsistent。

它不漂亮,但它确实有用。