由于过时的beautifulsoup,无法使用Pip进行安装

时间:2019-10-23 20:30:15

标签: python beautifulsoup pip anaconda

我正在将Anaconda与Python 3配合使用,并尝试安装cc软件包,这是uber h3软件包的要求。

当尝试通过以下方式在anaconda命令行中安装时:

pip install cc

我收到一个错误,因为我在Python 3上使用了过时的beautifulsoup版本,应该改用beautifulsoup4。已安装Bs4 IS,但似乎要求文件直接出现在pip中,选择BeautifulSoup 3.2.1。

我该如何覆盖?

以下是我得到的错误:

Collecting cc
  Using cached https://files.pythonhosted.org/packages/2f/c0/813dd3de3cda756a7ffc17b50779da0c1ea5de74c9df5e1da2856735c940/cc-0.1.tar.gz
Requirement already satisfied: requests>=2.2.1 in c:\programdata\anaconda3\lib\site-packages (from cc) (2.22.0)
Collecting BeautifulSoup>=3.2.1
  Using cached https://files.pythonhosted.org/packages/40/f2/6c9f2f3e696ee6a1fb0e4d7850617e224ed2b0b1e872110abffeca2a09d4/BeautifulSoup-3.2.2.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\wintch3\\AppData\\Local\\Temp\\pip-install-qgjizksk\\BeautifulSoup\\setup.py'"'"'; __file__='"'"'C:\\Users\\wintch3\\AppData\\Local\\Temp\\pip-install-qgjizksk\\BeautifulSoup\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\wintch3\AppData\Local\Temp\pip-install-qgjizksk\BeautifulSoup\pip-egg-info'
         cwd: C:\Users\wintch3\AppData\Local\Temp\pip-install-qgjizksk\BeautifulSoup\
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\wintch3\AppData\Local\Temp\pip-install-qgjizksk\BeautifulSoup\setup.py", line 3
        "You're trying to run a very old release of Beautiful Soup under Python 3. This will not work."<>"Please use Beautiful Soup 4, available through the pip package 'beautifulsoup4'."
                                                                                                        ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

感谢所有帮助!

1 个答案:

答案 0 :(得分:1)

让我们看看:https://pypi.org/project/cc/#history。唯一的版本是2016年发布的0.1。它是requires BeautifulSoup(不是BeautifulSoup4)。

我非常怀疑这是Uber所需的软件包。 h3确实提到了cc,但它不是Python包,而是C编译器!您必须拥有gcc或任何其他C编译器,而不是PyPI中过时的cc