I've just installed python 3.5, ran Python 3.5 (32-bit)
and typed
pip
and received the message:
Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> pip NameError: name 'pip' is not defined
I don't see any scripts directories in my path, but I found pip.py
in C:\Users\UserName\AppData\Local\Programs\Python\Python35-32\Scripts
.
I selected the option to "Add python to environment variables" during installation, but it doesn't seem to have done anything.
I googled this and got this guide, which says that earlier versions need to add some path names. I don't have a C:\Python...
directory so I tried adding the Scripts
folder from above, same result.
How do I install python so that it actually works (ie. I can run pip, install modules, etc.)?
Ensure you can run pip from the command lineRun python get-pip.py . 2 This will install or upgrade pip. Additionally, it will install setuptools and wheel if they're not installed already. Be cautious if you're using a Python install that's managed by your operating system or another package manager.
If PIP is installed correctly, we will see a message indicating the version of PIP and its location on the local system, like the following: pip 22.0. 2 from C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10) .
With maven or gradle you can install two versions of the same package, with pip you cant. Still you cant use two versions of the same package in the same program.
Maybe you'd like try run pip
in Python shell like this:
>>> import pip >>> pip.main(['install', 'requests'])
This will install requests
package using pip
.
Because pip
is a module in standard library, but it isn't a built-in function(or module), so you need import it.
Other way, you should run pip
in system shell(cmd. If pip
is in path).
I have a Mac, but luckily this should work the same way:
pip
is a command-line thing. You don't run it in python.
For example, on my Mac, I just say:
$pip install somelib
pretty easy!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With