- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我需要在我的代码中使用 urllib 模块,我这样导入它:
import urllib.request
import urllib.error
但 PythonAnywhere 返回以下错误:
> 没有名为 request 的模块
当我尝试时,看起来 urllib 库已成功导入:
python3 myscript.py
代替:
python myscript.py
但在这种情况下我得到另一个错误:
> 没有名为“pyvirtualdisplay”的模块
Pyvirtualdisplay 在我的代码中也需要,所以我不知道该怎么做。有人可以帮忙吗?
最佳答案
The urllib2 module has been split across several modules in Python 3 named urllib.request and urllib.error ~ urllib2 - python docs
当你运行你的脚本时使用
python myscript.py
您的系统使用的是 python2,它没有 urllib.request
和 urllib.error
模块。使用 urllib2
库。
关于python - 没有名为请求 PythonAnywhere 错误的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33551425/
我正在关注 Djangogirls 教程,根据该教程,我在 Django 管理员的博客中添加了新帖子。我使用 Django 模板创建了一个模板来显示此动态数据。我通过在浏览器中打开 127.0.0.1
安装模块时遵循。尝试安装其他模块时收到类似消息。 非常感谢您的帮助。谢谢! [Errno 13]权限被拒绝:'/usr/local/lib/python2.7/dist-p 您指定的安装目录(通过 -
问题是什么? 我在 Pythonanywhere.com 上运行 This error can be due to the fact that ImageMagick is not installed
我有一个初学者 PythonAnywhere 帐户,帐户比较页面指出,该帐户具有“访问外部 Internet 站点:仅通过 HTTP(S) 访问特定站点”的功能。 所以我知道只有某些主机可以通过 HT
我正在尝试在 PythonAnywhere 上上传我的网络应用程序,但我无法做到这一点。我尝试了很多方法并在谷歌上进行了搜索,但我无法解决它。请告诉我我缺少什么或我应该在此处添加哪些信息。我还添加了来
我有一个 python 脚本,当我转到文件并点击运行时,它可以正常运行。但是,当调度程序运行脚本时,该脚本会失败。可能是什么原因造成的? 这是我的脚本: import time import os i
我正在使用 Flask Mega Tutorial 在 pythonanywhere 中构建应用程序当我在我的电脑上运行时它工作正常。当我将其上传到 PA 时出现 404 错误。 我的结构 /micr
当我在 PythonAnywhere 查看计划任务的日志时,我发现它们充满了如下语句: 2012-06-07 11:09:16 -- 完成任务,耗时 11.00 秒,返回代码为 0。 2012-06-
我是 Pythonanywhere 的新手,想安装“soundcloud”Python 模块。我打开了 Bash 控制台并输入了 pip install --user soundcloud 命令。 它
我正在尝试在 PythonAnywhere 上部署我的应用程序。一切正常,但是当我调用一个函数时,我的应用程序失败了。 异常类型:JSONDecodeError 异常值:期望值:第 1 行第 1 列(
我想将 django Web 应用程序托管到 pythonanywhere。我在 godaddy 有一个域名。我按照此 link 中的说明进行操作。在godaddy的DNS管理页面下,我设置CNAME
我在 Flask 应用程序中使用 rauth 库。错误日志显示错误 ImportError: No module named rauth. 如何处理这个问题。 最佳答案 根据documentation
我按照教程创建了一个简单的数据库支持的 Flask 网站。 Here 我成功地遵循了本教程,但我正在努力使用这种方法创建多个表。我希望该表被称为“成分”。这是我的 Flask_app.py 代码 fr
我是 pythonanywhere 的新手,目前正在使用它和 bottle 框架部署我的第一个应用程序。我已经使用在线控制台创建了一个数据库,但我不知道访问它的语法。它与在本地部署时的语法相同吗?或者
所以我想在 pythonanywhere 上部署我的网站。我创建了 virtualenv,安装了 Django 和我的网站所需的所有应用程序。我创建了新应用程序并将其与我从 GitHub 克隆的项目连
此代码是在 pythonanywhere (linux) 上托管的 python 3.5。 我正在使用 with open 来管理一个非阻塞的 flock,但有时调度的进程会遇到异常,导致作业终止;没
我是 pythonanywhere 的新手。我想知道如何从本地 csv 文件(其中有很多,超过 1,000 个)将数据加载到 mysql 表中。假设 csv 文件的文件夹路径是 d:/data。怎么写
我对 Pythonanywhere 完全陌生,我不知道为什么静态文件没有加载...这是我存储 css 和图像的路径,即 static/images/wikiLang.png 等 /static/adm
我想提交一个有文件字段的表单,在开发模式下我可以成功提交,但是当涉及到 pythonanywhere 时,我被重定向到我的自定义失败页面,这意味着表单没有通过。 表单在没有附件时被保存,它在 deve
使用 Python 2.7 和 Django 1.10.4,我尝试将我的应用程序部署到 pythonanywhere,但我不断收到此错误。 错误日志 wsgi.py import os import
我是一名优秀的程序员,十分优秀!