Cmd does not recognize pip but python shell does - python

Question: How do you use pip when cmd does not recognize python or pip but python 3.7 shell recognizes pip?
More Details: I am a beginner coder (5-6 months in) and I installed python 3.7 a while back and to test for pip I typed in import pip in the shell with no error. Unfortunately when I typed in python -V or pip -V into cmd It said python or pip was not recognized by the cmd. I don't know why this happened so I looked online and I found this
about getting the cmd to recognize pip but it did not help very much. When I tried to install pyaudio using pip install pyaudio in cmd it did not recognize pip once again. I do apologize for the poor wording on this question. Thank you

Have tried to reinstall the python with enabling the Add PATH option??
This is happening due to path issue, you can try this also.
goto python lib location via cmd after that try pip install {Module Nmae }

have u tried typing pip3 instead of pip ?
also make sure your python is in your sytem PATH.

Related

Import packages (pip) facility doesn't work on Mac

probably was asked 100 times but I will try once again ( maybe will get a simple answeR)
I used the commands:
url https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
from a mac terminal to install pip. When I am going to the IDLE shell window and I am typing :
pip3 install numpy
I am getting a syntax error even though it's supposed to work.
Can somebody explain to me what is the issue?
I am not keen on downloading Anaconda as I like to keep my environment simple enough.
I am working with a mac notebook. any help will be most appreciated.
Thanks, YK
The IDLE shell window is a Python interpreter and only understand python syntax. Since pip3 install numpy is not valid Python, you get a syntax error. Instead, you need to open Terminal and type the command there.
You cant install packages through the python idle.
Try installing numpy through your mac terminal.
If it still does not work check if pip is even installed by pip --version or pip3 --version. The reason that downloading a package in the python IDLE does not work is because the python IDLE only understands valid python code(it is a python interpreter), and because pip3 install numpy is not python code it does not work

How do you install Django & PIP?

I am having a nightmare tonight, I want to start learning some Django but I am running into quite a few problems while installing it.
I am following these tutorials - https://www.youtube.com/watch?v=UmljXZIypDc / https://www.youtube.com/watch?v=MEcWRk9w0t0
I installed Python 3.7.2 and confirmed the installation by typing 'python --version' into Terminal/Command Prompt.
I typed 'pip --version' into CMD and got this message in return "'pip' is not recognized as an internal or external command, operable program or batch file."
this is where I am stuck, I cannot continue any longer without completing this step, could anyone tell me where I am going wrong?
Thank you
edit: looks like it's a path issue, does anyone know how to do the following: how to I do this :
"Then add C:\Python37\Scripts path to your environment variable. Assumes that there is a Python37 folder in your C drive, that folder name may varied according to the installed python version Now you can install python packages by running pip install awesome_package_name"
You need to uninstall python and when you're installing python again , check on add python to PATH.It will remove the error
Can you be more specific as to which OS you are using? You can use pip also like python -m pip .... The -m part loads a python module It might just not be installed since it is a python module. On linux, for example you have to install pip separately (would be sudo apt-get install python-pip).
Run pip install django from windows command prompt instead of python shell.
Installing Django with pip
follow these to know more. https://docs.djangoproject.com/en/2.2/topics/install/
hope you will get it.

unable to install modules using pip

I newly installed python 2.7.10 which came with pre installed pip python installer.
I'm unable to install any python modules using pip in python
I tries installing through CMD in widows
For example if i'm trying to install twilio using CMD prompt
C:python27>pip install twilio
Cmd Prompt is not giving any errors and it's not proceeding after i used pip install !I tried uninstalling python and installed again but again it's same
Error while installing from python terminal
Commond prompt error
You have to use pip in a terminal, but not in the Python shell. It is a bash command, not Python syntax. In other words, use pip before you type "python".
You have misspelled the module name (use "twilio", instead of "twillio"). And off course you should do it in the command prompt and not in python shell...
;)
Try this:
c:\>
pip install twilio
I too had the same problem
Add the following to the environment path in windows:
"C:>python27\scripts;" (Please paste without the quotes)
This helped me in solving my problem !

Support doesn't work

