Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การแก้ไขปัญหา >> ข้อผิดพลาด Windows

แก้ Error 'Command Python egg info failed with error code 1' ตอนติดตั้ง Package Python

แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python

อย่าตกใจ หากคุณเจอข้อความ Error "Command Python egg info failed with error code 1" ขณะพยายามติดตั้ง Python Package ใน Python Standard errno System Symbols Error Code 1 ถูกนิยามว่า "Operation not authorised" ปัญหานี้มักเกิดขึ้นเมื่อ Setuptools ไม่ได้ติดตั้งหรืออัปเดต ในบทความนี้ เราระบุวิธีแก้ที่ผู้ใช้ส่วนใหญ่พบว่ามีประสิทธิภาพ

แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python

วิธีแก้ Command Failed With Error Code 1 Python Egg Info

ตามรายงานผู้ใช้ ปัญหานี้เกิดบ่อยที่สุดเมื่อ Pip หรือ Setuptools เก่าหรือติดตั้งผิดปกติ อาจเจอ "pip install failed with error code 1" หาก Module ez_setup หายไปจาก PC ให้ลอง Troubleshooting Methods ด้านล่าง

วิธีที่ 1: ตรวจสอบว่า PIP และ Setuptools ทำงานถูกต้อง

ก่อนอัปเดต ให้ตรวจสอบว่า Pip และ Setuptools ติดตั้งอยู่แล้ว จะแสดงหมายเลขเวอร์ชันปัจจุบัน คุณจะทราบว่าเวอร์ชันเก่าหรือทำให้เกิด Error วิธีเช็คเวอร์ชัน Pip และ Setuptools:

  1. กด Windows key พิมพ์ cmd คลิก Run as Administrator เปิด Command Prompt
  2. คลิก Yes ใน User Account Control Prompt
  3. พิมพ์คำสั่ง pip list กด Enter เพื่อดูรายการ Package ที่ติดตั้ง

แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python

3A. หาก setuptools แสดงในรายการ Package แสดงว่าติดตั้งอยู่แล้ว
Note: ตอนนี้เช็คเวอร์ชันได้ ว่าเก่ากว่าล่าสุดหรือไม่

3B. หาก Pip และ Setuptools Versions ไม่แสดง ให้ไปวิธีถัดไปเพื่ออัปเดต

วิธีที่ 2: อัปเกรด Setuptools (Upgrade Setuptools)

หากติดตั้ง Setuptools ไว้แล้ว ลองอัปเกรดเป็นเวอร์ชันล่าสุด ทำตามขั้นตอน:

  1. เปิด Command Prompt เป็น Administrator
  2. คลิก Yes ใน User Account Control Prompt
  3. พิมพ์คำสั่ง:
    pip install –upgrade setuptools
    กด Enter
  4. จะแสดงผล successfully installed

Note: หากใช้ Terminal ให้เพิ่ม sudo นำหน้าคำสั่ง

แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python

วิธีที่ 3: อัปเกรด PIP (Upgrade PIP)

คำสั่ง Python Setup อาจมาจาก Pip คำสั่ง Python Egg Info Failed with Error Code 1 แนะนำให้อัปเกรด Pip เป็นเวอร์ชันล่าสุด หากใช้เวอร์ชันเก่า ทำตามขั้นตอน:

  1. เปิด Command Prompt เป็น Admin จาก Windows Search
  2. พิมพ์คำสั่ง:
    python -m pip install -U pip
    กด Enter

แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python

วิธีที่ 4: ติดตั้ง ez_setup

Module ez_setup ช่วยแก้ปัญหาให้หลาย User Module ที่หายไปอาจทำให้เกิด Python Egg Info Issue การติดตั้งมันแก้ปัญหาได้หลายคน ทำตามขั้นตอน:

  1. เปิด Command Prompt เป็น Administrator อีกครั้ง
  2. พิมพ์คำสั่ง:
    pip install ez_setup
    กด Enter
  3. จะแสดงข้อความ successfully installed พร้อมชื่อเวอร์ชัน

แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python

วิธีที่ 5: ติดตั้ง Python ให้ถูกต้อง (Install Python Properly)

อาจเป็นที่ Python ไม่ได้ติดตั้งบนเครื่อง รันคำสั่งต่อไปนี้เพื่อเช็คว่า Python ติดตั้งถูกต้องหรือไม่

  1. เปิด Command Prompt ด้วยสิทธิ์ Admin
  2. พิมพ์คำสั่ง python -V กด Enter

แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python

3. หากเจอ Error Message แสดงว่า Python ไม่ได้ติดตั้งบนเครื่อง

วิธีติดตั้ง Python:

  1. ดาวน์โหลด Python จากเว็บไซต์ทางการ
  2. รัน Setup file เมื่อดาวน์โหลดเสร็จ
  3. ทำตาม On-screen Instructions ติดตั้ง Python
  4. Note: อย่าลืมเช็ค Add Python 3.10 to PATH ขณะติดตั้ง

แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python แก้ Error  Command Python egg info failed with error code 1  ตอนติดตั้ง Package Python

4. รันคำสั่ง python -V อีกครั้งหลังติดตั้งเสร็จ

บทความแนะนำ:

  • แก้ Logitech Unifying Receiver Not Working in Windows 10
  • วิธีติดตั้ง Microsoft Teredo Tunneling Adapter
  • วิธีพิมพ์เครื่องหมาย Does Not Equal Sign ใน Windows 10
  • วิธีติดตั้ง NumPy บน Windows 10

หวังว่าข้อมูลนี้มีประโยชน์ และคุณสามารถแก้ปัญหา Command Failed With Error Code 1 Python Egg Info ได้ โปรดแจ้งว่าวิธีไหนช่วยได้มากที่สุด ใช้ฟอร์มด้านล่างสำหรับคำถามหรือความคิดเห็น และบอกเราว่าอยากเรียนรู้อะไรต่อไปครับ