简体   繁体   English

Cygwin中的pip安装找不到文件错误

[英]pip install in Cygwin cannot find file error

I am on a Mac OS El Capitan, running a Windows 10 64-bit VM inside Parallels. 我在Mac OS El Capitan上运行,在Parallels中运行Windows 10 64位VM。 I have Cygwin installed and Anaconda3. 我安装了Cygwin和Anaconda3。 I would like to install two packages (pyrsistent and rpy2) using pip. 我想使用pip安装两个软件包(pyrsistent和rpy2)。 Both of them throw an error "error: [WinError 2] The system cannot find the file specified" without specifying the file it can't find. 他们两个都抛出错误“错误:[WinError 2]系统找不到指定的文件”,而没有指定找不到的文件。

Here's the output: 这是输出:

$ 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

Both python3 and pip are in the path: python3和pip都在路径中:

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

$ which python
/cygdrive/c/Anaconda3/python

The error is identical when trying to install rpy2 so it's not something particular to the package I'm trying to install. 尝试安装rpy2时,错误是相同的,因此对于我要安装的软件包而言,它不是特别的东西。 Does anyone have ideas of the problem or ideas for troubleshooting? 是否有人对问题有想法或对故障排除有想法? I've tried debugging into the install.py but the code throwing the error is in C. I've tried doing the install in verbose mode, but it still doesn't say what file it cannot find in that case. 我尝试调试到install.py,但是引发错误的代码在C中。我尝试以详细模式进行安装,但仍未说明在那种情况下找不到的文件。 (and if you're wondering why I haven't used conda, it's because it doesn't install pyrsistent, and for the rpy2 install, it insists on linking it to its own install of R, and even when specifying my own install, something doesn't link correctly. I've already been down that road and would like to stick to pip). (并且,如果您想知道为什么我没有使用conda,那是因为它没有安装pyrsistent,而对于rpy2安装,它坚持将其链接到自己的R安装,甚至在指定我自己的安装时,某些内容无法正确链接。我已经走过那条路了,想坚持点子)。

Here is a workaround for anyone who is stuck installing python packages on Windows. 对于任何坚持在Windows上安装python软件包的人来说,这都是一种解决方法。 There are several sites that have Windows binaries for python packages. 有几个站点具有适用于python软件包的Windows二进制文件。 I was able to find a binary for rpy2 here but there are several other sites too, if you just google something like "python Windows binaries". 我能找到rpy2二元这里 ,但还有其他一些网站也一样,如果你只是谷歌像“蟒蛇Windows二进制”。 Then I did: 然后我做了:

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

pyrsistent was not in that website or any of several other binaries websites I found. pyrsistent不在那个网站或我发现的任何其他几个二进制网站中。 But someone else on my dev team sent me the /pyrsistent directory inside his Anaconda3/Lib/site-packages directory and after copying it to the same directory on my machine, I was able to import pyrsistent as well. 但是开发团队中的其他人向我发送了他的Anaconda3 / Lib / site-packages目录中的/ pyrsistent目录,并将其复制到我的计算机上的同一目录中之后,我也能够导入pyrsistent。

It's not pretty, but it worked. 它虽然不漂亮,但确实有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM