1. 找不到文件

Traceback (most recent call last):
File "D:\Python\Python36-32\lib\site-packages\selenium-3.4.3-py3.6.egg\selenium\webdriver\common\service.py", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "D:\Python\Python36-32\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "D:\Python\Python36-32\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

解决方法:
在lib文件夹中找到subprocess.py

  • 搜索class Popen(object):
  • 将__init__中的shell=False修改为shell=True

2. error: Unable to find a compatible Visual Studio installation.

关于cpp_extension的那些BUG_python
装适配版的vs, 我用的vs2015

3. UserWarning: Error checking compiler version for cl: ‘utf-8’ codec can’t decode byte 0xd3 in position 0: invalid continuation byte

cpp_extension.py,把默认的空编码utf8编码改成’ gbk’

compiler_info.decode(’ gbk’).strip()

4. cpp_extension.py:189: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。 warnings.warn(‘Error checking compiler version for {}: {}’.format(compiler, error))

就把,cl.exe所在目录加到环境变量里面

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64

5. subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.

将anaconda环境下的 lib/python3.5/dist-packages/torch/utils/cpp_extension.py文件​​在这里插入代码片​

将[‘ninja’,’-v’]改成[‘ninja’,’–v’] 或者[‘ninja’,’–version’]