- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个用 Anaconda 创建的虚拟环境。激活后,我可以启动 python3 shell 并导入 keras 库,我收到以下警告,但除此之外它似乎可以正常工作。
/home/ryan/anaconda3/envs/spyderudemy/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from
float
tonp.floating
is deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type
. from ._conv import register_converters as _register_converters Using TensorFlow backend.
现在,如果在我的终端中激活了虚拟环境并从该终端启动 Spyder IDE,我将无法访问 IPython 控制台中的 keras 库。具体来说,导致我出现问题的导入是:
from keras.models import Sequential
IPython shell 中的输出是:
ModuleNotFoundError: No module named 'keras'
我使用的是 Ubuntu 16.04,当我启动 Spyder 时,它显示在控制台的顶部:
Python 3.6.5 |Anaconda custom (64-bit)| (default, Apr 26 2018, 13:46:40)
如果我执行,从我的普通 bash 终端
python3 -c 'import sys, pprint; pprint.pprint(sys.path)'
我得到:
['', '/home/ryan/anaconda3/envs/spyderudemy/lib/python36.zip', '/home/ryan/anaconda3/envs/spyderudemy/lib/python3.6', '/home/ryan/anaconda3/envs/spyderudemy/lib/python3.6/lib-dynload', '/home/ryan/anaconda3/envs/spyderudemy/lib/python3.6/site-packages']
尽管我认为 Tensorflow 应该包含在 Anaconda 软件包中,但由于它无法正常工作,我还是使用 pip3 将其安装在环境中,如下所示:
sudo pip3 install --upgrade tensorflow
我使用 sudo 是因为我遇到了权限错误,而且我认为输出看起来还不错:
The directory '/home/ryan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/ryan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting tensorflow Downloading https://files.pythonhosted.org/packages/6d/dc/464f59597a5a8282585238e6e3a7bb3770c3c1f1dc8ee72bd5be257178ec/tensorflow-1.8.0-cp35-cp35m-manylinux1_x86_64.whl (49.1MB) 100% |████████████████████████████████| 49.1MB 33kB/s Collecting tensorboard<1.9.0,>=1.8.0 (from tensorflow) Downloading https://files.pythonhosted.org/packages/59/a6/0ae6092b7542cfedba6b2a1c9b8dceaf278238c39484f3ba03b03f07803c/tensorboard-1.8.0-py3-none-any.whl (3.1MB) 100% |████████████████████████████████| 3.1MB 466kB/s Collecting wheel>=0.26 (from tensorflow) Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB) 100% |████████████████████████████████| 51kB 3.3MB/s Collecting numpy>=1.13.3 (from tensorflow) Downloading https://files.pythonhosted.org/packages/43/17/cd9fa14492dbef2aaf22622db79dba087c10f125473e730cda2f2019c40b/numpy-1.14.5-cp35-cp35m-manylinux1_x86_64.whl (12.1MB) 100% |████████████████████████████████| 12.1MB 131kB/s Collecting gast>=0.2.0 (from tensorflow) Collecting protobuf>=3.4.0 (from tensorflow) Downloading https://files.pythonhosted.org/packages/11/c4/8a35f5af5f26040ae7f3d521875e43429d2955d598fa3f2d0b6b88133bb1/protobuf-3.6.0-cp35-cp35m-manylinux1_x86_64.whl (7.1MB) 100% |████████████████████████████████| 7.1MB 223kB/s Requirement already up-to-date: six>=1.10.0 in /usr/local/lib/python3.5/dist-packages (from tensorflow) Collecting termcolor>=1.1.0 (from tensorflow) Collecting absl-py>=0.1.6 (from tensorflow) Collecting astor>=0.6.0 (from tensorflow) Downloading https://files.pythonhosted.org/packages/b2/91/cc9805f1ff7b49f620136b3a7ca26f6a1be2ed424606804b0fbcf499f712/astor-0.6.2-py2.py3-none-any.whl Collecting grpcio>=1.8.6 (from tensorflow) Downloading https://files.pythonhosted.org/packages/c6/b8/47468178ba19143e89b2da778eed660b84136c0a877224e79cc3c1c3fd32/grpcio-1.12.1-cp35-cp35m-manylinux1_x86_64.whl (9.0MB) 100% |████████████████████████████████| 9.0MB 182kB/s Collecting markdown>=2.6.8 (from tensorboard<1.9.0,>=1.8.0->tensorflow)
Downloading https://files.pythonhosted.org/packages/6d/7d/488b90f470b96531a3f5788cf12a93332f543dbab13c423a5e7ce96a0493/Markdown-2.6.11-py2.py3-none-any.whl (78kB) 100% |████████████████████████████████| 81kB 3.8MB/s Collecting html5lib==0.9999999 (from tensorboard<1.9.0,>=1.8.0->tensorflow) Collecting bleach==1.5.0 (from tensorboard<1.9.0,>=1.8.0->tensorflow) Downloading https://files.pythonhosted.org/packages/33/70/86c5fec937ea4964184d4d6c4f0b9551564f821e1c3575907639036d9b90/bleach-1.5.0-py2.py3-none-any.whl Collecting werkzeug>=0.11.10 (from tensorboard<1.9.0,>=1.8.0->tensorflow) Downloading https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl (322kB) 100% |████████████████████████████████| 327kB 1.8MB/s Collecting setuptools (from protobuf>=3.4.0->tensorflow) Downloading https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl (567kB) 100% |████████████████████████████████| 573kB 1.5MB/s Installing collected packages: markdown, numpy, html5lib, wheel, setuptools, protobuf, bleach, werkzeug, tensorboard, gast, termcolor, absl-py, astor, grpcio, tensorflow Found existing installation: numpy 1.13.3 Uninstalling numpy-1.13.3: Successfully uninstalled numpy-1.13.3 Found existing installation: html5lib 0.999 Uninstalling html5lib-0.999: Successfully uninstalled html5lib-0.999 Found existing installation: wheel 0.29.0 Uninstalling wheel-0.29.0: Successfully uninstalled wheel-0.29.0 Found existing installation: setuptools 20.7.0 Uninstalling setuptools-20.7.0: Successfully uninstalled setuptools-20.7.0 Found existing installation: protobuf 3.4.0 Uninstalling protobuf-3.4.0: Successfully uninstalled protobuf-3.4.0 Successfully installed absl-py-0.2.2 astor-0.6.2 bleach-1.5.0 gast-0.2.0 grpcio-1.12.1 html5lib-0.9999999 markdown-2.6.11 numpy-1.14.5 protobuf-3.6.0 setuptools-39.2.0 tensorboard-1.8.0 tensorflow-1.8.0 termcolor-1.1.0 werkzeug-0.14.1 wheel-0.31.1 You are using pip version 9.0.1, however version 10.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
如果有人对这个问题有任何建议,我将永远感激不已。
最佳答案
Now if in my terminal I have the virtual env activated and [...].
那你是不是在虚拟环境中安装了keras
?如果没有,请尝试按照使用 Anaconda 安装部分进行操作。
应该是这样的:
(your_env_name) conda install your_package_name
关于python-3.x - Spyder 控制台找不到 keras 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50937489/
例如,我有一个父类Author: class Author { String name static hasMany = [ fiction: Book,
代码如下: dojo.query(subNav.navClass).forEach(function(node, index, arr){ if(dojo.style(node, 'd
我有一个带有 Id 和姓名的学生表和一个带有 Id 和 friend Id 的 Friends 表。我想加入这两个表并找到学生的 friend 。 例如,Ashley 的 friend 是 Saman
我通过互联网浏览,但仍未找到问题的答案。应该很容易: class Parent { String name Child child } 当我有一个 child 对象时,如何获得它的 paren
我正在尝试创建一个以 Firebase 作为我的后端的社交应用。现在我正面临如何(在哪里?)找到 friend 功能的问题。 我有每个用户的邮件地址。 我可以访问用户的电话也预订。 在传统的后端中,我
我主要想澄清以下几点: 1。有人告诉我,在 iOS 5 及以下版本中,如果您使用 Game Center 设置多人游戏,则“查找 Facebook 好友”(如与好友争夺战)的功能不是内置的,因此您需要
关于redis docker镜像ENTRYPOINT脚本 docker-entrypoint.sh : #!/bin/sh set -e # first arg is `-f` or `--some-
我是一名优秀的程序员,十分优秀!