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

问题1:

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

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

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

pip install -U setuptools

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

问题2:

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

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

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

最后成功了

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

 

你可能感兴趣的:(Linux,Ubuntu,Tensorflow,Deep,Learning,深度学习,Linux)