Pythonanywhere安装并导入新模块 [英] Pythonanywhere install and import new module

查看:188
本文介绍了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)

这篇关于Pythonanywhere安装并导入新模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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