简体   繁体   English

如何解决Python网站套件的相依性?

[英]How do I resolve Python site-package dependency?

Installing Canto , the command line rss feed reader, I get this error, 安装Canto (命令行rss feed阅读器)时,出现此错误,

$ ./canto
Traceback (most recent call last):
  File "./canto", line 3, in <module>
    import canto.main
  File "/usr/lib/python2.7/site-packages/canto/main.py", line 36, in <module>
    import canto_fetch
  File "/usr/lib/python2.7/site-packages/canto/canto_fetch.py", line 26, in <module>
    import feedparser
**ImportError: No module named feedparser**

Feedparser 5.1 , the latest, supports Python 3.2. 最新的Feedparser 5.1支持Python 3.2。 Adding feedparser into /usr/lib/python3.2/site-packages, Canto can not find this package. 将feedparser添加到/usr/lib/python3.2/site-packages中,Canto找不到此软件包。

I have no knowledge of sorting out library dependencies if the application isn't configured to do so. 如果不配置应用程序,我不了解如何整理库依赖项。 Do I need to set a path variable for Canto to the newly installed feedparser in python3.2 or should I install an older version of Feedparser (presumably where Canto is looking in Python2.7, and where the Chardet encoding detection package is also located)? 我需要为python3.2中新安装的feedparser设置Canto的路径变量还是应该安装Feedparser的旧版本(大概是Canto在Python2.7中查找的位置以及Chardet编码检测包的位置) ?

  1. For whatever reason, the install of Canto was not correct, and you needed to uninstall it and reinstall. 无论出于何种原因,Canto的安装都不正确,因此您需要卸载它并重新安装。 (When you wrote 'Adding feedparser into /usr/lib/python3.2/site-packages' , it sounded like you might have actually copied it directly (wrong) instead of installing it per the instructions with: $ python setup.py install (当您编写“将feedparser添加到/usr/lib/python3.2/site-packages”时 ,听起来您可能实际上是直接(错误地)复制了它,而不是按照以下说明进行$ python setup.py install$ python setup.py install

  2. Anyway you redid 1. (delete and reinstall), restart python and import feedparser , so that fixed it. 无论如何,您都要重做1.(删除并重新安装),重新启动python并import feedparser ,以便对其进行修复。 (I was skeptical of your theory that the install was correct but wrong version, since you got ImportError: No module named feedparser , instead of some other import-time error indicating feedparser was present, but the wrong version) (我对您的理论认为安装正确但版本错误表示怀疑,因为您收到ImportError: No module named feedparser ,而不是其他一些表示feedparser存在的导入时错误,但版本错误)

Which version of python are you using to run it? 您正在使用哪个版本的python运行它? That's what you need to fix. 这就是您需要解决的问题。 You don't want to have either version of python looking anywhere in the other's package path. 您不想让任何一个版本的python在另一个程序包的路径中的任何地方查找。

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

相关问题 如何在python中终止msgbox? (使用python easygui站点包/模块) - How do I terminate a msgbox in python? (using python easygui site-package/module) 如何从conda的site-package目录中添加一个Python模块进行Spark-Submit? - How do I add a Python module from inside conda's site-package directory to spark-submit? 如何在MAC上将Orange导入Python站点包 - How to Import Orange into Python Site-Package on a MAC 如何将 Python 站点包文件夹(未包含在内)添加到 PyInstaller 规范文件? - How can I add a Python site-package folder (that's not being included) to a PyInstaller spec file? 未找到 Python 站点包模块 - Python site-package module not found 如何从rJython导入站点包? - How to import a site-package from rJython? 如何在 /opt/conda/anaconda/lib/python3.7/site-package 中更新 package - How to update a package in /opt/conda/anaconda/lib/python3.7/site-package 如何卸载使用“python setup.py develop”安装的 Python 站点包? - How to uninstall Python site-package which was installed using "python setup.py develop"? 如何在Python 2.6中使用带有pth文件的自定义站点包? - How to use a custom site-package using pth-files for Python 2.6? 在用户站点包中安装 - Install in user site-package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM