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

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 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持