如何修复未找到的numpy模块并安装tensorflow [英] how to fix numpy module not found and installing tensorflow

查看:601
本文介绍了如何修复未找到的numpy模块并安装tensorflow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是python环境的新手.尝试从此书籍在Windows 8.1上运行.

I am new to the python environment. Trying to get the code from this book to work on windows 8.1.

一堆找不到模块的问题(例如ssl和numnpy)并尝试使用不同版本的python之后,我得到了conda 4.5.12和Python 3.7.1.已安装.我必须将mkl _ *.dll移至d:\ Anaconda3 \ Library \ bin并将d:\ Anaconda3 \ Library \ bin添加到通过此

After a bunch of problems with modules not being found (like ssl and numnpy) and trying different version of python, I got with conda 4.5.12 and Python 3.7.1. installed. I had to move the mkl_*.dll's to d:\Anaconda3\Library\bin and added d:\Anaconda3\Library\bin to the path to get by this problem and get numpy to import. Not sure I have broken anything by doing this.

有什么方法可以在Windows 8.1上进行全新安装,以便numpy正常工作?

Is there any way to get a clean install on windows 8.1 so that numpy works?

尝试安装tensorflow会得到:

Trying to install tensorflow gets:

D:\ray\dev\conradapps\dlgopy\dlatgog\code>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?

What should I do to get tensorflow installed?

edit:尝试一些.

edit: trying some of this.

获得一些警告:

done
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(89): Could not remo
ve or rename d:\Anaconda3\DLLs\_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:\Anaconda3\DLLs\_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:\Anaconda3\DLLs\_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:\Anaconda3\DLLs\_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:\Anaconda3\DLLs\select.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:\Anaconda3\DLLs\unicodedata.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:\Anaconda3\python.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:\Anaconda3\python3.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:\Anaconda3\python37.dll.c~.  Please remove this file manually (yo
u may need to reboot to free file handles)

文件可以很容易地删除,而无需重新启动.现在我可以导入tensorflow了.

files were easily deleted without rebooting. now i can import tensorflow.

接下来尝试喀拉拉邦.

keras正在导入!

keras is importing!

推荐答案

简单解决方案:

1)卸载Anaconda-它的名称类似于"Python 3.7.1(Anaconda3 2018.12 64位)".

1) Uninstall Anaconda - it will be called something like "Python 3.7.1 (Anaconda3 2018.12 64-bit)".

2)重新安装Anaconda,但这一次是在安装过程中打勾,以将Python添加到您的PATH.

2) Reinstall Anaconda, but this time tick box during setup to add Python to your PATH.

3)Tensorflow和numpy应该开箱即用,不需要其他安装.例如,在我的终端上,我可以运行:

3) Tensorflow and numpy should work out of the box with no additional installations required. For example, from my terminal I can run:

C:\Users\vasil>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

这篇关于如何修复未找到的numpy模块并安装tensorflow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