注:安装tensorflow,numpy这些源,记得用国内的清华镜像源,国外的源由于网络延迟无法安装。
1.国内安装tensorflow的命令:
pip install --index-url https://pypi.douban.com/simple tensorflow
或pip install --index-url http://mirrors.aliyun.com/pypi/simple/ tensorflow
2. 国内安装numpy的命令:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy
安装中常见问题及解决办法:
问题: 导入tensorflow 因numpy报错:ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’
解决办法:
重新卸载numpy,用国内的源来安装numpy。
pip uninstall numpy
国内的源来安装:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy