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

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 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题