如何修复未找到 Numpy 模块并安装张量流



我是python环境的新手。尝试从本书中获取代码以在Windows 8.1上运行。

在一找不到模块的问题(如 ssl 和 numnpy(并尝试不同版本的 python 之后,我安装了 conda 4.5.12 和 Python 3.7.1。我不得不将mkl_*.dll移动到d:\Anaconda3\Library\bin,并将d:\Anaconda3\Library\bin添加到路径中以解决此问题并获得numpy导入。不确定我这样做是否破坏了任何东西。

有没有办法在 Windows 8.1 上进行全新安装,以便 numpy 正常工作?

尝试安装张量流得到:

D:raydevconradappsdlgopydlatgogcode>conda install tensorflow
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
  - anaconda==2018.12=py37_0 -> bleach==3.0.2=py37_0
  - anaconda==2018.12=py37_0 -> numexpr==2.6.8=py37hdce8814_0
  - anaconda==2018.12=py37_0 -> scikit-learn==0.20.1=py37h343c172_0
  - tensorflow

我应该怎么做才能安装Tensorflow?

编辑:尝试其中的一些。

收到一些警告:

done
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3DLLs_bz2.pyd.c~.  Please remove this file manually (y
ou may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3DLLs_lzma.pyd.c~.  Please remove this file manually (
you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3DLLs_queue.pyd.c~.  Please remove this file manually
(you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3DLLs_socket.pyd.c~.  Please remove this file manually
 (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3DLLsselect.pyd.c~.  Please remove this file manually
(you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3DLLsunicodedata.pyd.c~.  Please remove this file manu
ally (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3python.exe.c~.  Please remove this file manually (you
may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3python3.dll.c~.  Please remove this file manually (you
 may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:Anaconda3python37.dll.c~.  Please remove this file manually (yo
u may need to reboot to free file handles)

无需重新启动即可轻松删除文件。 现在我可以导入张量流了。

接下来尝试 keras。

凯拉斯正在进口!

简单的解决方案:

1(卸载Anaconda - 它将被称为"Python 3.7.1(Anaconda3 2018.12 64位("。

2(重新安装Anaconda,但这次在安装过程中勾选框以将Python添加到您的PATH中。

3(Tensorflow和numpy应该开箱即用,不需要额外的安装。例如,从我的终端我可以运行:

C:Usersvasil>python
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np
<module 'numpy' from 'C:\Users\vasil\Anaconda3\lib\site-packages\numpy\__init__.py'>
>>> np.absolute(-1)
1

最新更新