简体   繁体   English

使用 conda 安装 redis 不起作用 ModuleNotFoundError 没有名为“redis”的模块

[英]redis installation using conda not working ModuleNotFoundError No module named 'redis'

As my pip proxy does not work and I had to use conda to install redis.由于我的 pip 代理不起作用,我不得不使用 conda 来安装 redis。 After I successfully installed redis using conda.在我使用 conda 成功安装 redis 之后。 in python shell mode, I tried to import redis, and got the following error: ModuleNotFoundError: No module named 'redis'在python shell模式下,我尝试导入redis,得到以下错误:ModuleNotFoundError: No module named 'redis'

Running Red Hat Enterprise Linux Server release 6.10 (Santiago) and anaconda 3, python 3.7.1运行 Red Hat Enterprise Linux Server 6.10 (Santiago) 和 anaconda 3, python 3.7.1

Any ideas how I can install redis correctly without using pip?任何想法如何在不使用 pip 的情况下正确安装 redis?

This boils down to the fact that while conda's primary use is to support Python workflows, it's not a Python package manager, but a package manager that can package and distribute software built on any stack.这归结为这样一个事实:虽然 conda 的主要用途是支持 Python 工作流,但它不是 Python 包管理器,而是可以打包和分发构建在任何堆栈上的软件的包管理器。

In particular, the redis package from the Anaconda channel is not the Python interface that you get through pip install redis .特别是,来自 Anaconda 频道的redis不是您通过pip install redis获得的 Python 接口。 Rather it's Redis proper;相反,它是 Redis 正确的; the actual server software.实际的服务器软件。

In the Anaconda channel, the Python interface is called redis-py , so if you already have Redis running somehow, you would just grab that one through在 Anaconda 频道中,Python 接口称为redis-py ,因此如果您已经以某种方式运行了 Redis,您只需通过

conda install redis-py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM