PIP From command line error - python

I'm trying to download modules using the pip command in the CMD. I have pip and python both added to my path directory. I don't know how to get this to work though, I've tried upgrading my pip but just keep getting exceptions. Does anyone know how to solve this?
I'm very new to working from the command line...
I tried working around the initial fatal error
Then I tried upgrading my pip but it didn't work.
Any help much appreciated.

#Josh,
Try this.
Open your cmd prompt with admin rights (if you have privileges).
This can be done by right-clicking on the start menu and select the admin cmd in the context box provided for windows 8 and 10.
For Windows 7 you click Start>All Programs>Accesories, then right-click cmd prompt and Run as Administrator.
In the prompt, you should see something like C:\WINDOWS\system32>
If pip is installed to your path, type in "python -m pip install yourPackageNameHere"
Example given to install the twilio package (which is pretty cool):
C:\WINDOWS\system32>python -m pip install twilio
This should take care of it.
For some other helpful information, you can check out these sites.
pip users guide
https://pip.pypa.io/en/stable/user_guide/#installing-packages
or
The Python documentation (which is a programmer's best friend in time of need)
https://www.python.org/
Hope this helps.

Related

Python was not found after closing commandline. Windows opens app store when I type python

I have downloaded and installed python from here.
Then I restarted and opened a commandline and typed
python --version
I recorded all my actions, so I can post a screenshot of that:
It works and shows the version number.
Then I performed the following steps to install Jupyter because I want to use a local runtime with Google Colab:
In the Windows commandline (not in the Python window!!), I type this:
pip install virtualenv
python -m pip install --upgrade pip
virtualenv opencv (I guess I can choose a random name here because we will not be using OpenCV, right? But for simplicity, I keep this name now)
I CD to c:\users\MYUSERNAME\opencv\Scripts
activate.bat
pip install numpy
python -m pip install jupyter
Now my browser opens this page: http://localhost:8888/tree
Now I click "New" and "Python 3 (ipykernel)"
Now I want to install the extension jupyter_http_over_ws.
I type:
pip install jupyter_http_over_ws
Nothing shows up when I type text on the keyboard. It looks like this:
Because I want to be able to type again, I close the command line and open it again.
Now I type again:
pip install jupyter_over_http_ws
It says
The command "pip" has been misspelt oder was not found.
Because I have no idea what is happening, I type:
python --version
I am expecting that it shows the version number like before.
But instead it shows
"Python was not found."
Why is that?
ps: When I type "python", it starts the Microsoft App Store and offers me to download it:
Thank you!
What happens if you add your python installation path to the environment variables?
https://www.educative.io/answers/how-to-add-python-to-path-variable-in-windows
Don't forget to restart Windows after adding the path!

python -- manually install downloaded module without admin rights

I am trying to install the python package us without admin privileges.
I have tried pip install us in Anaconda prompt to no avail.
I have also tried the suggestion listed here: Install python modules on windows without admin rights--didn't work.
I have now downloaded the files from the site https://pypi.org/project/us/ to my desktop and need to know how to install the package from here.
I am using the Spyder IDE and Python 3.7. Is there a way to do this?
Thanks.
I do this on the daily and if I understand what you are saying you are doing it right. If pip install us in command prompt or shell (if you are using Windows OS) doesn't work try py -m pip install us. Make sure you are using command prompt and not using your IDEz
As you can see it worked first try for me.
Since you have downloaded the files, Extract them in a folder and normally a setup.py file must be include, open command prompt in that folder and run :
python setup.py install

'django' is not recognized as an internal or external command, operable program or batch file.(module error)

I have freshly installed python version 3.9 and it shows up in my CMD (command prompt),
but when I try to install django via command
pip install django (also tried sudo doesn't work either)
command line screenshot
but when I try to check my version via
django --version
command line screenshot
I have already tried to configure my environment path variable added every possible path in it.
Environment path variable screenshot
P.S : I don't want to create virtual environment please don't suggest me that the same thing happen's there too. I have been stuck for many days with this problem if anybody actually know how to solve it please help
Let me clear the point that you tried using sudo in your windows machine, I believe that you used Administrator CMD or Administrator Power-shell.
Let's get to the point, from your screenshot it appears you already have the Django library installed in your machine but you are checking django version the wrong way.
You can check the version by using the below command:
python -m django --version
OR
pip freeze
*which will show you all python libraries versions.
please make sure to change python to python3 if this is what you are using, and do the same thing for pip as well
as an optional step you can try to create a project using below command
django-admin startproject testing-project
I hope this help you!, happy coding.

Python Pip "Fatal Error in Launcher" and other issues with updating pip

I'm trying to install Pyinstaller to my computer using pip to convert a python file into a .exe file. When I try to install it, Command Prompt gives me the following error :
Fatal error in launcher: Unable to create process using
'"c:\python27\python.exe" "C:\Python27\Scripts\pip.exe" install
pyinstaller': The system cannot find the file specified.
I've done some looking online and tried just about everything I've found this far and I'm at a loss. I have tried:
using python - m pip install xxxx
updating pip
reverting back to a previous version of pip
using Command Prompt as an Admin
making sure pip is in my PATH using environmental variables
uninstalling and doing a complete reinstall of python.
Reading other people's questions related to this problem, several people suggested running different lines of code like python -c "import pip.__main__" and python -m pip install pip==9.0.0 and my Command Prompt doesn't do anything, even while running as an admin. I assume that I have something fucked up deep in my files or settings that I didn't even realize I changed, but I can't see it for the life of me. I'd be happy to try any suggestions anyone has. Thanks!
Edit: It seems like there may be something wrong with my Command Prompt? When I try entering python -m venv venv, it doesn't do anything or acknowledge the command.

I've tried everything and it still says that PIP is an invalid command in the command prompt

I've looked at so many Stack Overflow questions and I've tried everything:
I installed get-pip.py, I ran "python get-pip.py" in the correct folder in the Command Prompt but it still says that pip is an invalid command.
Can anyone please help?
Try python -m pip install <module here> or py -m pip install <module here>. It worked for me without adding pip to PATH, although I recommend doing so. Also, make sure that you don't have multiple versions of python on your system. That can mess things up a lot.
You have to make sure that "pip" is also added to your PATH in "Environment Variables" just like you add PATH of your python. So once go to your "Environment Variables" and check if this folder is included C:\Users\<name>\AppData\Local\Programs\Python\Python36\Scripts since this folder contains your "pip"
Assuming you are using Windows, the simplest solution is just to uninstall python and to reinstall it. Then when running the python setup program, make sure to tick the "add python to PATH" option

Categories

Resources