I'm trying to use neovim with deoplete and UtilSnips. Both requires Python support from nvim.
I followed the instructions in :help nvim_python to set the support but the output of :echo has('python') or :echo has('python3') are both 0.
On nvim-startup I get the message UltiSnips requires py >= 2.7 or py3 and for deoplete It requires Neovim with Python 3 support ("+python3").
My python (2.7.10) and python3 (3.4.3) are both installed with homebrew. The neovim module is installed over pip and pip3 with install neovim but nvim can't find it, even when I set the let g:python_host_prog path in nvimrc.
I don't know what I am able to do anymore, has anyone an idea whats wrong with it?
Please follow the instruction on https://neovim.io/doc/user/provider.html#provider-python to setup the python interpreter for neovim.
First, install pynvim (previously, it was named neovim, but that has been changed) plugin
pip3 install pynvim
Print g:loaded_python3_provider
echo g:loaded_python3_provider
" for python 2.x use the following
" echo g:loaded_python_provider
If it returns 1, the python is not setup for neovim. In your ~/.config/nvim/init.vim file, set the python interpreter
let g:python3_host_prog='/path/to/python3'
" for python2, use the following instead
"let g:python_host_prog = '/path/to/python2.7'
I encountered the same problem lately. Here are the steps adapted from answer of #VforVitamin where I made it working.
Assuming python2 and python3 are installed.
Install neovim plugin pip3 install neovim.
Open neovim.
Execute command :UpdateRemotePlugins.
Restart neovim.
I had the issue myself because I used neovim inside virtualenv. If so, make sure to pip install neovim inside your virtualenv, and make sure that import neovim works in the python interpreter.
If that doesn't help, you can try and run neovim with debug messages (neovim -V3, or any other logging level) and see what you can pick from there.
I bet you have a line in your init file that starts with "set runtimepath=".
Change it to "set runtimepath+="
If when you try
let [interp, errors] = provider#pythonx#Detect(2)
From the docs at
https://github.com/neovim/neovim/wiki/Troubleshooting#python-support-isnt-working
You get errors, could be that you have your VIM environment variable pointed to the wrong (probably vim74) runtime directory.
Neovim needs pythonx.vim from the runtime/autoload/providers/ folder to load a python interp. Vim74 doesn't provide this file.
If you have an env. variable of VIM (with a path), it will use that as your location of your runtime files - I had my set to /usr/share/vim/vim74, changing it to the location of neovim worked. I guess there is a compile time option to point to the correct location too.
I was with the same problem and the solution actually cames from the question.
What I did was:
pip install --upgrade pip
pip3 install --upgrade pip
sudo pip install setuptools
sudo pip3 install setuptools
sudo pip install neovim
sudo pip3 install neovim
After it, enter in neovim and :UpdateRemotePlugins. Close it and open again.
After these steps I had neovim working properly.
Edit:
For those using Arch Linux, we have a peculiarity about Python. The steps are:
Install pip (python3) and pip2 (python2): pacman -S python-pip python2-pip
Instead of pip3, you should use pip2
Beyond this minor difference, the rest of commands work pretty much the same way.
As pointed out by #fwalch, the documentation has changed to https://neovim.io/doc/user/provider.html#provider-python.
Neovim comes shipped with Python3 enabled, but you need to install the pynvim module in order to use Neovim Python3 plugins:
python3 -m pip install --user --upgrade pynvim

Can't install any python package from the python command prompt

I am trying to install some python packages from the python shell but I get syntaxError. I am using python 3.4.3 which supposed to come with pip installed and I can see pip3 pip3.4, pip, easy_install, and easy_install-3.4 under scripts but whenever I run the command in the shell I get syntax error.
Am I not supposed to use the python shell for package installation? I am using windows 8.1 if that would explain something. I tried these commands:
pip install packageName --- got syntaxError with this message:File '' line 1, pip install(with a mark at last l in install). easy_install packageName generated the same error message but with the mark at the last letter in the packagename, i double checked all spellings but I can't seem to see what the problem is. How can I install packages?
Am I not supposed to use the python shell for package installation?
No. Commands like pip are to be run on the operating system command line (i.e., the "DOS prompt" on Windows).
No you are just to use the Windows terminal for pip package installations.
If that does not work, ensure that you have installed Python properly following this guide Here.
Click Windows(button)+R then type cmd. In there type pip -V, what version does it show?
If you get pip 6.1.1 from C:\Python32\lib\site-packages <python 3.4> (depending on your directory) then you're good, simply make your installations from there.

Categories