Python 2.7.11 pip not installed - python

I have Python 2.7.11 installed on my machine which to my understanding should come with pip, however when I check the C:\Python27\Tools\Scripts\ directory there is no pip.exe present.
I have tried completely removing and reinstalling Python 2.7.11 without success. Running the installer pip is set to be installed, but after the install pip is nowhere to be found.
I also have Python 3.4 installed which has pip as expected. Any thoughts?

I encountered the same problem - pip not installed - with python-2.7.16, Win10, installing for 'all users'. It was resolved when I allowed the MSI installer to target the default location (C:\Python27) rather than changing it to under Program Files (x86). I've no clue why this changed anything.

python2.7.11 should install pip into c:\python27\scripts, you can take a look here

I used https://pip.pypa.io/en/stable/installing/ to make it install. Odd that an outside body has to make a tool to get pip to install. There is no mention of pip.pypa.io on the Python web site.
Although I got error messages, it did install, so check carefully.
You also may see a message suggesting that you upgrade to pip 9.0 with the command 'pip install --upgrade.' I highly recommend that.
Also, make sure you are in the directory where pip.exe is located when you run the commands. They don't tell you that, because they assume you know that, but we're not all geeks.

For people who are running into this issue, I have a Windows 10 x86 dev box that I use for exploit development, Python 2.7 was installed due to Immunity Debugger, this install did not include the new SSL package and did not include "pip".
There was no "C:\Python27\Scripts" folder which included pip. I did have a "C:\Python27\Tools\Scripts" folder which did not have pip installed.
I tired to install pip as suggested but did not work. Best way is to uninstall Python and install newest version, currently mine is 2.7.15 which came with pip as an option. This is what solved my issue, any older version of Python will need upgraded to support the SSL packages. You will receive the same errors when you try to install pip on an older version.
If you have reinstalled Python which included the SSL package and it still does not have pip, trying installing pip this way:
1. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
2. python get-pip.py
https://pip.pypa.io/en/stable/installing/
This should work if you have a newer version of Python.
Once you have installed pip or newer version of python, go to "C:\Python27\Scripts" and you should see pip.exe.

I have installed "python-2.7.16" in my windows 10 PC. PIP is installed under "C:\Python27\Scripts". One can add the "C:\Python27\Scripts" path to environment variable and then access pip command from command prompt.
To add the path in environment variable:
Control Panel\System and Security\System --> Advanced System Settings --> Advanced --> enviroment variables --> under system variable --> Path(variable name)

Had the issue where no matter which version of python 2.7 I installed on windows 10 there was no pip.exe generated in the "Scripts" folder.
I solved it by ensuring that that MSI Installer file had Admin privileges before installing

if pip is not installed you can use easy_install.exe to install pip and other modules
you can find easy install in
python -m easy_install pip

I had the same issue:
Installed Python 27
Tried to use pip, but failed with unrecognized command error
Checked installation: no "C:\Python27\Scripts", only "C:\Python27\Tools\Scripts"
This issue happens only on some versions of Windows.
HOW TO FIX IT:
Uninstall Python 27
Reinstall Python 27, but unselect "pip" feature
Check installation: no "C:\Python27\Scripts" as expected
Start the installer again and use "Change Python"
Set "pip" and "Add Python.exe to Path" features to be installed
Check installation: "C:\Python27\Scripts" is now correctly present
So for some unknown reason, pip is not correctly installed on some versions of Windows if it is installed during default Python 27 setup. To fix this issue, pip must be installed afterwards using the "Change Python" setup.

I meet the same issue when install Python 2.7.9. The installer does not come with pip.
Solution:
Install newer python2 x86 version: https://www.python.org/downloads/release/python-2718/
Then pip is located at C:\Python27\Scripts\pip.exe

It happens on windows as you should have admin rights to install anything on disk C.
I have the same issue Scripts folder was not installed. I would sugest to instal it on disk D.

Related

chocolatey says it has successfully force reinstalled python 3.11 - but I can't find it

