Anu*_*dey 6 python django macos
我是 python 开发新手,我正在尝试使用 django,但在使用 \n 安装 django 时遇到此错误pip3 install django~=4.0。\n我尝试了一些解决方案,但没有一个有效。\n我已经尝试过
pip install backports.zoneinfo但这也失败了。我正在使用 Python 3.8.9 和 mac M1
\nCollecting django~=4.0\n Using cached Django-4.1-py3-none-any.whl (8.1 MB)\nCollecting backports.zoneinfo\n Using cached backports.zoneinfo-0.2.1.tar.gz (74 kB)\n Installing build dependencies ... done\n Getting requirements to build wheel ... done\n Preparing metadata (pyproject.toml) ... done\nCollecting sqlparse>=0.2.2\n Using cached sqlparse-0.4.2-py3-none-any.whl (42 kB)\nCollecting asgiref<4,>=3.5.2\n Using cached asgiref-3.5.2-py3-none-any.whl (22 kB)\nBuilding wheels for collected packages: backports.zoneinfo\n Building wheel for backports.zoneinfo (pyproject.toml) ... error\n error: subprocess-exited-with-error\n\n \xc3\x97 Building wheel for backports.zoneinfo (pyproject.toml) did not run successfully.\n \xe2\x94\x82 exit code: 1\n \xe2\x95\xb0\xe2\x94\x80> [41 lines of output]\n running bdist_wheel\n running build\n running build_py\n creating build\n creating build/lib.macosx-10.14-arm64-cpython-38\n creating build/lib.macosx-10.14-arm64-cpython-38/backports\n copying src/backports/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/backports\n creating build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo\n copying src/backports/zoneinfo/_version.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo\n copying src/backports/zoneinfo/_common.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo\n copying src/backports/zoneinfo/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo\n copying src/backports/zoneinfo/_zoneinfo.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo\n copying src/backports/zoneinfo/_tzpath.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo\n running egg_info\n writing src/backports.zoneinfo.egg-info/PKG-INFO\n writing dependency_links to src/backports.zoneinfo.egg-info/dependency_links.txt\n writing requirements to src/backports.zoneinfo.egg-info/requires.txt\n writing top-level names to src/backports.zoneinfo.egg-info/top_level.txt\n reading manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'\n reading manifest template 'MANIFEST.in'\n /private/var/folders/bw/1s6x6hxx7zs5wdt200bhyn900000gp/T/pip-build-env-9dkhvyjx/overlay/lib/python3.8/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.\n warnings.warn(msg, warning_class)\n warning: no files found matching '*.png' under directory 'docs'\n warning: no files found matching '*.svg' under directory 'docs'\n no previously-included directories found matching 'docs/_build'\n no previously-included directories found matching 'docs/_output'\n adding license file 'LICENSE'\n adding license file 'licenses/LICENSE_APACHE'\n writing manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'\n copying src/backports/zoneinfo/__init__.pyi -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo\n copying src/backports/zoneinfo/py.typed -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo\n running build_ext\n building 'backports.zoneinfo._czoneinfo' extension\n creating build/temp.macosx-10.14-arm64-cpython-38\n creating build/temp.macosx-10.14-arm64-cpython-38/lib\n clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/apandey/env/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c lib/zoneinfo_module.c -o build/temp.macosx-10.14-arm64-cpython-38/lib/zoneinfo_module.o -std=c99\n lib/zoneinfo_module.c:1:10: fatal error: 'Python.h' file not found\n #include "Python.h"\n ^~~~~~~~~~\n 1 error generated.\n error: command '/usr/bin/clang' failed with exit code 1\n [end of output]\n\n note: This error originates from a subprocess, and is likely not a problem with pip.\n ERROR: Failed building wheel for backports.zoneinfo\nFailed to build backports.zoneinfo\nERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects\nRun Code Online (Sandbox Code Playgroud)\n
bbr*_*don 29
您的计算机上应该有此文件。/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/Headers/Python.h
如果是这样,请先运行
export C_INCLUDE_PATH=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/Headers
Run Code Online (Sandbox Code Playgroud)
然后pip install backports.zoneinfo
| 归档时间: |
|
| 查看次数: |
7253 次 |
| 最近记录: |