我已经在我的 windows7 PC 中安装了 python 2.7。现在我浏览了Beautiful Soup。现在我找到了两个安装 BeautifulSoup4 的命令。easy_install beautifulsoup4
和pip install beautifulsoup4
。但我的困惑是我必须在哪个目录中运行这些命令。我的python文件夹是C:\Python27
。你能帮我在哪里运行该命令吗?
错误
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Arup Rakshit>cd..
C:\Users>cd..
C:\>cd C:\Python27
C:\Python27>python.exe virtualenv.py selenv
New python executable in selenv\Scripts\python.exe
Installing setuptools....................................done.
Installing pip.........................done.
C:\Python27>cd selenv\Scripts\
C:\Python27\selenv\Scripts>pip.exe install selenium
Downloading/unpacking selenium
Downloading selenium-2.28.0.tar.gz (2.1MB): 2.1MB downloaded
Running setup.py egg_info for package selenium
C:\Python27\Lib\distutils\dist.py:267: UserWarning: Unknown distribution opt
ion: 'src_root'
warnings.warn(msg)
warning: no files found matching 'docs\api\py\index.rst'
Installing collected packages: selenium
Running setup.py install for selenium
C:\Python27\Lib\distutils\dist.py:267: UserWarning: Unknown distribution opt
ion: 'src_root'
warnings.warn(msg)
warning: no files found matching 'docs\api\py\index.rst'
Successfully installed selenium
Cleaning up...
C:\Python27\selenv\Scripts>python.exe my_selenium_script.py
python.exe: can't open file 'my_selenium_script.py': [Errno 2] No such file or d
irectory
C:\Python27\selenv\Scripts>python.exe my_selenium_script.py
Hello
C:\Python27\selenv\Scripts>cd..
C:\Python27\selenv>pip install beautifulsoup4
'pip' is not recognized as an internal or external command,
operable program or batch file.
C:\Python27\selenv>
谢谢