anaconda使用pip安装包时出现:Using cached https:XXX

本文介绍了一种清除pip缓存的方法,对于不使用缓存的情况,只需简单地删除pip目录下的cache文件夹即可实现。这一操作有助于解决由于缓存导致的安装问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

transformers在pycharm中安装报错:PS D:\Python\PythonProject3> conda activate pytorch-gpu PS D:\Python\PythonProject3> pip show transformers WARNING: Package(s) not found: transformers PS D:\Python\PythonProject3> pip install transformers Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting transformers Using cached https://pypi.tuna.tsinghua.edu.cn/packages/5b/0b/e45d26ccd28568013523e04f325432ea88a442b4e3020b757cf4361f0120/transformers-4.30.2-py3-none-any.whl (7.2 MB) Requirement already satisfied: filelock in d:\anaconda3\lib\site-packages (from transformers) (3.0.8) Collecting huggingface-hub<1.0,>=0.14.1 (from transformers) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7f/c4/adcbe9a696c135578cabcbdd7331332daad4d49b7c43688bc2d36b3a47d2/huggingface_hub-0.16.4-py3-none-any.whl (268 kB) Requirement already satisfied: numpy>=1.17 in d:\anaconda3\lib\site-packages (from transformers) (1.21.6) Collecting packaging>=20.0 (from transformers) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl (53 kB) Collecting pyyaml>=5.1 (from transformers) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1e/ae/964ccb88a938f20ece5754878f182cfbd846924930d02d29d06af8d4c69e/PyYAML-6.0.1-cp37-cp37m-win_amd64.whl (153 kB) Collecting regex!=2019.12.17 (from transformers) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9c/a9/e482ecfb6b229cc0b55c5360674280adddea26327a4ecdc258bc09d1fbd3/regex-2024.4.16-cp37-cp37m-win_amd64.whl (269 kB) Requirement already satisfied: requests in d:\anaconda3\lib\site-packages (from transformers) (2.19.1) Collecting tokenizers!=0.11.3,<0.14,>=0.11.1 (from transformers) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/90/06/1f3a3a6fb57bf3e72f63cbf0ae0991540065dd6a13393b89761b38634cb0/tokenizers-0.13.3-cp37-cp37m-win_amd64.whl (3.5 MB) Collecting safetensors>=0.3.1 (from transformers) Using cached https://py
04-02
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting torchcam Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9a/35/4709f53016e22be6843022991feaf73bab2f41ea96800a4f9a830af6011d/torchcam-0.4.0-py3-none-any.whl (46 kB) Requirement already satisfied: torch<3.0.0,>=2.0.0 in h:\anaconda\envs\work1_tea\lib\site-packages (from torchcam) (2.7.1) Collecting numpy<2.0.0,>=1.17.2 (from torchcam) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/65/6e/09db70a523a96d25e115e71cc56a6f9031e7b8cd166c1ac8438307c14058/numpy-1.26.4.tar.gz (15.8 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [21 lines of output] + H:\anaconda\envs\work1_tea\python.exe C:\Users\bhl16\AppData\Local\Temp\pip-install-tscbct44\numpy_328a9d197ece4fd6a905a75cbd451254\vendored-meson\meson\meson.py setup C:\Users\bhl16\AppData\Local\Temp\pip-install-tscbct44\numpy_328a9d197ece4fd6a905a75cbd451254 C:\Users\bhl16\AppData\Local\Temp\pip-install-tscbct44\numpy_328a9d197ece4fd6a905a75cbd451254\.mesonpy-5q59vol4 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\bhl16\AppData\Local\Temp\pip-install-tscbct44\numpy_328a9d197ece4fd6a905a75cbd451254\.mesonpy-5q59vol4\meson-python-native-file.ini The Meson build system Version: 1.2.99 Source dir: C:\Users\bhl16\AppData\Local\Temp\pip-install-tscbct44\numpy_328a9d197ece4fd6a905a75cbd451254 Build dir: C:\Users\bhl16\AppData\Local\Temp\pip-install-tscbct44\numpy_328a9d197ece4fd6a905a75cbd451254\.mesonpy-5q59vol4 Build type: native build Project name: NumPy Project version: 1.26.4 WARNING: Failed to activate VS environment: Could not parse vswhere.exe output ..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']] The following exception(s) were encountered: Running `icl ""` gave "[WinError 2] 系统找不到指定的文件。" Running `cl /?` gave "[WinError 2] 系统找不到指定的文件。" Running `cc --version` gave "[WinError 2] 系统找不到指定的文件。" Running `gcc --version` gave "[WinError 2] 系统找不到指定的文件。" Running `clang --version` gave "[WinError 2] 系统找不到指定的文件。" Running `clang-cl /?` gave "[WinError 2] 系统找不到指定的文件。" Running `pgcc --version` gave "[WinError 2] 系统找不到指定的文件。" A full log can be found at C:\Users\bhl16\AppData\Local\Temp\pip-install-tscbct44\numpy_328a9d197ece4fd6a905a75cbd451254\.mesonpy-5q59vol4\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
最新发布
07-31
但是我pip候却报错:Installing build dependencies ... error error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [71 lines of output] Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation == "CPython"' don't match your environment Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation != "CPython"' don't match your environment Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment Collecting setuptools Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl (1.2 MB) Collecting wheel Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0b/2c/87f3254fd8ffd29e4c02732eee68a83a1d3c346ae39bc6822dcbcb697f2b/wheel-0.45.1-py3-none-any.whl (72 kB) Collecting Cython>=0.28.5 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c2/94/65ba40faeafe74845ba22b61aff7d73475671c3bd24bffc6cba53f3b0063/cython-3.1.2-cp313-cp313-win_amd64.whl (2.7 MB) ---------------------------------------- 2.7/2.7 MB 11.0 MB/s eta 0:00:00 Collecting numpy==1.17.3 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe/numpy-1.17.3.zip (6.4 MB) ---------------------------------------- 6.4/6.4 MB 11.1 MB/s eta 0:00:00 Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error Preparing metadata (pyproject.toml) did not run successfully. exit code: 1 [28 lines of output] Running from numpy source directory. <string>:418: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates Traceback (most recent call last): File "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() ~~~~^^ File "D:\Python\Projects\SymbolicRegression\.venv\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 "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "C:\Users\18982\AppData\Local\Temp\pip-build-env-iylv62ta\overlay\Lib\site-packages\setuptools\build_meta.py", line 374, in prepare_metadata_for_build_wheel self.run_setup() ~~~~~~~~~~~~~~^^ File "C:\Users\18982\AppData\Local\Temp\pip-build-env-iylv62ta\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18982\AppData\Local\Temp\pip-build-env-iylv62ta\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "<string>", line 443, in <module> File "<string>", line 422, in setup_package File "C:\Users\18982\AppData\Local\Temp\pip-install-cnhfnw94\numpy_33d7182cc1bd44368e579191210a5ae4\numpy\distutils\__init__.py", line 6, in <module> from . import ccompiler File "C:\Users\18982\AppData\Local\Temp\pip-install-cnhfnw94\numpy_33d7182cc1bd44368e579191210a5ae4\numpy\distutils\ccompiler.py", line 111, in <module> replace_method(CCompiler, 'find_executables', CCompiler_find_executables) ^^^^^^^^^ NameError: name 'CCompiler' is not defined. Did you mean: 'ccompiler'? [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed Encountered error while generating package metadata. See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. [notice] A new release of pip is available: 23.2.1 -> 25.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. [notice] A new release of pip is available: 23.2.1 -> 25.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip (base) (.venv) PS D:\Python\Projects\SymbolicRegression> pip uninstall scikit-learn Found existing installation: scikit-learn 1.7.1 Uninstalling scikit-learn-1.7.1: Would remove: d:\python\projects\symbolicregression\.venv\lib\site-packages\scikit_learn-1.7.1.dist-info\* d:\python\projects\symbolicregression\.venv\lib\site-packages\sklearn\* Proceed (Y/n)? y Successfully uninstalled scikit-learn-1.7.1 (base) (.venv) PS D:\Python\Projects\SymbolicRegression> pip install scikit-learn==0.20.4 -i https://pypi.tuna.tsinghua.edu.cn/simple Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting scikit-learn==0.20.4 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/20/a0/5ec20d7e460d8ebde9ec5e40cda4339c5f546871c3a5bf9228f615b25618/scikit-learn-0.20.4.tar.gz (11.7 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.7/11.7 MB 11.5 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [29 lines of output] <string>:12: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. Partial import of sklearn during the build process. Traceback (most recent call last): File "<string>", line 153, in get_numpy_status ModuleNotFoundError: No module named 'numpy' Traceback (most recent call last): File "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() ~~~~^^ File "D:\Python\Projects\SymbolicRegression\.venv\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 "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "C:\Users\18982\AppData\Local\Temp\pip-build-env-uqmyyyrx\overlay\Lib\site-packages\setuptools\build_meta.py", line 374, in prepare_metadata_for_build_wheel self.run_setup() ~~~~~~~~~~~~~~^^ File "C:\Users\18982\AppData\Local\Temp\pip-build-env-uqmyyyrx\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18982\AppData\Local\Temp\pip-build-env-uqmyyyrx\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "<string>", line 250, in <module> File "<string>", line 238, in setup_package ImportError: Numerical Python (NumPy) is not installed. scikit-learn requires NumPy >= 1.8.2. Installation instructions are available on the scikit-learn website: http://scikit-learn.org/stable/install.html [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
07-28
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值