Python 初步

pdb

  • pdb — The Python Debugger

  • PyCharm

  • 在 jetbrains 官网下载,社区版就可以起步。

pip in Windows

  • 为了各版本兼容问题,python 在 Windows安装后,一般默认可用命令为 py,而非 python。
  • pip默认随附安装,通过 py -m pip --version 查看是否安装。
    Verification: You can check if pip is installed by running python -m pip --version or py -m pip --version in the command prompt.
    If pip is not found, you will receive an error message.
pip 25.2 from C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip (python 3.13)
  • pip 加入到 "环境变量" 中
    Verification: You can check your PATH environment variables by searching for "Environment Variables" in the Windows search bar and then clicking on "Edit the system environment variables." In the System Properties window, click "Environment Variables," and then under "System variables," find the "Path" variable and click "Edit." Ensure the Scripts directory of your Python installation is listed.
  • 如果不想把 pip 路径加到环境变量中,可以通过 py -m 直接显式调用 pip:
    Use python -m pip: As a workaround, you can always execute pip by explicitly calling the Python interpreter, for example: python -m pip install <package_name>. This bypasses the need for pip to be directly in the PATH.

pip 安装 Selenium 库

  1. 打开命令行:以管理员身份运行 Windows PowerShell。(普通的cmd权限不够)
  2. 执行命令 pip install selenium 下载并安装Selenium 库。
  3. 安装 webdriver-manager:pip install webdriver-manager

python version

In your Python interpreter, type the following commands:
>>> import os, sys
>>> os.path.dirname(sys.executable)
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python313'
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容