我正在尝试使this github程序包正常工作。我安装了python 3.9,pip 20.2.3和git 2.28.0.windows.1(所有最新版本)。 当我尝试使用git bash中的以下代码下载软件包时,它会显示错误。
命令:
pip install git+https://github.com/hartleybrody/public-amazon-crawler.git
错误:
Collecting git+https://github.com/hartleybrody/public-amazon-crawler.git
Cloning https://github.com/hartleybrody/public-amazon-crawler.git to c:\users\chris\appdata\local\temp\pip-req-build-ji37p4r1
ERROR: Command errored out with exit status 1:
command: 'c:\users\chris\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Chris\\AppData\\Local\\Temp\\pip-req-build-ji37p4r1\\setup.py'"'"'; __file__='"'"'C:\\Users\\Chris\\AppData\\Local\\Temp\\pip-req-build-ji37p4r1\\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\Chris\AppData\Local\Temp\pip-pip-egg-info-pvkyer2s'
cwd: C:\Users\Chris\AppData\Local\Temp\pip-req-build-ji37p4r1\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\chris\appdata\local\programs\python\python39\lib\tokenize.py", line 392, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Chris\\AppData\\Local\\Temp\\pip-req-build-ji37p4r1\\setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我还尝试仅下载.zip并手动对其进行解压缩,但是在尝试在Requirements.txt中安装依赖项时失败了。
命令:
pip install -r requirements.txt
错误:
Collecting BeautifulSoup==3.2.1
Using cached BeautifulSoup-3.2.1.tar.gz (31 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\chris\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Chris\\AppData\\Local\\Temp\\pip-install-kt7dwwof\\beautifulsoup\\setup.py'"'"'; __file__='"'"'C:\\Users\\Chris\\AppData\\Local\\Temp\\pip-install-kt7dwwof\\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\Chris\AppData\Local\Temp\pip-pip-egg-info-s9pbmuar'
cwd: C:\Users\Chris\AppData\Local\Temp\pip-install-kt7dwwof\beautifulsoup\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Chris\AppData\Local\Temp\pip-install-kt7dwwof\beautifulsoup\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Unit tests have failed!")?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我现在的问题是:“我如何使其工作?”。爬虫只是被破坏还是过时,还是我需要使用除git bash之外的其他东西,或者这是我的简单疏忽?
答案 0 :(得分:0)
第一个错误-存储库没有setup.py
,因此无法pip
可安装。
第二个错误-requirements.txt
列出了BeautifulSoup
而不是BeautifulSoup4
,因此它仅适用于Python2。