Python: Warning intalling pip on windows 10 - python

here is the message i get when i try to install pip (to install python packages) on windows 10 on my command prompt:
Collecting pip
Using cached pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
Collecting setuptools
Downloading setuptools-49.6.0-py3-none-any.whl (803 kB)
|████████████████████████████████| 803 kB 1.3 MB/s
Installing collected packages: pip, setuptools
WARNING: The scripts pip.exe, pip3.8.exe and pip3.exe are installed in 'C:\Users\GMU\AppData\Local\Programs\Python\Python38-32\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts easy_install-3.8.exe and easy_install.exe are installed in 'C:\Users\GMU\AppData\Local\Programs\Python\Python38-32\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.2.2 setuptools-49.6.0
What does it mean ?
It says it installed but when i try the
pip --version
command or `
pip
i have message saying that pip is not a recognize command.
Thank's for your help.

I found the issue an the solution too.
First in not English native so at the first read in didn't get it.
The path where I've installed python wasn't good or something like that so pip couldn't retrieved it properly. The message is more or less clear about that fact.
Here is what I did:
uninstall pip
uninstall python 3.8.0
install python 3.8.5 with personalized config (not the recommended) because the install exe wanted to install python to the same folder than the last version. So I choose "C:\Program" and install Pip too with the prompt installer in order to get it to same folder.
Now it works fine for me.
Morality => don't install python to this path C:\Users\GMU\AppData\Local\Programs\Python\..

Windows is recommending you to add python to your PATH.
When you add python to your PATH, you will be able to execute pip in your command prompt.
I would recommend having a look at this https://geek-university.com/python/add-python-to-the-windows-path/.

Related

Meeting a pip requirement using an alternative module

I'm trying to install a python module, 'pyAudioProcessing' (https://github.com/jsingh811/pyAudioProcessing) on my Linux Mint distribution, and one of the items in requirements.txt is causing issues: python-magic-bin==0.4.14. When I run pip3 install -e pyAudioInstaller, I get an error:
ERROR: Could not find a version that satisfies the requirement python-magic-bin==0.4.14 (from pyAudioProcessing==1.1.5) (from versions: none)
ERROR: No matching distribution found for python-magic-bin==0.4.14 (from pyAudioProcessing==1.1.5)
The same error appears if I try to manually install the module using pip3 install python-magic-bin. The module installs without issues on my windows machine.
pypi.org lets me download files for it manually, however only Windows and MacOS .whl files are available. I tried simply removing the requirement from the list, but that resulted in a large number of other errors to appear, so I assume the module is legitimately required.
Thee is another module called python-magic-debian-bin that I can download. Is there a simple way to convince pyAudioInstaller to use this other module instead of the original? Like can I somehow rename python-magic-debian-bin to python-magic-bin and hope it works out?
python-magic-bin 0.4.14 provides wheels for OSX, w32 and w64, but not for Linux. And there is no source code at PyPI.
You need to install it from github:
pip install git+https://github.com/julian-r/python-magic.git
As for pyAudioProcessing I can see 2 ways to install it:
Clone the repository and edit requirements/requirements.txt, replace python-magic-bin==0.4.14 with pip install git+https://github.com/julian-r/python-magic.git#egg=python-magic;
Install requirements manually and then install pyAudioProcessing without dependencies:
pip install --no-deps pyAudioProcessing
or
pip install --no-deps git+https://github.com/jsingh811/pyAudioProcessing.git
The library has updated the requirements very recently for it to work on Linux.
pip install -U pyAudioProcessing
Should get it all set up for you.
Alternatively, https://github.com/jsingh811/pyAudioProcessing the readme describes other getting started methods as well.

Adding packages to Python "embedded" installation for Windows

From the documentation:
The embedded distribution is a ZIP file containing a minimal Python
environment.
Sounds great! The 64-bit Windows embedded v3.6.5 of Python is only 13MB. As an alternative to compiling, I would like to zip some python scripts together with the minimum needed to run them on a Win10 machine that doesn't have Python installed.
Now, I almost always need to import additional packages to provide functionality. But I can't determine how I should do this if I want to send out a python script together with this embedded version of Python. For example, if my script uses numpy, how can I include that library in this "embed?" I.e., so that on any Win10 machine I can unzip the single deployment file and immediately execute my scripts?
(A regular pip install numpy appears to create a Lib subdirectory that's over 50MB! But for an "embedded" deployment I don't need any support for debugging or whatever else is encompassed in that mass of files.)
There is a way to extend Python embedded installation.
I managed to create Flask-ready package, that I can just unzip on target machine and run code.
The trick is to install EXACT same python version (normal full blown python) as your target embedded small python. Not only version but x86, x64 has to match as well.
Then install modules from pip on normal python, go to NormalPython\Lib\site-packages and copy all new files that appear after installing the package to EmbeddedPython\Lib
finally add Lib and Lib\site-packages to pythonXX._pth inside Embedded python folder.
It's extremely important to fully test your application in case you miss some package.
Also this would not work for packages that also add .exe to Scripts folder.
You could still probably copy the exe's to Script folder and add it to path which could do the trick.
There is a similar trick.
Install pip in the embedded version:
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
Edit pythonXX._pth by adding
Lib
Lib\site-packages
Use pip to install other packages
There is a way to extend Python embedded installation. The trick is to install the same python version( I will call it NormalPython) as your target embedded python(I will call it EmbeddedPython). The version as well as architecture has to match exactly.
You then install modules from pip on NormalPython. You can find pip on NormalPython\Scripts.
Go to NormalPython\Lib\site-packages and copy all files that appear after installing whatever you want to install through pip to EmbeddedPython\Lib\
Then add Lib to pythonXX._pth inside Embedded python folder.
This worked for me on windows 10 after downloading the latest python embed and python install through https://www.python.org/downloads/windows/ .
I used Michal Rawluk's answer to do it, but it was somewhat hard to understand so I am trying to explain it a bit differently.
At least with the latest Python versions (tested on 3.8 and 3.11) this appears to work fine:
Download the Windows embeddable package you need from the official site, and extract it.
PS> Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.11.1/python-3.11.1-embed-amd64.zip -OutFile python-3.11.1-embed-amd64.zip
PS> Expand-Archive .\python-3.11.1-embed-amd64.zip
PS> cd .\python-3.11.1-embed-amd64
Open the python3xx._pth file corresponding to your version (e.g. python311._pth for Python 3.11), and make sure the following import line is uncommented. This will automatically add site directories used by pip to the Python path:
# Uncomment to run site.main() automatically
import site
In Powershell this can be automated by running:
PS> Add-Content -Path .\python311._pth -Value 'import site'
Download the official pip bootstrap script, e.g. with Powershell:
PS> Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.py
Run the downloaded script (make sure you're using the correct Python executable in the current directory .\):
PS> .\python.exe get-pip.py
Collecting pip
Using cached pip-22.3.1-py3-none-any.whl (2.1 MB)
Collecting setuptools
Downloading setuptools-66.0.0-py3-none-any.whl (1.3 MB)
---------------------------------------- 1.3/1.3 MB 16.0 MB/s eta 0:00:00
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: wheel, setuptools, pip
WARNING: The script wheel.exe is installed in 'C:\Users\xxxx\Downloads\python-3.11.1-embed-amd64\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts pip.exe, pip3.11.exe and pip3.exe are installed in 'C:\Users\xxxx\Downloads\python-3.11.1-embed-amd64\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.3.1 setuptools-66.0.0 wheel-0.38.4
Run pip from the .\Scripts directory:
PS> .\Scripts\pip.exe list
Package Version
---------- -------
pip 22.3.1
setuptools 66.0.0
wheel 0.38.4
PS> .\Scripts\pip.exe install numpy
Collecting numpy
Downloading numpy-1.24.1-cp311-cp311-win_amd64.whl (14.8 MB)
---------------------------------------- 14.8/14.8 MB 11.9 MB/s eta 0:00:00
Installing collected packages: numpy
WARNING: The script f2py.exe is installed in 'C:\Users\xxxx\Downloads\python-3.11.1-embed-amd64\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.24.1
PS> .\python.exe -c 'import numpy; print(numpy.__version__)'
1.24.1

I'm trying to use pip install to add numpy, but it says the file doesn't exist

I've tried upgrading pip install (it was already done), poked around in various pip and wheel related python files, but all that happens when i run the following command into my command prompt (cmd.exe)
pip install pip install numpy-1.13.3+mkl-cp36-cp36m-win_amd64.whl
This is the error I have
Requirement 'numpy-1.13.3+mkl-cp36-cp36m-win_amd64.whl' looks like a filename, but the file does not exist. numpy-1.13.3+mkl-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
My system is, as far as I know, a 64 bit windows system
just pip install numpy will take care of downloading and installing necessary module versions. You dont need to mention module version
I found my solution, which was to install numpy
pip install numpy

How do I install a Python library? [duplicate]

I'm having a hard time setting up python packages. EasyInstall from SetupTools is supposed to help that, but they don't have an executable for Python 2.6.
For instance to install Mechanize, I'm just supposed to put the Mechanize folder in C:\Python24\Lib\site-packages according to INSTALL.txt, but runnning the tests does not work. Can someone help shed some light on this? Thanks!
The accepted answer is outdated. So first, pip is preferred over easy_install, (Why use pip over easy_install?). Then follow these steps to install pip on Windows, it's quite easy.
Install setuptools:
curl https://bootstrap.pypa.io/ez_setup.py | python
Install pip:
curl https://bootstrap.pypa.io/get-pip.py | python
Optionally, you can add the path to your environment so that you can use pip anywhere. It's somewhere like C:\Python33\Scripts.
Newer versions of Python for Windows come with the pip package manager. (source)
pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4
Use that to install packages:
cd C:\Python\Scripts\
pip.exe install <package-name>
So in your case it'd be:
pip.exe install mechanize
This is a good tutorial on how to get easy_install on windows. The short answer: add C:\Python26\Scripts (or whatever python you have installed) to your PATH.
You don't need the executable for setuptools.
You can download the source code, unpack it, traverse to the downloaded directory and run python setup.py install in the command prompt
Starting with Python 2.7, pip is included by default. Simply download your desired package via
python -m pip install [package-name]
As I wrote elsewhere
Packaging in Python is dire. The root cause is that the language ships without a package manager.
Fortunately, there is one package manager for Python, called Pip. Pip is inspired by Ruby's Gem, but lacks some features. Ironically, Pip itself is complicated to install. Installation on the popular 64-bit Windows demands building and installing two packages from source. This is a big ask for anyone new to programming.
So the right thing to do is to install pip. However if you can't be bothered, Christoph Gohlke provides binaries for popular Python packages for all Windows platforms http://www.lfd.uci.edu/~gohlke/pythonlibs/
In fact, building some Python packages requires a C compiler (eg. mingw32) and library headers for the dependencies. This can be a nightmare on Windows, so remember the name Christoph Gohlke.
I had problems in installing packages on Windows. Found the solution. It works in Windows7+. Mainly anything with Windows Powershell should be able to make it work. This can help you get started with it.
Firstly, you'll need to add python installation to your PATH variable. This should help.
You need to download the package in zip format that you are trying to install and unzip it. If it is some odd zip format use 7Zip and it should be extracted.
Navigate to the directory extracted with setup.py using Windows Powershell (Use link for it if you have problems)
Run the command python setup.py install
That worked for me when nothing else was making any sense. I use Python 2.7 but the documentation suggests that same would work for Python 3.x also.
Upgrade the pip via command prompt ( Python Directory )
D:\Python 3.7.2>python -m pip install --upgrade pip
Now you can install the required Module
D:\Python 3.7.2>python -m pip install <<yourModuleName>>
pip is the package installer for python, update it first, then download what you need
python -m pip install --upgrade pip
Then:
python -m pip install <package_name>
You can also just download and run ez_setup.py, though the SetupTools documentation no longer suggests this. Worked fine for me as recently as 2 weeks ago.
PS D:\simcut> C:\Python27\Scripts\pip.exe install networkx
Collecting networkx
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS reques
t has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may caus
e the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer ve
rsion of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissi
ngwarning.
SNIMissingWarning
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SS
LContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL con
nections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.
readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading networkx-1.11-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 664kB/s
Collecting decorator>=3.4.0 (from networkx)
Downloading decorator-4.0.11-py2.py3-none-any.whl
Installing collected packages: decorator, networkx
Successfully installed decorator-4.0.11 networkx-1.11
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object i
s not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade
to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplat
formwarning.
InsecurePlatformWarning
Or just put the directory to your pip executable in your system path.
As mentioned by Blauhirn after 2.7 pip is preinstalled. If it is not working for you it might need to be added to path.
However if you run Windows 10 you no longer have to open a terminal to install a module. The same goes for opening Python as well.
You can type directly into the search menu pip install mechanize, select command and it will install:
If anything goes wrong however it may close before you can read the error but still it's a useful shortcut.

Unable to install 64-bit Pygame on Python 3.4

I have 64-bit python 3.4 installed, which comes with pip. I wanted to install pygame, and I know that the 32 bit version that they have on their site wouldn't work with my version of python. So I downloaded the 64-bit python 3.4 pygame package from here (pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl). I renamed the package to pygame.whl and tried to use pip on the command line to install it, but it gave me this error;
Collecting pygame
Could not find a version that satisfies the requirement pygame (from versions:
)
Some externally hosted files were ignored as access to them may be unreliable
(use --allow-external pygame to allow).
No matching distribution found for pygame
So I tried using the --allow-external option, but it gave me a different error and asked me to provide a requirements file. I looked around, and found that I might need to try using the --pre option, but it gave me the exact same error as above regardless. How can I install the package?
The most likely reason you failed to install the .whl package is that you typed
pip install pygame
at the command prompt, instead of switching to the directory where you stored your renamed pygame.whl and running
pip install pygame.whl
pip requires that you give the full name of the file being installed.
The error message you got indicates that you ran the first command, and pip was looking in PyPI for pygame (which isn't there). The --allow-external command would have allowed you to specify a remote location where a source file or .whl file could be found.
In the future, I'd recommand not renaming the files downloaded from the (quite excellent) site you linked to, so that when you try to install them you're sure you're running the right command. Remember, you can always use Tab to complete file names on the command line.

Categories

Resources