簡體   English   中英

python pip安裝失敗

[英]python pip install fails

我正在嘗試使用pip安裝pyautogui,但每次嘗試都會失敗。

Collecting pyautogui
  Using cached PyAutoGUI-0.9.36.tar.gz
[31mException:
Traceback (most recent call last):
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\commands\install.py", line 335, in run
    wb.build(autobuilding=True)
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
  File "C:\Users\Lewis\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
AttributeError: 'NoneType' object has no attribute 'encoding'[0m
>>> 

我用來開始下載的代碼是

import pip
pip.main(['install', "pyautogui"])

pip旨在作為命令從命令行運行。

打開一個終端,然后運行:

pip install pyautogui

如果您使用的是Linux,只需打開一個終端即可。 如果您使用的是Windows,請按Windows + Q並搜索cmd ,或右鍵單擊開始菜單並查找“ Open a terminal或類似的內容。

您可能需要以提升的特權運行命令(在Linux上為sudo ,在Windows上為Open a terminal (admin) )。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM