How do I use pip install? - python

When I look up tutorials on Python almost every one starts with "Start of with pip install bs4" but they never tell me about how. Because when I write "pip install bs4" in my cmd the answer I get is only
'pip' is not recognized as an internal or external command,
operable program or batch file.
I've tried running "pip install bs4" in PyCharm as well but nothing works.
I am a totally a beginner, which you probably already noticed, and just want to get beautifulsoup.

I'm going to assume you're on Windows since your error message contains "batch file". Try:
py -m pip install bs4
The -m flag will import the pip module, and allow you to run the install command. If running py doesn't work, try the absolute path to your python.exe.

This is the official site that shows you how to download and install python pip
pretty much just download the file, open up the command prompt, cd to file directory and run it with:
python get-pip.py

Related

How to create an executable with a pycharm python file though pyinstaller?

I have been trying to install pyinstaller in order to create an executable of a python project I have been working on, but my pip command simply doesn't work. This is the error I would get "'pip' is not recognized as an internal or external command, operable program or batch file". I have already checked the interpreter of my pycharm project, and it shows that it has pip already installed. I tried to look this up online, and I found out that a problem could be that the environment variable Path just needs to have the directory of my python version, but even after doing this, it still would not work. For additional information, I already tried to find the directory by using the command "where python" in the command prompt, but that path didn't work, and I'm using windows 10.
Usually for most of users, there would be a problem as you mention above. In such situation, you just need to install pip again with command like
python -m pip3 install -U pip
and remember next time, if pip reminds you to upgrade it, do not just use
pip install -U pip

Unable to do pip install pandas-profiling

I've tried severally to install Pandas-Profiling on my windows 10 cmd using "pip install pandas-profiling" but it doesn't work. I've also tried installing it on conda but its the same story. I need help installing this please.
I also had the same problem. It didn't work with a normal pip install. I fixed it by running the following command in anaconda prompt:
conda install -c anaconda pandas-profiling
You can find the full documentation here.
Hope it helps :)
if you don't provide the error message, we can't help you.
If you have the following error message:
'pip' is not recognized as an internal or external command,
operable program or batch file.
It means that Python is not added to your Path environment variable. How to fix it:
First solution: Adding Python to the Path by going in your environment variables, in System Variables click on Path then Edit, and in the grid, add your Python's path (which may be C:\Users\<user>\AppData\Local\Programs\Python\Python<version>\). You can also add Python yo the Path by uninstall it and install it again and in the installer, make sure you check "Add Python to PATH"
Second solution: You can run pip by putting python3 -m before you pip command, like that: python3 -m pip install pandas-profiling.
I have been able to find a solution to the error message. I had to install the Microsoft C++ Build Tools, then I launched it and did the installation through it using ‘pip install pandas-profiling’ you can download using the link https://visualstudio.microsoft.com/visual-cpp-build-tools/
For me it only works also if putting "py"
so:
py -m pip install pandas-profiling
In the command prompt.

how to set pip environment path?

I ran:
python -m pip --version
And it returned:
pip 8.1.2 from C:\Users\myonl\AppData\Local\Programs\Python\Python35-32\lib\site-packages (python 3.5)
So I set my path to the above, but when I try to actually use pip I get:
pip install PyQt4
'pip' is not recognised as an internal or external command, operable program or batch file.
What am I doing wrong?
The first time you do python -m pip, the second time you do pip.
pip is not on your PATH, but python is. You can fix that, or you can call it using python -m pip.
Also possible is that you simply need to refresh your console window so it picks up the change you've made to PATH. Try closing your terminal and re-opening it and seeing if you have the same problem.

PYTHON - pyperclip installing issue

I'm following a course on Udemy: Automate the Boring Stuff using Python. For one of the courses the guide asks me to install Pyperclip. Now I've tried this, but cmd keeps returning: " 'pip' is not recognized as an internal or external command, operable or batch file
The path I use is "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\Scripts\pip.exe", I've tried it without the pip.exe, but then it also returns an error.
Fixed it, I tried out "C:\Users\Scott\AppData\Local\Programs\Python\Python36-32\Scripts\pip.exe install pyperclip", and it worked.
Python3 has pip embedded, so you can use python3 directly to install it:
python3 -m pip install <package>

Installing PIP on Windows 10 python 3.5

I just started learning Python, and successfully downloaded Python 3.5. I attempted to download/upgrade PIP 8.1.2 multiple times using get-pip.py, which I ran (successfully I think) but when I attempted to execute python get-pip.py
I got the error code:
File "<stdin>", line 1
python get-pip.py
^
SyntaxError: invalid syntax
I understand that pip is included in python but the pip website requires users to upgrade pip which I don't think I can since any pip commands lead to syntax errors, and do not produce the same output that most tutorial sites show. I have tried to find different ways to fix it, but I can't figure out whats wrong aside from pip not being on the computer in the first place or corrupted. Thank you for your assistance.
You won't need to upgrade pip if you just downloaded python 3.5, go to where you have your Python3.5 file and open the folder Scripts, you will find pip.exe. Open powershell and use the cd command to move to the folder containing pip.exe. From here you can use pip install to get modules.
Open Windows Powershell
PS C:Users\you> cd C:\path\to\scripts\folder\containing\pip
PS C:\path\to\scripts\folder\containing\pip> pip install module
Not sure what you are asking. If you want to run python get-pip.py do it in a windows command prompt, not in the python interpreter. But I do not know why you would want to do that.
You already have pip; there is no need to run get-pip. Upgrading can be done by pip itself.
But the reason you are getting errors is that all these commands, including pip itself, should be run at the command line, not in the Python interpreter.

Categories

Resources