- 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/
我正在尝试在 Windows 上运行的小于 1GB 的 VM 上设置 YouTrack 和 TeamCity。使用率将非常低(用户和请求)。这是一个 POC 环境,如果它有效,我可能会将它推送到一个超
所以我在尝试使用 FORFILES 解决这个问题时遇到了麻烦。我正在尝试获取不超过 4 天的文件。所以基本上少于 4 天。然而,这似乎不太可能,因为/d -4 获取所有 4 天或更早的项目。 以下是我
如何从下面的 events 表中选择小于 15 分钟前创建的 events? CREATE TABLE events ( created_at timestamp NOT NULL DEFAU
Google Analytics Realtime提供 rt:minutesAgo ,可以过滤查询。 然而,它是一个维度而不是一个度量标准,<=不能在过滤器中使用。 假设我想在最后 n 分钟内获得一些
iOS 核心数据 - 严重的应用程序错误 - 尝试插入 nil 你好, 我的应用程序实际上运行稳定,但在极少数情况下它会崩溃并显示此错误消息... 2019-04-02 20:48:52.437172
我想制作一个 html div 以快速向右移动(例如不到 1 秒)并消失。然后1秒后再次直接出现在这个过程最开始div的位置。此过程将由单击按钮并重复 10 次触发。 我试图在 CSS 中使用过渡属性
我发现使用 TimeTrigger 是 Windows 10 (UWP) 上计划后台任务的方式。但是看起来我们需要给出的最小数字是 15 分钟。只是想知道,即使我们安排它在接下来的 1 分钟内运行,警
我必须在 1 秒内在屏幕上打印 2^20 行整数 printf 不够快,还有其他易于使用的快速输出替代方法吗? 每一行只包含 1 个整数。 我要求它用于竞争性编程问题,我必须将其源代码提交给法官。 最
我是一名优秀的程序员,十分优秀!