简体   繁体   English

Python PIP 适合初学者(添加路径)

[英]Python PIP for absolute beginner (add Paths)

I am NOT a coder.我不是编码员。 I was trying to follow an online video when I stumbled on the PIP command for python.当我偶然发现 python 的 PIP 命令时,我正试图关注在线视频。 I have Python 3.9.我有 Python 3.9。

In the command prompt, if I type in PIP..I get在命令提示符下,如果我输入 PIP..我得到

'pip' is not recognized as an internal or external command, operable program or batch file. 'pip' 不是内部或外部命令、可运行程序或批处理文件。

Because I TRY to RTFM, another suggestion mentions using python as a command因为我尝试使用 RTFM,另一个建议提到使用 python 作为命令

C:\Users\TL>python get-pip.py C:\Users\TL>python get-pip.py

Python was not found;未找到 Python; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.在没有 arguments 的情况下运行以从 Microsoft Store 安装,或从“设置”>“管理应用程序执行别名”禁用此快捷方式。

Now I feel stuck.现在我感觉卡住了。 I am just trying write basic python code on a Windows 10 computer.我只是想在 Windows 10 计算机上编写基本的 python 代码。 Any assistance is greatly appreciated.非常感谢任何帮助。

UPDATE: Upon futher review, this question is partially answered.更新:经过进一步审查,这个问题得到了部分回答。

How do I add these paths to bee seen???如何添加这些路径让蜜蜂看到???

C:\Users\TL\AppData\Local\Programs\Python\Python39 C:\Users\TL\AppData\Local\Programs\Python\Python39\Scripts C:\Users\TL\AppData\Local\Programs\Python\Python39 C:\Users\TL\AppData\Local\Programs\Python\Python39\Scripts

By now, I have seen it mentioned a few time with no real explanation of where this is added.到目前为止,我已经看到它提到过几次,但没有真正解释它是在哪里添加的。

ADENDUM: I followed the instruction from the link below.附录:我按照下面链接中的说明进行操作。 The paths were added.添加了路径。 PIP "Shows" as installed successfully. PIP“显示”安装成功。 but the PIP command does not work.但 PIP 命令不起作用。 See picture见图片

路径和 CMD 的屏幕截图

Python 3.4+ comes with pip: you don't need get-pip.py Python 3.4+ 附带 pip:你不需要 get-pip.py

Generally speaking, unless you've activated a virtualenv (which you haven't), you should prefer to always use python -m pip as you then have full control about which Python you're installing packages into.一般来说,除非你已经激活了一个 virtualenv(你还没有),你应该更喜欢总是使用python -m pip因为你可以完全控制你安装包到哪个 ZA7F5F35426B927411FC9231B56382173。 This is more commonly a problem when you have more than one Python installed当您安装了多个 Python 时,这通常是一个问题

So, you want to use所以,你想使用

python -m pip --version

I did not fully understand your problem, but I am assuming that you are using CMD.我没有完全理解您的问题,但我假设您使用的是 CMD。 Check if you added Python to the windows path.检查您是否将 Python 添加到 windows 路径。 you can follow the steps in this link https://datatofish.com/add-python-to-windows-path/您可以按照此链接中的步骤https://datatofish.com/add-python-to-windows-path/

It's probably more user-friendly to use a terminal window than a command prompt like Jupyter as an alternative.使用终端 window 可能比使用 Jupyter 之类的命令提示符作为替代方案更加用户友好。

However, if you're looking to use Python using your Windows command prompt then you can type in Python3.9 , python or python3 .但是,如果您希望使用 Windows 命令提示符来使用 Python,那么您可以输入Python3.9pythonpython3 Then, use the pip command to install any Python dependencies and libraries.然后,使用pip命令安装任何 Python 依赖项和库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM