|
文章目录1.Python安装库报错2.问题解决3.参考1.Python安装库报错有时Python用pipinstall安装库的时候会报错,pythonsetup.pyegg_infodidnotrunsuccessfully.,我在安装deepspeed报错示例如下:Preparingmetadata(setup.py)...errorerror:subprocess-exited-with-error×pythonsetup.pyegg_infodidnotrunsuccessfully.│exitcode:1╰─>[20linesofoutput]Traceback(mostrecentcalllast):File"",line2,inFile"
",line34,inFile"/private/var/folders/hv/g_8qfj_56k98k8tnpf_58k980000gn/T/pip-install-r4m2v95f/deepspeed_bb04440e1d854d09a2dde2b5d62ad864/setup.py",line38,infromop_builder.all_opsimportALL_OPSFile"/private/var/folders/hv/g_8qfj_56k98k8tnpf_58k980000gn/T/pip-install-r4m2v95f/deepspeed_bb04440e1d854d09a2dde2b5d62ad864/op_builder/all_ops.py",line29,inbuilder=get_accelerator().create_op_builder(member_name)File"/private/var/folders/hv/g_8qfj_56k98k8tnpf_58k980000gn/T/pip-install-r4m2v95f/deepspeed_bb04440e1d854d09a2dde2b5d62ad864/accelerator/mps_accelerator.py",line234,increate_op_builderbuilder_class=self.get_op_builder(op_name)File"/private/var/folders/hv/g_8qfj_56k98k8tnpf_58k980000gn/T/pip-install-r4m2v95f/deepspeed_bb04440e1d854d09a2dde2b5d62ad864/accelerator/mps_accelerator.py",line241,inget_op_builderfromdeepspeed.ops.op_builder.cpuimportNotImplementedBuilderFile"/private/var/folders/hv/g_8qfj_56k98k8tnpf_58k980000gn/T/pip-install-r4m2v95f/deepspeed_bb04440e1d854d09a2dde2b5d62ad864/deepspeed/__init__.py",line21,infrom.importopsFile"/private/var/folders/hv/g_8qfj_56k98k8tnpf_58k980000gn/T/pip-install-r4m2v95f/deepspeed_bb04440e1d854d09a2dde2b5d62ad864/deepspeed/ops/__init__.py",line6,infrom.importadamFile"/private/var/folders/hv/g_8qfj_56k98k8tnpf_58k980000gn/T/pip-install-r4m2v95f/deepspeed_bb04440e1d854d09a2dde2b5d62ad864/deepspeed/ops/adam/__init__.py",line6,infrom.cpu_adamimportDeepSpeedCPUAdamFile"/private/var/folders/hv/g_8qfj_56k98k8tnpf_58k980000gn/T/pip-install-r4m2v95f/deepspeed_bb04440e1d854d09a2dde2b5d62ad864/deepspeed/ops/adam/cpu_adam.py",line7,infromcpuinfoimportget_cpu_infoModuleNotFoundError:Nomodulenamed'cpuinfo'[endofoutput]note:Thiserrororiginatesfromasubprocess,andislikelynotaproblemwithpip.error:metadata-generation-failed×Encounterederrorwhilegeneratingpackagemetadata.╰─>Seeaboveforoutput.123456789101112131415161718192021222324252627282930313233可能是python依赖的库版本不对2.问题解决更新必须的库pipinstall--upgradepippipinstall--upgradesetuptoolspipinstallez_setup123上面安装更新完成之后,再执行pipinstall命令,执行成功,例如:smaller@SmallerdeMacBook-Pro:pipinstalldeepspeed✔56417:10:03CollectingdeepspeedUsingcacheddeepspeed-0.13.1.tar.gz(1.3MB)Installingbuilddependencies...doneGettingrequirementstobuildwheel...donePreparingmetadata(pyproject.toml)...doneCollectinghjson(fromdeepspeed)Usingcachedhjson-3.1.0-py3-none-any.whl(54kB)Collectingninja(fromdeepspeed)Usingcachedninja-1.11.1.1-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl.metadata(5.3kB)Requirementalreadysatisfied:numpyin/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromdeepspeed)(1.26.3)Requirementalreadysatisfied:packaging>=20.0in/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromdeepspeed)(23.2)Requirementalreadysatisfied:psutilin/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromdeepspeed)(5.9.8)Collectingpy-cpuinfo(fromdeepspeed)Usingcachedpy_cpuinfo-9.0.0-py3-none-any.whl(22kB)Collectingpydantic(fromdeepspeed)Usingcachedpydantic-2.5.3-py3-none-any.whl.metadata(65kB)Collectingpynvml(fromdeepspeed)Usingcachedpynvml-11.5.0-py3-none-any.whl(53kB)Requirementalreadysatisfied:torchin/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromdeepspeed)(2.1.2)Requirementalreadysatisfied:tqdmin/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromdeepspeed)(4.66.1)Collectingannotated-types>=0.4.0(frompydantic->deepspeed)Downloadingannotated_types-0.6.0-py3-none-any.whl.metadata(12kB)Collectingpydantic-core==2.14.6(frompydantic->deepspeed)Downloadingpydantic_core-2.14.6-cp310-cp310-macosx_10_7_x86_64.whl.metadata(6.5kB)Requirementalreadysatisfied:typing-extensions>=4.6.1in/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(frompydantic->deepspeed)(4.9.0)Requirementalreadysatisfied:filelockin/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromtorch->deepspeed)(3.13.1)Requirementalreadysatisfied:sympyin/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromtorch->deepspeed)(1.12)Requirementalreadysatisfied:networkxin/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromtorch->deepspeed)(3.2.1)Requirementalreadysatisfied:jinja2in/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromtorch->deepspeed)(3.1.3)Requirementalreadysatisfied:fsspecin/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromtorch->deepspeed)(2023.10.0)Requirementalreadysatisfied:MarkupSafe>=2.0in/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromjinja2->torch->deepspeed)(2.1.4)Requirementalreadysatisfied:mpmath>=0.19in/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages(fromsympy->torch->deepspeed)(1.3.0)Downloadingninja-1.11.1.1-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl(270kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━270.6/270.6kB21.5kB/seta0:00:00Downloadingpydantic-2.5.3-py3-none-any.whl(381kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━381.9/381.9kB13.7kB/seta0:00:00Downloadingpydantic_core-2.14.6-cp310-cp310-macosx_10_7_x86_64.whl(1.9MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━1.9/1.9MB21.8kB/seta0:00:00Downloadingannotated_types-0.6.0-py3-none-any.whl(12kB)Buildingwheelsforcollectedpackages:deepspeedBuildingwheelfordeepspeed(pyproject.toml)...doneCreatedwheelfordeepspeed:filename=deepspeed-0.13.1-py3-none-any.whlsize=1350251sha256=e94dff2604fd66ab4d2dd7d5d3fdd6571e0859a009aa471b74c548a2009f7565Storedindirectory:/Users/smaller/Library/Caches/pip/wheels/0f/fb/b5/b159b3500525eca167d8ca6e3a7e224b6075045cac90f47cf7SuccessfullybuiltdeepspeedInstallingcollectedpackages:py-cpuinfo,ninja,hjson,pynvml,pydantic-core,annotated-types,pydantic,deepspeedSuccessfullyinstalledannotated-types-0.6.0deepspeed-0.13.1hjson-3.1.0ninja-1.11.1.1py-cpuinfo-9.0.0pydantic-2.5.3pydantic-core-2.14.6pynvml-11.5.012345678910111213141516171819202122232425262728293031323334353637383940414243444546473.参考https://zhuanlan.zhihu.com/p/581112365
|
|