lilili07 2022-10-17 17:19 采纳率: 71.4%
浏览 191
已结题

python 在安装tensortflow时报错

python 在安装tensortflow时报错,报错代码粘贴在这里了

Collecting gast==0.2.2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz (10 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      C:\Users\hasee\Anaconda3\lib\site-packages\setuptools\_importlib.py:23: UserWarning: `importlib-metadata` version is incompatible with `setuptools`.
      This problem is likely to be solved by installing an updated version of `importlib-metadata`.
        warnings.warn(msg)  # Ensure a descriptive message is shown.
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "C:\Users\hasee\Anaconda3\lib\site-packages\setuptools\__init__.py", line 18, in <module>
          from setuptools.dist import Distribution
        File "C:\Users\hasee\Anaconda3\lib\site-packages\setuptools\dist.py", line 34, in <module>
          from ._importlib import metadata
        File "C:\Users\hasee\Anaconda3\lib\site-packages\setuptools\_importlib.py", line 39, in <module>
          disable_importlib_metadata_finder(metadata)
        File "C:\Users\hasee\Anaconda3\lib\site-packages\setuptools\_importlib.py", line 12, in disable_importlib_metadata_finder
          import importlib_metadata
        File "C:\Users\hasee\Anaconda3\lib\site-packages\importlib_metadata\__init__.py", line 17, in <module>
          __version__ = version(__name__)
        File "C:\Users\hasee\Anaconda3\lib\site-packages\importlib_metadata\api.py", line 345, in version
          return distribution(package).version
        File "C:\Users\hasee\Anaconda3\lib\site-packages\importlib_metadata\api.py", line 310, in distribution
          return Distribution.from_name(package)
        File "C:\Users\hasee\Anaconda3\lib\site-packages\importlib_metadata\api.py", line 153, in from_name
          dists = resolver(name)
        File "C:\Users\hasee\Anaconda3\lib\site-packages\setuptools\_vendor\importlib_metadata\__init__.py", line 886, in find_distributions
          found = self._search_paths(context.name, context.path)
      AttributeError: 'str' object has no attribute 'name'
      [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.

C:\Users\hasee>conda install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-cpu==2.1
C:\Users\hasee\Anaconda3\lib\site-packages\setuptools\_importlib.py:23: UserWarning: `importlib-metadata` version is incompatible with `setuptools`.
This problem is likely to be solved by installing an updated version of `importlib-metadata`.
  warnings.warn(msg)  # Ensure a descriptive message is shown.
usage: conda-script.py [-h] [-V] command ...
conda-script.py: error: unrecognized arguments: -i

C:\Users\hasee>conda install tensorflow-cpu==2.1
C:\Users\hasee\Anaconda3\lib\site-packages\setuptools\_importlib.py:23: UserWarning: `importlib-metadata` version is incompatible with `setuptools`.
This problem is likely to be solved by installing an updated version of `importlib-metadata`.
  warnings.warn(msg)  # Ensure a descriptive message is shown.
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow-cpu==2.1

Current channels:

  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

  • 写回答

1条回答 默认 最新

报告相同问题?

问题事件

  • 系统已结题 11月7日
  • 已采纳回答 10月30日
  • 创建了问题 10月17日

悬赏问题

  • ¥15 软件定义网络mininet和onos控制器问题
  • ¥15 微信小程序 用oss下载 aliyun-oss-sdk-6.18.0.min client报错
  • ¥15 ArcGIS批量裁剪
  • ¥15 labview程序设计
  • ¥15 为什么在配置Linux系统的时候执行脚本总是出现E: Failed to fetch http:L/cn.archive.ubuntu.com
  • ¥15 Cloudreve保存用户组存储空间大小时报错
  • ¥15 伪标签为什么不能作为弱监督语义分割的结果?
  • ¥15 编一个判断一个区间范围内的数字的个位数的立方和是否等于其本身的程序在输入第1组数据后卡住了(语言-c语言)
  • ¥15 Mac版Fiddler Everywhere4.0.1提示强制更新
  • ¥15 android 集成sentry上报时报错。