Pythonanywhere安装并导入新模块

Pythonanywhere安装并导入新模块

问题描述:

我是Pythonanywhere的新手,并且想安装"soundcloud" Python模块.我打开了一个Bash控制台,并给出了pip install --user soundcloud命令.

I'm new to Pythonanywhere and want to install the 'soundcloud' Python module. I've opened up a Bash console and given the pip install --user soundcloud command.

它似乎已安装,正如我在Bash控制台中使用pip freeze时在模块列表中所看到的那样.但是,当我打开Python 2.7控制台并尝试import soundcloud时,我收到一条错误消息,指出Soundcloud模块不存在.

It appears to have installed, as I see it in the list of modules when I used pip freeze in the Bash console. However, when I open up a Python 2.7 console and try import soundcloud, I get an error message saying that the Soundcloud module does not exist.

为什么会这样?

您已经为2.6安装了soundcloud,但是您试图在2.7中使用它.

You've installed soundcloud for 2.6, but you're trying to use it in 2.7.

来自常见问题解答:

对于Python版本2.6、2.7和3.2,我们同时包含了easy_install和pip(默认值为2.6,在末尾添加-2.7或-3.2以指定其他版本)

We've included both easy_install and pip for Python versions 2.6, 2.7 and 3.2 (the default is 2.6, add -2.7 or -3.2 at the end to specify the others)