在Cygwin中的pip安装无法找到文件错误
问题描述:
我在Mac OS El Capitan上,在Parallels中运行Windows 10 64位虚拟机。我安装了Cygwin和Anaconda3。我想用pip安装两个软件包(pyrsistent和rpy2)。他们两个都会抛出一个错误“error:[WinError 2]系统找不到指定的文件”而没有指定找不到的文件。在Cygwin中的pip安装无法找到文件错误
下面是输出:
$ 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是在路径:尝试安装rpy2所以它不是给包我的东西特别是当
$ which pip
/cygdrive/c/Anaconda3/Scripts/pip
$ which python
/cygdrive/c/Anaconda3/python
的错误是相同的试图安装。有没有人有解决问题的想法或想法?我已经尝试调试到install.py,但引发错误的代码是在C中。我尝试在详细模式下进行安装,但它仍然没有说明在这种情况下无法找到哪个文件。 (如果你想知道为什么我没有使用conda,那是因为它没有安装pyrsistent,并且对于rpy2安装,它坚持将它链接到它自己安装的R,甚至在指定我自己的安装,有些东西没有正确链接,我已经走下了这条路,并想坚持点)。
答
这是一个解决方法,适用于在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。
这不是很漂亮,但它的工作。