請在此處查看我之前的問題。我整天都在尋找我的問題是什么,但仍然遇到 pip install 問題。這次我的錯誤資訊有點不同。自上一篇文章以來我做了什么:
- 確保
C:\mysys64\mingw64\bin已在系統環境變數下添加到我的路徑中 - 將VSCode 中的
c_cpp_properties.json具體編輯為"intelliSenseMode""windows-msvc-x64""windows-gcc-x64" - 重新檢查我的 Python.h 目錄下的檔案
C:\msys64\mingw64\include\python3.9\Python.h,以確保錯誤已經消失#include <unistd.h>。 - 重試
pip install Flask-SQLAlchemy,現在我收到以下錯誤...
終端視窗輸出
Using cached Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl (17 kB)
Collecting SQLAlchemy>=0.8.0
Using cached SQLAlchemy-1.4.29.tar.gz (8.0 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: Flask>=0.10 in c:\msys64\mingw64\lib\python3.9\site-packages (from Flask-SQLAlchemy) (2.0.2)
Requirement already satisfied: itsdangerous>=2.0 in c:\msys64\mingw64\lib\python3.9\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (2.0.1)
Requirement already satisfied: Jinja2>=3.0 in c:\msys64\mingw64\lib\python3.9\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (3.0.3)
Requirement already satisfied: click>=7.1.2 in c:\msys64\mingw64\lib\python3.9\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (8.0.3)
Requirement already satisfied: Werkzeug>=2.0 in c:\msys64\mingw64\lib\python3.9\site-packages (from Flask>=0.10->Flask-SQLAlchemy) (2.0.2)
Collecting greenlet!=0.4.17
Using cached greenlet-1.1.2.tar.gz (91 kB)
Preparing metadata (setup.py) ... done
Requirement 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)
Requirement 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)
Building wheels for collected packages: SQLAlchemy, greenlet
Building wheel for SQLAlchemy (setup.py) ... done
Created wheel for SQLAlchemy: filename=SQLAlchemy-1.4.29-cp39-cp39-win_amd64.whl size=1512539 sha256=80ef3cf51b84f92e8117a57097054fcb25807ebf7755115d7df299bacf17a09d
Stored in directory: c:\users\t\appdata\local\pip\cache\wheels\6d\94\a6\8bdac6f92ce851f71a9fa62934a06cf2b654700b5f258242c7
Building wheel for greenlet (setup.py) ... error
ERROR: Command errored out with exit status 1:
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'
cwd: C:\Users\t\AppData\Local\Temp\pip-install-p182wkp5\greenlet_78bb1f8ef93a452d8f0a86edfe24f6dd\
Complete output (69 lines):
然后像這樣的一些其他錯誤
"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
Files\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
greenlet.c
C:\msys64\mingw64\include\python3.9\Python.h(36): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
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
----------------------------------------
ERROR: Failed building wheel for greenlet
Running setup.py clean for greenlet
Successfully built SQLAlchemy
Failed to build greenlet
Installing collected packages: greenlet, SQLAlchemy, Flask-SQLAlchemy
Running setup.py install for greenlet ... error
ERROR: Command errored out with exit status 1:
#include <unistd.h>但是,在我的 Python.h 檔案中不再有彎曲的錯誤行。請注意,我不知道我在做什么來解決這個問題。請讓我知道是否有解決方案。
uj5u.com熱心網友回復:
您可以簡單地從這里下載適當的 whl 檔案并安裝它。
因為你greenlet?1.1.2?cp39?cp39?win_amd64.whl應該是正確的。下載后,cd到你的下載目錄并運行
C:\msys64\mingw64\bin\python.exe -m pip install greenlet?1.1.2?cp39?cp39?win_amd64.whl
然后再次嘗試您的原始安裝。
筆記
Flask_SQLAlchemy?2.5.1?py3?none?any.whl在同一網站上還有一個 whl 檔案可用。您也可以下載并安裝它
uj5u.com熱心網友回復:
中的點與 中的py -m pip點不同pip list。您可以通過py -m pip --version并pip --version獲取點子位置。
我可以通過以下方式成功安裝greenlet包:
pip install greenlet --no-cache-dir
我正在使用python310,看起來python39有一些問題。如果它不起作用,正如@FlyingTeller 建議的那樣,您可以手動下載它。
正如你所描述greenlet-1.1.2-cp39-cp39-win_amd64.whl的不起作用,所以你試過了greenlet?1.1.2?cp39?cp39?win32.whl嗎?
>>> import platform
>>> platform.architecture()
您可以通過上述代碼獲得架構。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/415757.html
標籤:
上一篇:如何從其元資料更新媒體檔案時間戳
