How to run pip from python3.7.1 - python-3.x

I'm having python3.7.1 installed on my Mac, but when I run the command pip --version it shows syntax error. It's said that for python3 and greater versions pip is pre-installed, but why still I'm not able to use pip from python3?

pip might be outdated, check for updates running this command on terminal in your Mac:
pip install -U pip
Also doble check the version you have by running:
python --version
if you get
“Python is not defined”
you will need to reinstall it.
Further reading: Installing Python Modules

Related

Pip Not recognized as an external command in cmd in windows

When I am trying to install the Python 3.7.1 It installed the Python 3.7.1. I can also check the pip install checkbox. Later I am trying to install pip in cmd. The below error occurs. When I try to see the pip.exe file in Python37/Scripts it shows an empty folder. I don't know what to do and what is the issue. Please help me because it was my study project to do.
Your pip is not setup during installation, you can re-run the python installer and make sure to check the option to install pip or simply access pip using:
python3 -m pip
All commands are the same,so you can install packages like:
python3 -m pip install cython
Hope this works for you!

How to install xlrd in python3 library

I am trying to install xlrd to read Excel files in python.
I have tried this: pip install -U pip setuptools. My macOS Mojave 10.4.3 has Python 2.7 which is where the default install goes to. But I have also installed Python3.7. How do I get pip install to my 3.7 directory?
I am on Mac machine(Catalina -version 10.15.5) and below pip3 command worked for me.
pip3 install xlrd
python version : 3.7.6
OS : Mac-Catalina(10.15.5)
Thanks to #Tapan Hegde, pip3 install xlrd worked from me, after installing the pip3, like this:
sudo apt update
apt install python3-pip
pip3 install xlrd
I reckon the easiest/cleanest solution would be to use a tool that isolates your python environment, such as virtualenv
Once installed, create a virtual env by specifying which version of python you want to use:
$> virtualenv -p python3 env
Note: puttin python3 directly works only for mac, with linux, you must specify the absolute path or your python binary.
And then 'activate' your environment:
$> source env/bin/activate
From here, any python or pip command you use will use python3.
$> pip install xlrd
Virtualenv has the advantage of not 'polluting' your local python installation, your can manage your pip modules installed more easily.
If you want more detail on how it works and the other alternatives, check this post
When pip install xlrd not work and in computer is still old version, then try do it with current version, for example pip install xlrd==2.0.1.
The current versions are here

Simple python library can't install

Windows 10 Enterprise version 10.0.1.15063 build 15063. Tried both pip and pip3:
pip install scipy
pip3 install scipy
Both didn't work. Even tried to specify path of python directory, still didn't work.
If you're using Windows, open Command Prompt (CMD) and run this command
run python pip -m install [module]
OR
run py pip -m install [module]
Finally installed.
Just updated git and ran the same command again "pip install scipy"
but this time it worked and installed the library.

pip not running with Python 3.5

I have installed Python 3.5 and Pip but When I am type pip or pip3 in console, i get this error
The folder you are executing pip from can no longer be found.
If I run pwd, I get
/home/zahid
Pip was installed using
sudo python /usr/local/lib/python3.5/site-packages/easy_install.py pip
and output that I got was
[sudo] password for zahid:
Searching for pip
Best match: pip 8.1.1
Adding pip 8.1.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip3.5 script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Using /usr/local/lib/python3.5/site-packages
Processing dependencies for pip
Finished processing dependencies for pip
Can anyone tell me what is going on here
which python3 returns
/usr/bin/python3
which pip returns
/usr/local/bin/pip
which pip3 returns
/usr/local/bin/pip3
echo $PYTHONPATH returns
nothing blank
Regards
Please close this terminal and open a new terminal. You may have deleted some files inadvertently. As a result the terminal is unable to locate some links or environment variables. I faced the same issue. In a new terminal everything went fine.
I had this error on my Mac and restarting fixed this problem for me.
Does sudo pip work?
If so, check to make sure your profile isn't messed up. Check your path variable using the echo command with something like echo $PATH
You need to make sure /usr/local/bin is present in your user profile.
If not, did you install pip into 3.5 and are you accidentally running some other version of python like python 2?
Create a symbolic link using
ln -s /usr/local/bin/pip /usr/bin/pip
test it by running
pip -V

Use or install different versions of python3 pip

I'm trying to install packages for my python 3.5.0 versus my python 3.4.3
I can run both by typing either python3.4 or python3.5
I have pip2 and pip3. I also ran the script sudo easy_install3 pip, which made me be able to use pip3.4 But I am still having trouble installing modules for python3.5. pip3 just installs for python3.4
I am looking to install termcolor for python3.5 and I am having no success. Can anyone help?
I am on Windows, and you appear not to be, but maybe the following will help.
If pip is in your system's equivalent of python35/Lib/site-packages, then python3.5 -m pip should run pip so that it installs into the 3.5 site-packages.
If you do not have pip in the 3.5 site-packages, copy its directory, along with its dependencies (pip....dist-info/, setuptools/, setuptools....dist-info/, and easyinstall.py) from the 3.4 site_packages.
Or, if pip3 or even pip3.4 is in python35/Scripts, run it with its full path name so you are not running the 3.4 version.

Resources