python3.7安装Tensorflow

提示:写完文章后,目录可以自动生成,如何生成右侧的帮助文档。

[En]

Tip: after the article is written, the directory can be generated automatically, how to generate the help documentation on the right.

昨天做了一下吴恩达的关于tensorflow的作业,需要安装tensorflow。但是很奇怪的是不论是直接在conda里面安装还是使用whl文件安装都报错,今天终于安装好了,特地记录一下心酸历程。

python版本——3.7
没想到还要介绍什么环境,就只说python版本吧(我是先安装了Anaconda,然后使用里面的python)

1.使用whl文件安装

1)首先去网上下载对应版本的tensorflow安装包,网上应该很多的,因为不知道我找到的那个网站是哪篇博客写的,就不在这里写了。
2)下载好了之后放在Anaconda的安装目录下,例如我的是 _E:\Anaconda\ProgramData\Lib\site-packages_文件夹下。
3)在开始那边找到Anaconda Prompt,然后输入

*pip install E:\Anaconda\ProgramData\Lib\site-packages\XXXXXX.whl*

这个 _XXXXXX.whl_就是(2)里面下载的文件
4)开始运行了,然后那个控制面板就开始缓慢地运行
如果运气好的话,这样应该是可以成功安装tensorflow的,但是运气不好的话,会在安装的过程中报很多令人惊讶的错误。
: (我运气不太好,所以又尝试了第二种办法。

2.直接在Anaconda 里使用pip进行安装

1)同样地,在开始面板找到Anaconda Prompt,然后直接输入

pip install tensorflow

2)控制面板是一直不停地动,如果运气好的话,这样也能直接安装好,只需要这么简单的一步。
可现实是我还是一直报错,要么这个error,要么那个error。

3.成功安装的过程

今天,我抱着不服输的态度,先打开了爬壁软件,然后重复了2厘米的过程。结果,我很快就安装了一段时间。我以为跑得这么顺畅没问题,但我报了一个错误:

[En]

Today, with the attitude of not admitting defeat, I first opened the wall-climbing software, and then repeated the process of * 2cm . As a result, I installed it very quickly for a while. I thought it would be no problem if I ran so smoothly, but I reported an error:*

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

pytest-astropy 0.8.0 requires pytest-cov>=2.0, which is not installed.

pytest-astropy 0.8.0 requires pytest-filter-subpackage>=0.1, which is not installed.

astroid 2.3.3 requires typed-ast<1.5,>=1.4.0; implementation_name == "cpython" and python_version < "3.8", which is not installed.

astroid 2.3.3 requires wrapt==1.11.*, but you'll have wrapt 1.12.1 which is incompatible.

经过在网上一波的查找,找到了一个我看得懂的答案 https://zhuanlan.zhihu.com/p/266120302
根据他的方法,问题被成功地解决了。

[En]

According to his method, the problem was solved successfully.

4.查看tensorflow是否安装成功

我还找到了一个我能理解的答案:

[En]

I also found an answer that I could understand as follows:

https:

按照上述方法操作后,报告了另一个错误:

[En]

After following the above method, another error was reported:

Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found

这个问题还没有解决,但应该不是大问题。去百度应该没问题,所以我不会写解决方案。

[En]

This problem has not been solved yet, but it should not be a big problem. It should be OK to go to Baidu, so I will not write a solution.

这就是本文的全部内容。让我们谈谈我们的感受和经历。

[En]

That’s all for this article. Let’s talk about our feelings and experiences.

是从昨天晚上7点左右开始做这个作业的,安装这个tensorflow也是花了不少时间,一次又一次的尝试,一次又一次的寻找答案,一次又一次的报错,和安装失败。说不我不烦躁是不可能的,因为毕竟自己碰到了问题,也有在认真地解决问题,可是一直解决不了,付出和回报不成正比,就会比较心情不好。
但即便如此,你也必须更多地寻找它。当你遇到问题时,找出解决办法。不要一看到解决方案就采取行动,多找几个比较,看看它是否可信,是否适合你。当你解决了这个问题,你会像我现在一样幸福。

[En]

But even so, you have to look for it more. When you encounter a problem, find a solution. * Don’t take action as soon as you see a solution, find a few more comparisons to see if it is credible and suitable for you. When you solve the problem, you will be as happy as I am now.

知乎、Bing、CSDN这些是我碰到软件问题的时候,常用的搜索平台。
第一个博客,如果有不好的地方,欢迎你批评和纠正。

[En]

The first blog, if there is something not good, you are welcome to criticize and correct it.*

Original: https://blog.csdn.net/qq_44057404/article/details/120631013
Author: 092简简单单
Title: python3.7安装Tensorflow

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/509472/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球