程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Error when using pip to install python library

編輯:Python

Error:
Suggestion [3,General]: Command pip not found, but it does exist at the current location.By default, Windows PowerShell does not load commands from the current location.If you trust this command, type ".\pip" instead.See "get-help about_Command_Precedence" for more information.

Solution 1:
Change the original command: pip install lxml
to: .\pip install lxml

Solution 2: Configure environment variables
The above error can be solved by configuring environment variables for python.
windows10 system, Python environment configuration method:
Step 1: Find "My Computer" (or "This Computer"/"Computer"), right-click → Properties → Click Advanced System Settings, and pop up [System Properties]window.

Step 2: Click [Environment Variables] to enterGo to the [Environment Variables] configuration window.

Step 3: Find [System Variables], select[Path] variable, click [Edit], enter the [Edit environment variable] window, add the file path where python is installed, and click [OK].

Note: The file path here refers to your ownThe python installation path, the above path is the installation path of my computer python.
After configuring the python environment variables, you can directly use the pip installation command
pip install lxml (.\pip install lxml )

Note: After configuring the environment variables, it still reports an error. If you use pip in cmd,You need to reopen cmd; if you use pip in pycharm, you can restart pycharm.

—end—


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved