Duk*_*e33 5 python windows pip visual-studio-code
请在这里查看我之前的问题。我花了一整天的时间搜索我的问题是什么,但仍然遇到 pip install 问题。这次我的错误消息有点不同。自上一篇文章以来我所做的事情:
\nC:\\mysys64\\mingw64\\bin添加到系统环境变量下的路径中c_cpp_properties.json具体编辑从到 "intelliSenseMode""windows-msvc-x64""windows-gcc-x64"C:\\msys64\\mingw64\\include\\python3.9\\Python.h以确保错误已消失#include <unistd.h>。pip install Flask-SQLAlchemy,现在我收到以下错误...终端窗口输出
\nUsing cached Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl (17 kB)\nCollecting SQLAlchemy>=0.8.0\n Using cached SQLAlchemy-1.4.29.tar.gz (8.0 MB)\n Preparing metadata (setup.py) ... done\nRequirement already satisfied: Flask>=0.10 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Flask-SQLAlchemy) (2.0.2)\nRequirement already satisfied: itsdangerous>=2.0 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (2.0.1)\nRequirement already satisfied: Jinja2>=3.0 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (3.0.3)\nRequirement already satisfied: click>=7.1.2 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (8.0.3)\nRequirement already satisfied: Werkzeug>=2.0 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (2.0.2)\nCollecting greenlet!=0.4.17\n Using cached greenlet-1.1.2.tar.gz (91 kB)\n Preparing metadata (setup.py) ... done\nRequirement already satisfied: colorama in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from click>=7.1.2->Flask>=0.10->Flask-SQLAlchemy) (0.4.4)\nRequirement already satisfied: MarkupSafe>=2.0 in c:\\msys64\\mingw64\\lib\\python3.9\\site-packages (from Jinja2>=3.0->Flask>=0.10->Flask-SQLAlchemy) (2.0.1)\nBuilding wheels for collected packages: SQLAlchemy, greenlet\n Building wheel for SQLAlchemy (setup.py) ... done\n Created wheel for SQLAlchemy: filename=SQLAlchemy-1.4.29-cp39-cp39-win_amd64.whl size=1512539 sha256=80ef3cf51b84f92e8117a57097054fcb25807ebf7755115d7df299bacf17a09d\n Stored in directory: c:\\users\\t\\appdata\\local\\pip\\cache\\wheels\\6d\\94\\a6\\8bdac6f92ce851f71a9fa62934a06cf2b654700b5f258242c7\n Building wheel for greenlet (setup.py) ... error\n ERROR: Command errored out with exit status 1:\n command: \'C:\\msys64\\mingw64\\bin\\python.exe\' -u -c \'import io, os, sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'C:\\\\Users\\\\t\\\\AppData\\\\Local\\\\Temp\\\\pip-install-p182wkp5\\\\greenlet_78bb1f8ef93a452d8f0a86edfe24f6dd\\\\setup.py\'"\'"\'; __file__=\'"\'"\'C:\\\\Users\\\\t\\\\AppData\\\\Local\\\\Temp\\\\pip-install-p182wkp5\\\\greenlet_78bb1f8ef93a452d8f0a86edfe24f6dd\\\\setup.py\'"\'"\';f = getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__) if os.path.exists(__file__) else io.StringIO(\'"\'"\'from setuptools import setup; setup()\'"\'"\');code = f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' bdist_wheel -d \'C:\\Users\\t\\AppData\\Local\\Temp\\pip-wheel-iwgszyll\'\n cwd: C:\\Users\\t\\AppData\\Local\\Temp\\pip-install-p182wkp5\\greenlet_78bb1f8ef93a452d8f0a86edfe24f6dd\\\n Complete output (69 lines):\nRun Code Online (Sandbox Code Playgroud)\n然后还有一些其他错误,像这样
\n"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\\msys64\\mingw64\\include -IC:\\msys64\\mingw64\\include\\python3.9 "-IC:\\Program \nFiles\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\ATLMFC\\include" "-IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\include" "-IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt" "-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.19041.0\\\\shared" "-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.19041.0\\\\um" "-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.19041.0\\\\winrt" "-IC:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.19041.0\\\\cppwinrt" /Tcsrc/greenlet/greenlet.c /Fobuild\\temp.win-amd64-3.9\\Release\\src/greenlet/greenlet.obj\n greenlet.c\n C:\\msys64\\mingw64\\include\\python3.9\\Python.h(36): fatal error C1083: Cannot open include file: \'unistd.h\': No such file or directory\n error: command \'C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Community\\\\VC\\\\Tools\\\\MSVC\\\\14.30.30705\\\\bin\\\\HostX86\\\\x64\\\\cl.exe\' failed with exit code 2\n ----------------------------------------\n ERROR: Failed building wheel for greenlet\n Running setup.py clean for greenlet\nSuccessfully built SQLAlchemy\nFailed to build greenlet\nInstalling collected packages: greenlet, SQLAlchemy, Flask-SQLAlchemy\n Running setup.py install for greenlet ... error\n ERROR: Command errored out with exit status 1:\nRun Code Online (Sandbox Code Playgroud)\n但是,我的 Python.h 文件中不再有波浪形的错误行#include <unistd.h>。请注意,我不知道我正在做什么来尝试解决这个问题。如果有解决方案,请告诉我。
更新 2022.02.01:我有未安装的3.9.7python 版本和已安装的版本3.10.2。我已将 pip 更新到版本22.02.2并尝试了下面给出的解决方案。下载轮子后greenlet\xe2\x80\x911.1.2\xe2\x80\x91cp310\xe2\x80\x91cp310\xe2\x80\x91win32.whl,greenlet\xe2\x80\x911.1.2\xe2\x80\x91cp310\xe2\x80\x91cp310\xe2\x80\x91win_amd64.whl我转到下载文件夹并运行命令并执行以下操作:
C:\\Users\\t\\Downloads>C:\\msys64\\mingw64\\bin\\python.exe -m pip install greenlet-1.1.2-cp310-cp310-win_amd64.whl\nERROR: greenlet-1.1.2-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.\n\nC:\\Users\\t\\Downloads>C:\\msys64\\mingw64\\bin\\python.exe -m pip install greenlet-1.1.2-cp310-cp310-win32.whl\nERROR: greenlet-1.1.2-cp310-cp310-win32.whl is not a supported wheel on this platform.\nRun Code Online (Sandbox Code Playgroud)\n之后不起作用,我尝试直接使用 pip install greenletpip install greenlet并得到以下输出:
Building wheels for collected packages: greenlet\n Building wheel for greenlet (setup.py) ... error\n error: subprocess-exited-with-error\n\n \xc3\x97 python setup.py bdist_wheel did not run successfully.\n \xe2\x94\x82 exit code: 1\n \xe2\x95\xb0\xe2\x94\x80> [69 lines of output]\nRun Code Online (Sandbox Code Playgroud)\n再往下
\n note: This error originates from a subprocess, and is likely not a problem with pip.\n ERROR: Failed building wheel for greenlet\n Running setup.py clean for greenlet\nFailed to build greenlet\nInstalling collected packages: greenlet\n Running setup.py install for greenlet ... error\n error: subprocess-exited-with-error\n\n \xc3\x97 Running setup.py install for greenlet did not run successfully.\n \xe2\x94\x82 exit code: 1\n \xe2\x95\xb0\xe2\x94\x80> [71 lines of output]\nRun Code Online (Sandbox Code Playgroud)\n再往下(希望这可以对问题有所启发)
\nerror: command \'C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Community\\\\VC\\\\Tools\\\\MSVC\\\\14.30.30705\\\\bin\\\\HostX86\\\\x64\\\\cl.exe\' failed with exit code 2\n [end of output]\n\n note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: legacy-install-failure\n\n\xc3\x97 Encountered error while trying to install package.\n\xe2\x95\xb0\xe2\x94\x80> greenlet\n\nnote: This is an issue with the package mentioned above, not pip.\nhint: See above for output from the failure.\nRun Code Online (Sandbox Code Playgroud)\n
您只需从此处下载适当的 whl 文件并安装即可。
\n因为你greenlet\xe2\x80\x911.1.2\xe2\x80\x91cp39\xe2\x80\x91cp39\xe2\x80\x91win_amd64.whl应该是正确的。下载后,cd到你的下载目录并运行
C:\\msys64\\mingw64\\bin\\python.exe -m pip install greenlet\xe2\x80\x911.1.2\xe2\x80\x91cp39\xe2\x80\x91cp39\xe2\x80\x91win_amd64.whl\nRun Code Online (Sandbox Code Playgroud)\n然后再次尝试原始安装。
\n笔记
\nFlask_SQLAlchemy\xe2\x80\x912.5.1\xe2\x80\x91py3\xe2\x80\x91none\xe2\x80\x91any.whl同一网站上还提供了一个 whl 文件。您也可以下载并安装它
| 归档时间: |
|
| 查看次数: |
24707 次 |
| 最近记录: |