Windows8下安装Python的BeautifulSoup,windows8python

发布时间:2019-11-04  栏目:28111.com新葡京  评论:0 Comments

  Running setup.py bdist_wheel for Twisted … error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\commands\install.py”,
lin
e 385, in run
requirement_set.cleanup_files()
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_set.py”,
line 729
, in cleanup_files
req.remove_temporary_source()
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_install.py”,
line
977, in remove_temporary_source
rmtree(self.source_dir)
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\retrying.py”,
lin
e 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\retrying.py”,
lin
e 212, in call
raise attempt.get()
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\retrying.py”,
lin
e 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\six.py”,
line 686
, in reraise
raise value
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\retrying.py”,
lin
e 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\utils__init__.py”,
line
102, in rmtree
onerror=rmtree_errorhandler)
File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 488, in rmtree
return rmtree_unsafe(path, onerror)
File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 387, in
_rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\utils\
_init__.py”,
line
114, in rmtree_errorhandler
func
PermissionError: [WinError 32]
另二个主次正在利用此文件,进度无法访问。: ‘C:\Us
ers\Aaron\AppData\Local\Temp\pip-build-v6n4yggt\pymongo’

Windows8下安装Python的BeautifulSoup,windows8python

运营条件:Windows 8.1
Python:2.7.6

在设置的时候,笔者使用的pip来实行设置,命令如下:

复制代码 代码如下:

pip install beautifulsoup4

运作的时候,报错如下:

复制代码 代码如下:

Exception:
Traceback (most recent call last):
  File “J:\Program Files
(x86)\Python\Python27\lib\site-packages\pip\basecomm
.py”, line 122, in main
    status = self.run(options, args)
  File “J:\Program Files
(x86)\Python\Python27\lib\site-packages\pip\commands
stall.py”, line 278, in run
    requirement_set.prepare_files(finder,
force_root_egg_info=self.bundle, bu
e=self.bundle)
  File “J:\Program Files
(x86)\Python\Python27\lib\site-packages\pip\req.py”,
ne 1229, in prepare_files
    req_to_install.run_egg_info()
  File “J:\Program Files
(x86)\Python\Python27\lib\site-packages\pip\req.py”,
ne 292, in run_egg_info
    logger.notify(‘Running setup.py (path:%s) egg_info for package %s’
% (sel
etup_py, self.name))
  File “J:\Program Files
(x86)\Python\Python27\lib\site-packages\pip\req.py”,
ne 265, in setup_py
    import setuptools
  File “build\bdist.win-amd64\egg\setuptools\__init__.py”, line
11, in <modul
    from setuptools.extension import Extension
  File “build\bdist.win-amd64\egg\setuptools\extension.py”, line 5,
in <modul
  File “build\bdist.win-amd64\egg\setuptools\dist.py”, line 15, in
<module>
  File “build\bdist.win-amd64\egg\setuptools\compat.py”, line 19, in
<module>
  File “J:\Program Files
(x86)\Python\Python27\lib\SimpleHTTPServer.py”, line
, in <module>
    class
SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
  File “J:\Program Files
(x86)\Python\Python27\lib\SimpleHTTPServer.py”, line
8, in SimpleHTTPRequestHandler
    mimetypes.init() # try to read system mime.types
  File “J:\Program Files (x86)\Python\Python27\lib\mimetypes.py”,
line 358, i
nit
    db.read_windows_registry()
  File “J:\Program Files (x86)\Python\Python27\lib\mimetypes.py”,
line 258, i
ead_windows_registry
    for subkeyname in enum_types(hkcr):
  File “J:\Program Files (x86)\Python\Python27\lib\mimetypes.py”,
line 249, i
num_types
    ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb0 in position 1:
ordin
not in range(128)

Storing debug log for failure in
C:\Users\Administrator\pip\pip.log

解决措施:张开C:\Python27\Lib下的 mimetypes.py
文件,找到大约256行的

复制代码 代码如下:

default_encoding = sys.getdefaultencoding()

改成:

复制代码 代码如下:

if sys.getdefaultencoding() != ‘gbk’:
    reload(sys)
    sys.setdefaultencoding(‘gbk’)
default_encoding = sys.getdefaultencoding()

安装成功后,验证是不是安装成功:

复制代码 代码如下:

C:\Users\Administrator>python
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit
(AMD64)] on 32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from bs4 import BeautifulSoup
>>> exit()

只要“from bs4 import
BeautifulSoup”未有报错的话,则表明安装成功,不然,将报相像错误如下:

复制代码 代码如下:

