当前位置:   article > 正文

『linux笔记』pip 安装keras,pytorch出错: Could not import setuptools ,Failed building wheel for pyyaml

failed building wheel for pyyaml

问题1:

使用 pip 安装包的时候如 pip install keras,遇到了如下错误:

  1. Could not import setuptools which is required to install from a source distribution.
  2. Traceback (most recent call last):
  3. File "/home/zhangkf/.conda/envs/tf15/lib/python3.5/site-packages/pip/req/req_install.py", line 387, in setup_py
  4. import setuptools # noqa
  5. File "/home/zhangkf/.conda/envs/tf15/lib/python3.5/site-packages/setuptools/__init__.py", line 11, in <module>
  6. from ._deprecation_warning import SetuptoolsDeprecationWarning
  7. ImportError: No module named 'setuptools._deprecation_warning'

查阅资料发现:这是因为 python 环境中没有 setuptools 这个包。安装上就可以了:

pip install -U setuptools

再次运行pip install keras,没有上述问题啦。

问题2:

  1. Failed building wheel for pyyaml
  2. Running setup.py clean for pyyaml
  3. Failed to build pyyaml

说明没有安装pyyaml这个包,可以安装一下。

  1. (pytorch) zhangkf@Ubuntu2:~/download$ pip install PyYAML
  2. Collecting PyYAML
  3. Installing collected packages: PyYAML
  4. Successfully installed PyYAML-3.13

最后成功了

  1. (pytorch) zhangkf@Ubuntu2:~/download$ pip install torch-0.4.1-cp36-cp36m-linux_x86_64.whl
  2. Processing ./torch-0.4.1-cp36-cp36m-linux_x86_64.whl
  3. Installing collected packages: torch
  4. Successfully installed torch-0.4.1

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号