python--windows下安裝BeautifulSoup

python有不少內置的模塊能夠不安裝使用,用起來很是方便,可是也有一些挺有用的非內置的模塊不能直接使用,須要話費點力氣手動安裝。python

進入python安裝目錄下的Scripts目錄,查看是否有pip工具爲了不出現一些未知錯誤,DOS窗口使用管理員權限打開。python2.7

    

使用pip工具安裝,在python安裝目錄下的Scripts目錄下執行以下命令。ide

pip install beautifulsoup4

    

可能會出現如下錯誤:工具

    

若是沒有使用管理員權限則會出現更多的錯誤信息。ui

錯誤信息spa

Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Exception:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python27\python2.7.11\lib\site-packages\pip\basecommand.py", line 211
, in main
status = self.run(options, args)
File "C:\Program Files (x86)\Python27\python2.7.11\lib\site-packages\pip\commands\install.py", lin
e 311, in run
root=options.root_path,
File "C:\Program Files (x86)\Python27\python2.7.11\lib\site-packages\pip\req\req_set.py", line 640
, in install
requirement.uninstall(auto_confirm=True)
File "C:\Program Files (x86)\Python27\python2.7.11\lib\site-packages\pip\req\req_install.py", line
716, in uninstall
paths_to_remove.remove(auto_confirm)
File "C:\Program Files (x86)\Python27\python2.7.11\lib\site-packages\pip\req\req_uninstall.py", li
ne 125, in remove
renames(path, new_path)
File "C:\Program Files (x86)\Python27\python2.7.11\lib\site-packages\pip\utils\__init__.py", line
315, in renames
shutil.move(old, new)
File "C:\Program Files (x86)\Python27\python2.7.11\lib\shutil.py", line 303, in move
os.unlink(src)
WindowsError: [Error 5] : 'c:\\program files (x86)\\python27\\python2.7.11\\lib\\site-packages\\pip-
7.1.2.dist-info\\description.rst'
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.3d

解決方法:升級pip工具(注意:此條命令要在擁有管理員權限的DOS窗口下執行code

python -m pip install -U pip

    

相關文章
相關標籤/搜索