当我安装tensorflow-gpu时出错:
Exception:
Traceback (most recent call last):
File "D:\Learning\Anaconda3\lib\site-packages\pip\_internal\basecommand.py", line 228, in main
status = self.run(options, args)
File "D:\Learning\Anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 291, in run
resolver.resolve(requirement_set)
File "D:\Learning\Anaconda3\lib\site-packages\pip\_internal\resolve.py", line 103, in resolve
self._resolve_one(requirement_set, req)
File "D:\Learning\Anaconda3\lib\site-packages\pip\_internal\resolve.py", line 262, in _resolve_one
check_dist_requires_python(dist)
File "D:\Learning\Anaconda3\lib\site-packages\pip\_internal\utils\packaging.py", line 46, in check_dist_requires_python
feed_parser.feed(metadata)
File "D:\Learning\Anaconda3\lib\email\feedparser.py", line 175, in feed
self._input.push(data)
File "D:\Learning\Anaconda3\lib\email\feedparser.py", line 103, in push
self._partial.write(data)
TypeError: string argument expected, got 'NoneType'
解决方案:
方案1:
创建新环境,在新环境中安装:
conda create -n tf python=3.6
activate tf
pip install tensorflow-gpu
这个方法对我成功了,这个是参考链接
这个方法可能对你不会成功,建议网上搜索更多解决方案。
方案2:
升级原来环境中的所有包后再安装tensorflow-gpu:
conda upgrade --all
pip install tensorflow-gpu
安装完成后我在import tensorflow时又出现了找不到absl包的错误,我又安装了absl-py,此后import tensorflow就成功了。
conda install absl-py