Traceback (most recent call last):
  File “<stdin>”, line 1, in <module>
ImportError: No module named bs4

运行条件:Windows 8.1 Python:2.7.6
在装置的时候,我利用的pip来开展设置,命令如下: 复制代码 代…

 28111.com新葡京 1

用pip下载gensim现身exception 求大佬们辅导!!! 5C
Collecting gensim
Using cached gensim-3.1.0.tar.gz
Exception:
Traceback (most recent call last):
File “c:\program
files\python37\lib\site-packages\pip\compat__init__.py”, line
73, in console_to_str
return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb9 in position 14:
invalid start byte

Traceback (most recent call last):
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\basecommand.py”,
line 215
, in main
status = self.run(options, args)
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\commands\install.py”,
lin
e 385, in run
requirement_set.cleanup_files()
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\utils\build.py”,
line 38,
in exit
self.cleanup()
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\utils\build.py”,
line 42,
in cleanup
rmtree(self.name)
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\retrying.py”,
lin
e 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\retrying.py”,
lin
e 212, in call
28111.com新葡京,raise attempt.get()
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\retrying.py”,
lin
e 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\six.py”,
line 686
, in reraise
raise value
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip_vendor\retrying.py”,
lin
e 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\utils__init__.py”,
line
102, in rmtree
onerror=rmtree_errorhandler)
File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 488, in rmtree
return rmtree_unsafe(path, onerror)
File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 378, in
_rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 387, in
_rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\utils\
_init__.py”,
line
114, in rmtree_errorhandler
func
PermissionError: [WinError 32]
另四个前后相继正在利用此文件,进度不恐怕访谈。: ‘C:\Us
ers\Aaron\AppData\Local\Temp\pip-build-v6n4yggt\pymongo’

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb6 in position 30:
invalid start byte

Traceback (most recent call last):
File “c:\program
files\python37\lib\site-packages\pip\basecommand.py”, line 215, in
main
status = self.run(options, args)
File “c:\program
files\python37\lib\site-packages\pip\commands\install.py”, line
324, in run
requirement_set.prepare_files
File “c:\program
files\python37\lib\site-packages\pip\req\req_set.py”, line 380,
in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “c:\program
files\python37\lib\site-packages\pip\req\req_set.py”, line 634,
in prepare_file
abstract_dist.prep_for_dist()
File “c:\program
files\python37\lib\site-packages\pip\req\req_set.py”, line 129,
in prep_for_dist
self.req_to_install.run_egg_info()
File “c:\program
files\python37\lib\site-packages\pip\req\req_install.py”, line
439, in run_egg_info
command_desc=’python setup.py egg_info’)
File “c:\program
files\python37\lib\site-packages\pip\utils\
_init__.py”, line
676, in call_subprocess
line = console_to_str(proc.stdout.readline
File “c:\program
files\python37\lib\site-packages\pip\compat__init__.py”, line
75, in console_to_str
return s.decode
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb9 in position 14:
invalid start byte

pip install pymongo 总是报错
报错代码如下:
C:\Windows\system32>pip install pymongo
Collecting pymongo
Using cached pymongo-3.4.0.tar.gz
Building wheels for collected packages: pymongo
Running setup.py bdist_wheel for pymongo … error
Failed building wheel for pymongo
Running setup.py clean for pymongo
Failed cleaning build dir for pymongo
Failed to build pymongo
Installing collected packages: pymongo
Running setup.py install for pymongo … error
Exception:
Traceback (most recent call last):
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\compat__init__.py”,
line
73, in console_to_str
return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa1 in position 42:
invalid
start byte

    line = console_to_str(proc.stdout.readline())

有未有大佬告诉一下是哪个地方出了难题???

Traceback (most recent call last):
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\commands\install.py”,
lin
e 342, in run
prefix=options.prefix_path,
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_set.py”,
line 784
, in install
**kwargs
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_install.py”,
line
878, in install
spinner=spinner,
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\utils__init__.py”,
line
676, in call_subprocess
line = console_to_str(proc.stdout.readline
File
“C:\ProgramData\Anaconda3\lib\site-packages\pip\compat__init__.py”,
line
75, in console_to_str
return s.decode
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa1 in position 42:
invalid
start byte

  File
“e:\python\envs\py2scripy\lib\site-packages\pip\commands\install.py”,
line 342, in run

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

During handling of the above exception, another exception occurred:

    prefix=options.prefix_path,

During handling of the above exception, another exception occurred:

 

Exception:

留下评论

网站地图xml地图