Windows下基于environment.yml创建Anaconda环境失败求助
从Windows Server导出的conda环境在本地Windows创建失败
背景
此前员工在Windows Server上创建了用于运行Python项目的Anaconda环境ai_312。我执行conda activate ai_312激活环境后,通过conda env export > environment.yml导出配置文件,将文件复制到本地Windows电脑后,执行conda env create -f environment.yml命令创建环境,过程中出现错误。
环境配置文件内容
name: ai_312 channels: - conda-forge - defaults dependencies: - aioconsole=0.8.1=pyhd8ed1ab_0 - aiohappyeyeballs=2.4.3=pyhd8ed1ab_0 - aiohttp=3.11.7=py312h31fea79_0 - aiosignal=1.3.1=pyhd8ed1ab_0 - annotated-types=0.7.0=pyhd8ed1ab_0 - anyio=4.6.2.post1=pyhd8ed1ab_0 - async-timeout=4.0.3=pyhd8ed1ab_0 - attrs=24.2.0=pyh71513ae_0 - brotli-python=1.1.0=py312h275cf98_2 - bzip2=1.0.8=h2466b09_7 - ca-certificates=2024.8.30=h56e8100_0 - certifi=2024.8.30=pyhd8ed1ab_0 - cffi=1.17.1=py312h4389bb4_0 - charset-normalizer=3.4.0=pyhd8ed1ab_0 - colorama=0.4.6=pyhd8ed1ab_0 - cryptography=43.0.3=py312h9500af3_0 - dataclasses-json=0.6.7=pyhd8ed1ab_0 - distro=1.9.0=pyhd8ed1ab_0 - exceptiongroup=1.2.2=pyhd8ed1ab_0 - frozenlist=1.5.0=py312h4389bb4_0 - greenlet=3.1.1=py312h275cf98_0 - h11=0.14.0=pyhd8ed1ab_0 - h2=4.1.0=pyhd8ed1ab_0 - hpack=4.0.0=pyh9f0ad1d_0 - httpcore=1.0.7=pyh29332c3_1 - httpx=0.27.2=pyhd8ed1ab_0 - httpx-sse=0.4.0=pyhd8ed1ab_0 - hyperframe=6.0.1=pyhd8ed1ab_0 - idna=3.10=pyhd8ed1ab_0 - intel-openmp=2024.2.1=h57928b3_1083 - jiter=0.7.1=py312h2615798_0 - jsonpatch=1.33=pyhd8ed1ab_0 - jsonpointer=3.0.0=py312h2e8e312_1 - langchain=0.3.8=pyhd8ed1ab_0 - langchain-community=0.3.8=pyhd8ed1ab_0 - langchain-core=0.3.21=pyhd8ed1ab_0 - langchain-text-splitters=0.3.2=pyhd8ed1ab_0 - langsmith=0.1.145=pyhd8ed1ab_0 - libblas=3.9.0=25_win64_mkl - libcblas=3.9.0=25_win64_mkl - libexpat=2.6.4=he0c23c2_0 - libffi=3.4.2=h8ffe710_5 - libhwloc=2.11.1=default_h8125262_1000 - libiconv=1.17=hcfcfb64_2 - liblapack=3.9.0=25_win64_mkl - libsqlite=3.47.0=h2466b09_1 - libxml2=2.13.5=h442d1da_0 - libzlib=1.3.1=h2466b09_2 - loguru=0.7.2=py312h2e8e312_2 - marshmallow=3.23.1=pyhd8ed1ab_0 - mkl=2024.2.2=h66d3029_14 - multidict=6.1.0=py312h31fea79_1 - mypy_extensions=1.0.0=pyha770c72_0 - numpy=1.26.4=py312h8753938_0 - openai=1.55.0=pyhd8ed1ab_0 - openssl=3.4.0=h2466b09_0 - orjson=3.10.12=py312h2615798_0 - packaging=24.2=pyhff2d567_1 - pdfminer.six=20240706=pyhd8ed1ab_0 - pip=24.3.1=pyh8b19718_0 - propcache=0.2.0=py312h4389bb4_2 - pthreads-win32=2.9.1=h2466b09_4 - pycparser=2.22=pyhd8ed1ab_0 - pydantic=2.10.1=pyh10f6f8f_0 - pydantic-core=2.27.1=py312h2615798_0 - pydantic-settings=2.6.1=pyh3cfb1c2_0 - pysocks=1.7.1=pyh0701188_6 - python=3.12.4=h889d299_0_cpython - python-dotenv=1.0.1=pyhd8ed1ab_0 - python_abi=3.12=5_cp312 - pyyaml=6.0.2=py312h4389bb4_1 - requests=2.32.3=pyhd8ed1ab_0 - requests-toolbelt=1.0.0=pyhd8ed1ab_0 - setuptools=75.6.0=pyhff2d567_0 - sniffio=1.3.1=pyhd8ed1ab_0 - sqlalchemy=2.0.35=py312h4389bb4_0 - tbb=2021.13.0=hc790b64_0 - tenacity=8.5.0=pyhd8ed1ab_0 - tk=8.6.13=h5226925_1 - tqdm=4.67.0=pyhd8ed1ab_0 - typing-extensions=4.12.2=hd8ed1ab_0 - typing_extensions=4.12.2=pyha770c72_0 - typing_inspect=0.9.0=pyhd8ed1ab_0 - tzdata=2024b=hc8b5060_0 - ucrt=10.0.22621.0=h57928b3_1 - urllib3=2.2.3=pyhd8ed1ab_0 - vc=14.3=ha32ba9b_23 - vc14_runtime=14.42.34433=he29a5d6_23 - vs2015_runtime=14.42.34433=hdffcdeb_23 - websockets=14.1=py312h4389bb4_0 - wheel=0.45.1=pyhd8ed1ab_0 - win32_setctime=1.1.0=pyhd8ed1ab_0 - win_inet_pton=1.1.0=pyh7428d3b_7 - xz=5.2.6=h8d14728_0 - yaml=0.2.5=h8ffe710_2 - yarl=1.18.0=py312h4389bb4_0 - zstandard=0.23.0=py312h7606c53_1 - zstd=1.5.6=h0ea2cb4_0 - pip: - llmengine==0.0.1
错误详情
错误发生在安装llmengine==0.0.1时。我尝试将其修改为PyPI上的真实包名llm-engines==0.0.1,但仍报错。错误堆栈如下:
Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [20 lines of output] Traceback (most recent call last): File "C:\miniconda3\envs\ai_312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\miniconda3\envs\ai_312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\miniconda3\envs\ai_312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\<username>\AppData\Local\Temp\pip-build-env-rs3rhwe7\overlay\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\<username>\AppData\Local\Temp\pip-build-env-rs3rhwe7\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires self.run_setup() File "C:\Users\<username>\AppData\Local\Temp\pip-build-env-rs3rhwe7\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 11, in <module> File "C:\Users\<username>\AppData\Local\Temp\pip-build-env-rs3rhwe7\overlay\Lib\site-packages\torch\__init__.py", line 141, in <module> raise err OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\<username>\AppData\Local\Temp\pip-build-env-rs3rhwe7\overlay\Lib\site-packages\torch\lib\shm.dll" or one of its dependencies. [end of output]
疑问
有人能尝试创建该环境吗?是否能成功?
内容的提问来源于stack exchange,提问作者miso
相关产品推荐
相关产品推荐