Windows 11.
I am not great at virtual environments, and I have bumped around between a half dozen different "solutions." I thought I had it solved with chocolatey, but I am trying to install python3.11, and not having success. Basically, choco says it is installed, but I can't find it anywhere.
C:\Windows\System32>choco install --force python --version=3.11
Chocolatey v1.2.0
Installing the following packages:
python
By installing, you accept licenses for the packages.
python v3.11.0 already installed. Forcing reinstall of version '3.11.0'.
Please use upgrade if you meant to upgrade to a new version.
Progress: Downloading python 3.11.0... 100%
python v3.11.0 (forced) [Approved]
python package files install completed. Performing other installation steps.
The install of python was successful.
Software installed to 'C:\ProgramData\chocolatey\lib\python'
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
C:\Windows\System32>
This gives the impression that python would be in C:\ProgramData\chocolatey\lib\python, but the only files in that directory are python.nupkgandpython.nuspec`
Where do I go to find my shiny new python?
From PowerShell, run get-command python.exe
And you will get something like this:
CommandType Name Version Source
----------- ---- ------- ------
Application python.exe 0.0.0.0 C:\Users\Paul\AppData\Local\Microsoft\WindowsApps\python.exe
The Source column is where it is running python.exe from and where python is installed.
The python package on the Chocolatey Community Repository is a metapackage. So it does not install python, instead, it has a dependency on python2 or python3 (depending on the version of python), that dependent package is what actually installs Python. So if you install python v3.11, that will have a dependency on python3 v3.11, and the python3 package will download and run the Python installer.
Instead of force installing python, try for installing python3 to rerun the Python installer.
As for the install location, packages install to $env:ChocolateyInstall\lib\. So the .nupkg, .nuspec, chocolateyInstall.ps1, etc will all be there. But the python3 package runs the Python installer, and the Python 3.11.x installer will by default install to C:\python311 when run by the chocolateyInstall.ps1 in the python3 package.

How to pip install GDAL on Python 3.6 venv

gdal is correctly installed on my global system's python 3.5 packages.
But now I'm trying to pip install gdal on my python 3.6 virtual environment, but I receive multiple errors.
After activating the virtual environment, I've tried the following:
pip install pygdal or pip3 install pygdal
Error received: ERROR: Failed building wheel for pygdal
Tried following this guide, but the commands stated there are outdated
I've also tried this solution and this which failed
Installed older gdal versions but also didn't work.
Tried pip3 install GDAL==$(gdal-config --version) and I get the same error
I use
Ubuntu 16.04 and pip 21.0.1. Venv was created using virtualenv --python=/usr/bin/python3.6 my_venv
I've finally fixed the problem, and these are the steps I followed:
I uninstalled wheel from my venv
Then I pip installed gdal on the venv to check what error would appear
A wall of error text appeared, in which somewhere I noticed the 'x86_64-linux-gnu-gcc' failed with exit status 1
I typed sudo apt-get install python3.6-dev to install missing packages, as the solution suggests here
Then I ran pip install GDAL=<version that appears on ogrinfo --version> and it worked
EDIT: This answer pertains more to Windows than Ubuntu, but may have something useful.
Try downloading a wheel from here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
Note the "cp##" in the middle - that should match your Python version. If you are running Python 3.6 then you should see "cp36" in the file name (a "cp37" in the name means the wheel will fail). Also pay attention to the amd64 and win32 to be sure you have the correct version to match your Python virtual environment.
I'm on Windows instead of Ubuntu, but this was my process:
Open command prompt with cmd
Copy the path to activate.bat in the virtual environment from Windows Explorer (hold shift down, right-click on file, choose
"copy as path")
Paste path into control panel and hit enter. You should see an indicator that you are in virtual environment.
Copy the path to the wheel you downloaded to the clipboard using the same shift key trick.
Type 'pip install ' then paste the wheel path from your clipboard (or type it all out manually)
As an aside, I ended up with gdal installed within the osgeo module. I tried several things before I got here, but I'm pretty sure that happened with my installation from the wheel. In Python, I now use
from osgeo import gdal
I hope something here helps you. I've run into this a few times and it never seems like I quite remember how I got it done the next time I run into it. If I remembered it right this time, I can refer back here.
FWIW - I am using PyCharm and installing gdal through the Project Interpreter doesn't work. Also, it may take some jostling in PyCharm for the skeletons to update after you install through command prompt.

MacOS Catalina comes with Python 3.7.3, need to upgrade

I recently upgraded to macOS Catalina and it seems to come with Python 3.7.3. All of my packages have come from the PIP installed with Python 3.7.3.
I have installed Python 3.7.7 (the newest version available on Homebrew), but it gives an error when linking. It tells me to run brew link python3, and when I do, it says
Linking /usr/local/Cellar/python/3.7.7...
Error: Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
rm '/usr/local/bin/2to3'
To force the link and overwrite all conflicting files:
brew link --overwrite python
To list all files that would be deleted:
brew link --overwrite --dry-run python
Previously, I accidentally uninstalled Python 3.7.3, which many people have recommended against because it is not a good idea to uninstall the macOS bundled Python and may cause issues with the operating system. I had lost all of the packages installed using PIP, and I had to restore my computer using my Time Machine backup to avoid issues with my operating system.
How can I make the newest version of Python (3.7.7) the default, and "transfer" my packages from PIP into the newest version of Python (if that is even required) and fix my Python installation?
A Python installation of 3.7.3 came with Xcode, so all I had to do was delete the app Xcode, and I ran a fresh installation of Python using Brew.
yes you are right. New MacOs built in python3.7.3 in system and it comes from xcode, u dont't have to uninstall xcode
all you need to do is remove /lib/commandlinetools/freamwork/python3.7.3.
and install newest python with brew.
run python3 --version and pip3 --version they all newest from brew

getting python pyobcd installed

I'm a little lost on how to get pyodbc installed in my computer.
I have python 3.6.1
The link
http://support.esri.com/en/technical-article/000011656
pointed me to another link
https://github.com/mkleehammer/pyodbc
Which is vague.
I'm used to downloading and running an exe for install.
This link is unclear and says all I have to do is:
"pip install pyodbc"
What exactly do I need to do to get this working?
Since you have not mentioned which OS you are using,
I will assume that you are on windows (as you have mentioned that you are used to install using .exe).
Firstly you need to know what a pip is:
pip is basically a package manager for python packages used to install 3 rd party packages which do not bundle along with the python distribution.
On linux pip comes pre installed also if you are using python version 3.4 onwards or python 2.7.9 you will be having pip pre installed on your system.
All you have to do it to open the command prompt issue the command
pip install package-name(pyobdc here)
it will do the job.
If you do not find pip in your distribution you can refer this link
How do I install pip on Windows?
open cmd in your computer and type
pip install pyobdc
Hello there and welcome to python programming. Basically python comes with its package installer so either you can go to any interpreter that you are using and type pip install pyobdc or use the command prompt in windows and type in pip install pyobdc. This would install your module and just remember to put import pyobdc at the top of the code if you want to use this package. Further information can be found on here

pip install wheel on windows when multiple python versions

I am running python3 on windows, and have 2 python3 versions installed (3.4 and 3.5). This is necessary from some reasons. Python 3.4 seems to be the default one and is located in c:/python34/... while 3.5 is located in c:/Users/u/AppData/...
When trying to do:
pip install C:\Users\YOANN\Downloads\numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl
or
pip3 install C:\Users\YOANN\Downloads\numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl
I receive the error:
numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
I'm pretty sure it's because it is trying to install it on the 3.4 version instead of 3.5 hence the version mismatch, but I can't find a workaround...
Any idea?
Just run it with the full path to pip and it should work.
c:\Users\u\AppData\Local\Programs\Python\Python35-64\Scripts\pip.exe install C:\Users\YOANN\Downloads\numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl
Check the first part, the c:\Users\u should be where you have installed your python3.5
I'm not sure what you are trying to do, but Virtual Environments may be your best friend.

Categories