feedparser模块未从spyder IDE导入

时间:2018-06-29 18:40:17

标签: pip packages python-3.6 spyder feedparser

我试图使用pydelicious APi,我试图使用以下命令从cmd安装它:

pip install pydelicious

但未成功,如cmd所述:

C:\Users\MOBASSIR>pip install pydelicious
Collecting pydelicious
  Using cached https://files.pythonhosted.org/packages/d7/42/0ef959fa6b686862b02ae343e58ce7764bbf8e7c37de1eeaa7e6418fd8d9/pydelicious-0.6.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\MOBASSIR\AppData\Local\Temp\pip-install-2xpulis3\pydelicious\setup.py", line 11, in <module>
        import pydelicious
      File "C:\Users\MOBASSIR\AppData\Local\Temp\pip-install-2xpulis3\pydelicious\pydelicious\__init__.py", line 171
        raise DeliciousItemExistsError, params['url']
                                      ^
    SyntaxError: invalid syntax

Command "python setup.py egg_info" failed with error code 1 in C:\Users\MOBASSIR\AppData\Local\Temp\pip-install-2xpulis3\pydelicious\ "

然后我从这里下载了pydelicious模块:https://gist.github.com/takashi/2967f9c5ec8ebab5f622我将该pydelicious.py文件放在我编写python代码的同一文件夹中。然后我尝试导入pydelicious,但出现错误,提示没有名为“ feedparser'..然后我再次使用此命令在cmd中安装了feedparser:“ pip install feedparser”。.有时我从cmd收到安装成功的答复。然后我再次尝试从python文件导入pydelicious,现在我得到了此错误:“

runfile('C:/Users/MOBASSIR/.spyder-py3/temp.py', wdir='C:/Users/MOBASSIR/.spyder-py3')
Traceback (most recent call last):

  File "<ipython-input-11-73d3194ff832>", line 1, in <module>
    runfile('C:/Users/MOBASSIR/.spyder-py3/temp.py', wdir='C:/Users/MOBASSIR/.spyder-py3')

  File "C:\Users\MOBASSIR\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
    execfile(filename, namespace)

  File "C:\Users\MOBASSIR\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/MOBASSIR/.spyder-py3/temp.py", line 7, in <module>
    import pydelicious

  File "C:\Users\MOBASSIR\.spyder-py3\pydelicious.py", line 100, in <module>
    import feedparser

ModuleNotFoundError: No module named 'feedparser'  "

现在,如果我在cmd中键入pip install feedparser,则会收到此消息:“已满足要求:c:\ users \ mobassir \ appdata \ local \ programs \ python \ python36-32 \ lib \ site-packages中的feedparser(5.2 .1)”

我该如何解决此问题并使用pydelicious api?我使用的是python 3.6,我下载的pydelicious模块的版本为3。

1 个答案:

答案 0 :(得分:1)

要点上的代码是 Python 3的pydelicious更新。要安装它,请先删除旧的pydelicious:

pip uninstall pydelicious

然后从raw github link复制pydelicious。

但是它仍然无法正常工作-API URL已在多年前关闭。