Giter Club home page Giter Club logo

get-pip's Introduction

get-pip.py

get-pip.py is a bootstrapping script that enables users to install pip, setuptools, and wheel in Python environments that don't already have them. You should not directly reference the files located in this repository and instead use the versions located at https://bootstrap.pypa.io/.

Usage

$ curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py

Upon execution, get-pip.py will install pip, setuptools and wheel in the current Python environment.

It is possible to provide additional arguments to the underlying script. These are passed through to the underlying pip install command, and can thus be used to constraint the versions of the packages, or to pass other pip options such as --no-index.

$ python get-pip.py "pip < 21.0" "setuptools < 50.0" "wheel < 1.0"
$ python get-pip.py --no-index --find-links=/local/copies

get-pip.py options

This script also has it's own options, which control which packages it will install.

  • --no-setuptools: do not attempt to install setuptools.
  • --no-wheel: do not attempt to install wheel.

Development

You need to have a nox available on the CLI.

How it works

get-pip.py bundles a copy of pip with a tiny amount of glue code. This glue code comes from the templates/ directory.

Updating after a pip release

If you just made a pip release, run nox -s update-for-release -- <version>. This session will handle all the script updates (by running generate), commit the changes and tag the commit.

IMPORTANT: Check that the correct files got modified before pushing. The session will pause to let you do this.

Generating the scripts

Run nox -s generate.

Discussion

If you run into bugs, you can file them in our issue tracker.

You can also join #pypa or #pypa-dev on Freenode to ask questions or get involved.

Code of Conduct

Everyone interacting in the get-pip project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PSF Code of Conduct.

get-pip's People

Contributors

benoit-pierre avatar bloomonkey avatar chrahunt avatar dstufft avatar edmorley avatar ewdurbin avatar hugovk avatar ivoz avatar jaraco avatar peternewman avatar pfmoore avatar pradyunsg avatar sbidoul avatar sethmlarson avatar uranusjr avatar xavfernandez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

get-pip's Issues

Move backend for CDN to S3 or similar

Currently bootstrap.pypa.io's backend is a VM, which has some flexibility in managing how bootstrap.pypa.io is "put together", which is susceptible to all the failings of kernel panics and misconfiguration that can lead to outages.

It might be worth considering migrating the generation of the files to be the responsibility of CI and syncing the result to S3. This would likely be more reliable than even spinning up a second host and would certainly be cheaper.

Ref #34

Deterministic and verifiable operation

get-pip.py doesn't pin its dependencies nor their SHA-256 hashes. At run-time, it does the equivalent of pip install --upgrade pip setuptools wheel, which will pull in the latest versions of these packages (plus dependencies, if any) without hash checking, only relying on TLS x509 certificate checking. So despite claims that python get-pip.py is secure, it is only secure as far as the trusted root CA system is secure. You are still vulnerable to a MitM attack by any server with a valid x509 certificate chaining up to a trusted root CA. And since the common root CA lists contain some CAs associated with governments with... questionable practices, this trust only goes so far. (If I were one of these questionable governments or a nefarious actor, I could MitM PyPI and inject malware into pip, setuptools, wheel because get-pip.py doesn't verify the SHA-256 hashes of files it downloads off the Internet at run time. That would be a very attractive attack target given the sheer volume of machines that would run the poisoned code within minutes and the potential to spread malware by infecting packages built with a poisoned version of pip/setuptools.)

If you don't buy into the tin foil hat arguments, another issue with the current approach is it isn't deterministic over time. Even if I download a specific version of get-pip.py today and verify its SHA-256 is a trusted value, the results from running it today could be different from running it tomorrow because a new version of pip, setuptools, or wheel is published on PyPI. This lack of reproducibility can be extremely annoying. For example, I try to enforce deterministic and reproducible tests and CI in my projects to the maximal extent possible. If I'm using pip 20 in commit X, I want tests/CI to use pip 20 for all of time. I don't want pip 21 to be silently used when I check out this commit 1 year from now. (An issue related to this is whenever a new version of pip, setuptools, wheel, or get-pip.py are published, random processes that don't pin dependencies can break due to incompatibilities in the new version.)

So, I have a feature request for get-pip.py: deterministic and verifiable mode.

In this mode, executing get-pip.py would install a deterministic version of all packages and would specify SHA-256 hashes for all those packages. In this mode, get-pip.py would be resistant to MitM attacks against the package repository it downloads pip, setuptools, wheel, etc from. It would also (hopefully) guarantee reproducible execution.

The way I see this working is get-pip.py gains a new CLI flag. Say --reproducible. In this mode, the invocation of pip behind the scenes specifies a requirements/constraints file with pinned SHA-256 hashes and --require-hashes mode is enabled.

Establishing this feature would require updating a pip requirements file/manifest at release time or whenever dependency version is bumped. So it is a bit of extra work for the get-pip.py maintainers.

I think it is worthwhile to implement this feature in get-pip.py itself because bootstrapping packaging tools from a Python distribution that doesn't have them (e.g. the Windows embeddable zip file distributions) in a deterministic and reproducible manner is really difficult. You have to install setuptools, pip, wheel, etc from source, taking care to download and verify deterministic versions of each. I would prefer for Python's packaging tools to offer high levels of security and guarantees of determinism by default. pip itself can already achieve this with --require-hashes mode. But get-pip.py does not and that undermines the security and integrity of the whole packaging chain.

Add a 3.4/get-pip.py

pip 19.2 dropped support for Python 3.4, we should add a dedicated file for it using the same mechanisms as we do for 2.6 and 3.3.

Add tags

If it is possible to add tags for get_pip releases? Currently, if there is need to get deterministic build (continuous integration) the there is need to pin with commit hash which is unreadable for human.

openWrt

hi, I use Opkg install python3 in OpenWrt

when i use python3 get-pip.py to install pip. but it error.

My python3 files are in /media/AiCard_01/opt/lib/python3.5

the error is

`Exception:
Traceback (most recent call last):
File "/opt/lib/python3.5/distutils/sysconfig.py", line 422, in _init_posix
parse_makefile(filename, g)
File "/opt/lib/python3.5/distutils/sysconfig.py", line 291, in parse_makefile
fp = TextFile(fn, strip_comments=1, skip_blanks=1, join_lines=1, errors="surrogateescape")
File "/opt/lib/python3.5/distutils/text_file.py", line 100, in init
self.open(filename)
File "/opt/lib/python3.5/distutils/text_file.py", line 115, in open
self.file = io.open(self.filename, 'r', errors=self.errors)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/lib/python3.5/config-3.5/Makefile'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/tmp/tmptkoregi1/pip.zip/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/opt/tmp/tmptkoregi1/pip.zip/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/opt/tmp/tmptkoregi1/pip.zip/pip/req/req_set.py", line 646, in install
**kwargs
File "/opt/tmp/tmptkoregi1/pip.zip/pip/req/req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "/opt/tmp/tmptkoregi1/pip.zip/pip/req/req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "/opt/tmp/tmptkoregi1/pip.zip/pip/wheel.py", line 242, in move_wheel_files
name, user=user, home=home, root=root, isolated=isolated
File "/opt/tmp/tmptkoregi1/pip.zip/pip/locations.py", line 192, in distutils_scheme
i.finalize_options()
File "/opt/lib/python3.5/distutils/command/install.py", line 283, in finalize_options
(prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
File "/opt/lib/python3.5/distutils/sysconfig.py", line 485, in get_config_vars
func()
File "/opt/lib/python3.5/distutils/sysconfig.py", line 428, in _init_posix
raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /opt/lib/python3.5/config-3.5/Makefile (No such file or directory)`

why is /opt/lib/python3.5/config-3.5/??

Can you help me?

get-pip.py includes a broken version of setuptools

See: pypa/setuptools#885

This has caused unexpected failures on RTD. (RTD uses setup.py install --force rather than pip install ..)

I think (i.e. haven't tried yet) we can work around them by just asking RTD to upgrade pip before installing namespace packages via setup.py install, but get-pip.py should be updated so that the bundled zip is up to date (I may take a stab at this).

/cc @jonparrott

Post-script: It just occurred to me that the issue might be in pip instead (which vendors in setuptools). It seems to have been fixed (outside of master, UPDATE also on master), but not yet released.

python 3.6 embed cannot get pip

Downloaded python 3.6 embeddable zip file (windows 32 bit)

Downloaded get-pip.py from the following URL:
https://pip.pypa.io/en/stable/installing/

This is the traceback:

Traceback (most recent call last):
  File "get-pip.py", line 20061, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "C:\Users\User\AppData\Local\Temp\tmpinoq60hn\pip.zip\pip\__init__.py", line 26, in <module>
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "C:\Users\User\AppData\Local\Temp\tmpinoq60hn\pip.zip\pip\utils\__init__.py", line 23, in <module>
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "C:\Users\User\AppData\Local\Temp\tmpinoq60hn\pip.zip\pip\locations.py", line 88, in <module>
  File "ntpath.py", line 75, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType

Installing pip version 18.1 fails after latest commit change related to 19.0

I have been noticing the following error for couple of hours now and this seems to coincide with the latest commit that was pushed for 19.0: f2394e9

2019-01-22T20:57:55.9413221Z + /usr/src/python/python /get-pip.py --prefix /opt/python/2.7.15 --disable-pip-version-check --no-cache-dir --no-warn-script-location pip==18.1
2019-01-22T20:57:57.4170626Z ‌DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.‌
2019-01-22T20:57:57.4657677Z ‌Collecting pip==18.1‌
2019-01-22T20:57:57.7992818Z   Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
2019-01-22T20:57:58.0449421Z Collecting setuptools
2019-01-22T20:57:58.5207209Z   Downloading https://files.pythonhosted.org/packages/37/06/754589caf971b0d2d48f151c2586f62902d93dc908e2fd9b9b9f6aa3c9dd/setuptools-40.6.3-py2.py3-none-any.whl (573kB)
2019-01-22T20:57:58.5702104Z Collecting wheel
2019-01-22T20:57:58.6478810Z   Downloading https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
2019-01-22T20:57:58.6951558Z ‌Exception:‌
2019-01-22T20:57:58.6951840Z Traceback (most recent call last):
2019-01-22T20:57:58.6952035Z   File "/tmp/tmpuw2Nlo/pip.zip/pip/_internal/cli/base_command.py", line 176, in main
2019-01-22T20:57:58.6952244Z     status = self.run(options, args)
2019-01-22T20:57:58.6952471Z   File "/tmp/tmpuw2Nlo/pip.zip/pip/_internal/commands/install.py", line 346, in run
2019-01-22T20:57:58.6952678Z     session=session, autobuilding=True
2019-01-22T20:57:58.6952874Z   File "/tmp/tmpuw2Nlo/pip.zip/pip/_internal/wheel.py", line 848, in build
2019-01-22T20:57:58.6953070Z     assert building_is_possible
2019-01-22T20:57:58.6953218Z AssertionError
<

When I tried with the commit before the 19.0 change, it works fine.

Please let me know if there's something I am missing. Thanks.

Web scraping with different urls

I've wrote this code to do a web scraping with 20 different pages (urls), the problem is since the urls are different, I need to do a loop with a list of links and a loop to do the web scraping in each page. My problem is when I do like this, I get the loop with the pages, but python only give me the first information in each page ( does not run the loop in each page, to get all the informations). Can you help?

from bs4 import BeautifulSoup
import requests
import csv
import pandas as pd
from random import randint
from time import sleep

empresa = []
saida = []
chegada = []
origem = []
destino = []
price = []
classe = []

filename="raspagem2.csv"
f=open(filename,"w")

headers = "Empresa; Saída; Chegada; Origem; Destino; Preço; Classe\n"
f.write(headers)

lista_urls=["https://www.clickbus.com.br/onibus/sao-paulo-tiete-sp/parati-rj",
"https://www.clickbus.com.br/onibus/sao-paulo-tiete-sp/rio-de-janeiro-rj",
"https://www.clickbus.com.br/onibus/curitiba-pr/sao-paulo-sp-todos",
"https://www.clickbus.com.br/onibus/belo-horizonte-mg-todos/rio-de-janeiro-rj-todos",
"https://www.clickbus.com.br/onibus/rio-de-janeiro-rj/campinas-sp",
"https://www.clickbus.com.br/onibus/belo-horizonte-mg/sao-paulo-tiete-sp",
"https://www.clickbus.com.br/onibus/goiania-go/brasilia-df",
"https://www.clickbus.com.br/onibus/sao-paulo-tiete-sp/ribeirao-preto-sp",
"https://www.clickbus.com.br/onibus/sao-paulo-tiete-sp/brasilia-df",
"https://www.clickbus.com.br/onibus/porto-alegre-rs/florianopolis-sc",
"https://www.clickbus.com.br/onibus/sao-paulo-tiete-sp/florianopolis-sc",
"https://www.clickbus.com.br/onibus/sao-paulo-barra-funda-sp/sao-jose-do-rio-preto-sp",
"https://www.clickbus.com.br/onibus/campinas-sp/rio-de-janeiro-rj",
"https://www.clickbus.com.br/onibus/florianopolis-sc/porto-alegre-rs",
"https://www.clickbus.com.br/onibus/curitiba-pr/florianopolis-sc",
"https://www.clickbus.com.br/onibus/brasilia-df/goiania-go",
"https://www.clickbus.com.br/onibus/rio-de-janeiro-rj-todos/belo-horizonte-mg",
"https://www.clickbus.com.br/onibus/sao-paulo-sp-todos/curitiba-pr",
"https://www.clickbus.com.br/onibus/rio-de-janeiro-rj/sao-paulo-tiete-sp",
"https://www.clickbus.com.br/onibus/florianopolis-sc/sao-paulo-tiete-sp"]

for elem in lista_urls:

response = requests.get(elem)

soup=BeautifulSoup(response.content, 'html.parser')

containers=soup.findAll("div",{"class":"search-result-item valign-wrapper"})

sleep(randint(2,10)
              

for container in containers:
    
    empresa = container.find('div',{"class":"company"}).img["alt"]                            
    saida = container.find('time',{"class":"departure-time"}).text
    chegada = container.find('time',{"class":"return-time"}).text
    origem = container.find('span',{"class":"station-departure"}).text
    destino = container.find('span',{"class":"station-arrival"}).text
    price=container.find('span',{"class":"price-value"}).text
    classe = container.find('div',{"class":"service-class"}).span.text

f.write(empresa + ";" + saida + ";" + chegada + ";" + origem + ";" + destino + ";" + price + ";" + classe + "\n") 

f.close()

Unable to install pip on HP-UX

Team,

I am trying to install pip on a HP UX machine. Available python versions for HP-UX are 2.7.* - You may verify the same here - http://hpux.connect.org.uk/hppd/cgi-bin/search?term=python&Search=Search

I tried by downloading the pip file and below is the error.

/usr/local/bin/python get-pip.py

Collecting pip<10
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x9fffffffeea2ae10>: Failed to establish a new connection: [Errno -1] ',)': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x9fffffffeea2a110>: Failed to establish a new connection: [Errno -1] ',)': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x9fffffffeea2abd0>: Failed to establish a new connection: [Errno -1] ',)': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x9fffffffeea2aa90>: Failed to establish a new connection: [Errno -1] ',)': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x9fffffffeea2a8d0>: Failed to establish a new connection: [Errno -1] ',)': /simple/pip/
Could not find a version that satisfies the requirement pip<10 (from versions: )
No matching distribution found for pip<10

uname -a

HP-UX lqam8082 B.11.31 U ia64 1404401316 unlimited-user license

python --version

Python 2.7.16

Non-ascii error on vagrant command

Hi,

Im getting this error when running vagrant up. and similarly when I try to ssh in to the vagrant machine and run the curl command. Has anyone encountered this kind of issue or could share a solution. Thanks in advance

curl https://bootstrap.pypa.io/get-pip.py | sudo python

Stdout from the command:

Stderr from the command:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 File "", line 1083
SyntaxError: Non-ASCII character '\xc6' in file on line 1084, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
5 1825k 5 100k 0 0 113k 0 0:00:16 --:--:-- 0:00:16 113k
curl: (23) Failed writing body (946 != 1371)

python 3.8 cannot get pip

Traceback (most recent call last):
File "get-pip.py", line 23687, in
main()
File "get-pip.py", line 198, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 83, in bootstrap
from pip._internal.commands.install import InstallCommand
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 618, in _load_backward_compatible
File "", line 259, in load_module
File "C:\Users\Admin\AppData\Local\Temp\tmpk11w4ny4\pip.zip\pip_internal\commands\install.py", line 17, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 618, in _load_backward_compatible
File "", line 259, in load_module
File "C:\Users\Admin\AppData\Local\Temp\tmpk11w4ny4\pip.zip\pip_internal\cli\req_command.py", line 16, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 618, in _load_backward_compatible
File "", line 259, in load_module
File "C:\Users\Admin\AppData\Local\Temp\tmpk11w4ny4\pip.zip\pip_internal\index\collector.py", line 9, in
File "C:\Users\Admin\Downloads\mimetypes.py", line 564
print USAGE
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(USAGE)?

Issue with "python3 get-pip.py --user" with python 3.6.7

Hi

I am new python and pip and encountered some problems while installing pip.

Any suggestions ?

Thanks
ayeerr

$ python3 --version
Python 3.6.7
$ python3 get-pip.py --user
Traceback (most recent call last):
File "get-pip.py", line 21361, in
main()
File "get-pip.py", line 197, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip._internal
File "/tmp/tmpm7edordz/pip.zip/pip/_internal/init.py", line 40, in
File "/tmp/tmpm7edordz/pip.zip/pip/_internal/cli/autocompletion.py", line 8, in
File "/tmp/tmpm7edordz/pip.zip/pip/_internal/cli/main_parser.py", line 8, in
File "/tmp/tmpm7edordz/pip.zip/pip/_internal/cli/cmdoptions.py", line 14, in
ModuleNotFoundError: No module named 'distutils.util'

Update location of get-pip in the template

The header for get-pip.py is quite outdated since it's mentioning that:

If you're wondering how this is created, it is using an invoke task located
in tasks/generate.py called "installer". It can be invoked by using
invoke generate.installer.

To a newcomer it seems that this code lives in the main repository of pip, however since 2016 (git commit 3c753c5 in pipenv) this is no longer the case and the code lives here.
IMO this should be updated in the code comment to something like:

If you're wondering how this is created, it is using an invoke task located
in https://github.com/pypa/get-pip/tasks/generate.py called "installer". It can be invoked by using
invoke generate.installer.

Will you accept a PR for this?

current get_pip requires distutils.util - ubuntu18.04

can the install of this not be done in the script?

/usr/bin/python3.6 get-pip.py --upgrade --force-reinstall
Traceback (most recent call last):
  File "get-pip.py", line 21492, in <module>
    main()
  File "get-pip.py", line 197, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip._internal
  File "/tmp/tmp2eupwih9/pip.zip/pip/_internal/__init__.py", line 40, in <module>
  File "/tmp/tmp2eupwih9/pip.zip/pip/_internal/cli/autocompletion.py", line 8, in <module>
  File "/tmp/tmp2eupwih9/pip.zip/pip/_internal/cli/main_parser.py", line 8, in <module>
  File "/tmp/tmp2eupwih9/pip.zip/pip/_internal/cli/cmdoptions.py", line 14, in <module>
ModuleNotFoundError: No module named 'distutils.util'

Issue Doing 'sudo python get-pip.py' on respberry pi 3 with python 3.5

Hi,
I've been trying to install opencv on my rpi 3.I am following a tutorial which says to install numpy using
"wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py"
But when I run the following code I get the following error-
Collecting pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)) - skipping
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)': /simple/pip/
Could not fetch URL https://www.piwheels.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='www.piwheels.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)) - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)) - skipping
Could not fetch URL https://www.piwheels.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='www.piwheels.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)) - skipping

Pls kindly help me resolve this issue.

Add digests to relevant files

From pypa/pip#5658, we could provide digests so users can verify that get-pip.py was downloaded correctly.

One use case could be during manual configuration of some server that does not have root CA certificates installed:

  1. Execute curl --insecure -o get-pip.py https://bootstrap.pypa.io/get-pip.py on the server
  2. Run sha256sum get-pip.py
  3. Navigate to https://bootstrap.pypa.io/get-pip.py.sha256 in a web browser
  4. Compare the contents of that page with the output of sha256sum

get-pip no longer works with explicit args for pip

Hi!

Try curl https://bootstrap.pypa.io/get-pip.py | python - pip==18.0 and you will see that a DoubleRequirement exception is thrown. If you debug a bit, you'll find that actually InstallRequirement.from_line fails (InstallRequirement does not have from_line) and that triggers the continue call in the loop.

Thanks!

get-pip failing for embeddable Python on Windows 10

On Windows 10, here is a script snippet that worked until recently to get an embeddable Python install and install pip in it.

set -ex

rm -rf Python35/
mkdir Python35/
curl https://www.python.org/ftp/python/3.5.2/python-3.5.2-embed-amd64.zip > Python35/python-3.5.2.zip

pushd Python35
unzip python-3.5.2.zip
popd

curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
./Python35/python get-pip.py

However, this now gives an error:

+ ./Python35/python get-pip.py
ERROR: To modify pip, please run the following command:
C:\...\Python35\python.exe -m pip

and this suggestion is not possible because pip is not yet installed.

My current workaround is to replace curl https://bootstrap.pypa.io/get-pip.py > get-pip.py with

rm -rf get-pip
git clone https://github.com/pypa/get-pip
pushd get-pip
git checkout f135a3e
cp get-pip.py ..
popd

since f135a3e seems to be the most recent commit which works.

Runtime error in carla 0.9.5 and 0.9.4 on windows 10

Hi, i'm getting these errors alternatively while running my program in Carla.
either I get this error:
"RuntimeError: failed to connect to newly created map"
or this:
"RuntimeError: time-out of 20000ms while waiting for the simulator, make sure the simulator is ready and connected to localhost:2000"
Also I have both versions 0.9.5 and 0.9.4 but in version 0.9.4 i'm can't find any file named "Carla" and "EGG INFO" in python API.
i'm attaching the code If someone wants to have a look.
code.txt
@BrandonHaynes @nsubiron help plz

https://bootstrap.pypa.io/get-pip.py doesn't work with Python 2.7.6 or earlier 2.7s

Trying to get-pip doesn't work anymore on older 2.7s. I think it has to do with tls1.2 being required and probably not supported in older Python 2.7s. How can I install and use pip on Python 2.7.6 and earlier 2.7s?

Log from Python 2.7.6 get-pip:

c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\urllib3\util\ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is 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/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /packages/ac/95/a05b56bb975efa78d3557efa36acaf9cf5d2fd0ee0062060493687432e03/pip-9.0.3-py2.py3-none-any.whl
c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is 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/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /packages/ac/95/a05b56bb975efa78d3557efa36acaf9cf5d2fd0ee0062060493687432e03/pip-9.0.3-py2.py3-none-any.whl
c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is 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/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /packages/ac/95/a05b56bb975efa78d3557efa36acaf9cf5d2fd0ee0062060493687432e03/pip-9.0.3-py2.py3-none-any.whl
c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is 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/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /packages/ac/95/a05b56bb975efa78d3557efa36acaf9cf5d2fd0ee0062060493687432e03/pip-9.0.3-py2.py3-none-any.whl
c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is 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/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /packages/ac/95/a05b56bb975efa78d3557efa36acaf9cf5d2fd0ee0062060493687432e03/pip-9.0.3-py2.py3-none-any.whl
c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is 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/advanced-usage.html#ssl-warnings
Exception:
Traceback (most recent call last):
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\download.py", line 821, in unpack_url
    hashes=hashes
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\download.py", line 659, in unpack_http_url
    hashes)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\download.py", line 853, in _download_http_url
    stream=True,
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\requests\sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\cachecontrol\adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "c:\users\csm10495\appdata\local\temp\tmp2cs1sz\pip.zip\pip\_vendor\requests\adapters.py", line 506, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/ac/95/a05b56bb975efa78d3557efa36acaf9cf5d2fd0ee0062060493687432e03/pip-9.0.3-py2.py3-none-any.whl (Caused by SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),))

Unhelpful error message when trying to use get-pip with Python 2.7 on hiwifi 4 Pro

Unhelpful error message when trying to use get-pip with Python 2.7 on hiwifi 4 Pro

CPU:MT7621AT + MT7612EN + 7603EN
Mem:256MB DDR3 RAM
Flash:128MB NAND flash
Nic:1+3 x 1000M Ethernet
USB:1x USB 2.0 port. 1x USB 3.0 port
Mainboard:UART pad on PCB (JP3: TX, RX, GND, 3.3V)
OS:HIWIFI OS( OpenWrt Barrier Breaker 14.07)

root@Hiwifi:/tmp# python get-pip.py 
Traceback (most recent call last):
  File "get-pip.py", line 21373, in <module>
    main()
  File "get-pip.py", line 197, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip._internal
  File "/tmp/tmpiuvLZO/pip.zip/pip/_internal/__init__.py", line 40, in <module>
  File "/tmp/tmpiuvLZO/pip.zip/pip/_internal/cli/autocompletion.py", line 8, in <module>
  File "/tmp/tmpiuvLZO/pip.zip/pip/_internal/cli/main_parser.py", line 12, in <module>
  File "/tmp/tmpiuvLZO/pip.zip/pip/_internal/commands/__init__.py", line 6, in <module>
  File "/tmp/tmpiuvLZO/pip.zip/pip/_internal/commands/completion.py", line 6, in <module>
  File "/tmp/tmpiuvLZO/pip.zip/pip/_internal/cli/base_command.py", line 19, in <module>
  File "/tmp/tmpiuvLZO/pip.zip/pip/_internal/download.py", line 37, in <module>
  File "/tmp/tmpiuvLZO/pip.zip/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/tmp/storage/sda1/soft/usr/lib/python2.7/ctypes/__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: dynamic module does not define init function (init_ctypes)


when i try 2.6/get-pip.py
root@Hiwifi:/tmp# curl -k https://bootstrap.pypa.io/2.6/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1719k  100 1719k    0     0  33189      0  0:00:53  0:00:53 --:--:-- 21264
Traceback (most recent call last):
  File "<stdin>", line 22123, in <module>
  File "<stdin>", line 194, in main
  File "<stdin>", line 82, in bootstrap
  File "/tmp/tmpna4XUp/pip.zip/pip/__init__.py", line 45, in <module>
  File "/tmp/tmpna4XUp/pip.zip/pip/vcs/mercurial.py", line 9, in <module>
  File "/tmp/tmpna4XUp/pip.zip/pip/download.py", line 36, in <module>
  File "/tmp/tmpna4XUp/pip.zip/pip/utils/glibc.py", line 4, in <module>
  File "/tmp/storage/sda1/soft/usr/lib/python2.7/ctypes/__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: dynamic module does not define init function (init_ctypes)

get-pip needs some tests

We need to be testing get-pip to ensure that pip changes don't break it. With the pip 10 release, the following issues weren't caught:

  1. The change to pip's internals 😞.
  2. The change to warn if Windows users use "pip install -U pip" (we need to test on Windows).
  3. The change to requests where they no longer ship cacert.pem.

get-pip no long supports 3.4

When running the command I get the error

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 1764k 100 1764k 0 0 5931k 0 --:--:-- --:--:-- --:--:-- 5942k Traceback (most recent call last): File "<stdin>", line 22711, in <module> File "<stdin>", line 198, in main File "<stdin>", line 83, in bootstrap File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible File "/tmp/tmp_rl8jxv2/pip.zip/pip/_internal/commands/install.py", line 18, in <module> File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible File "/tmp/tmp_rl8jxv2/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 92, in <module> RuntimeError: Python 3.5 or later is required

Is this the intended behavior?

I guess I should use the https://bootstrap.pypa.io/3.4/get-pip.py path to remedy this? It would be nice if it just worked without adding 3.4 to it

get-pip.py is not comatible with Python2

Hi,

When I run ./get-pip.py, here is what I get:

~/src/get-pip $ ./get-pip.py 
Traceback (most recent call last):
  File "./get-pip.py", line 20061, in <module>
    main()
  File "./get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "./get-pip.py", line 82, in bootstrap
    import pip
  File "/tmp/tmp38Y8IC/pip.zip/pip/__init__.py", line 26, in <module>
  File "/tmp/tmp38Y8IC/pip.zip/pip/utils/__init__.py", line 27, in <module>
  File "/tmp/tmp38Y8IC/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>
  File "/tmp/tmp38Y8IC/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside
  File "/tmp/tmp38Y8IC/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set
  File "/tmp/tmp38Y8IC/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate
  File "/tmp/tmp38Y8IC/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace
  File "/tmp/tmp38Y8IC/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 2091, in _handle_ns
  File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
    mod = imp.load_module(fullname, self.file, self.filename, self.etc)
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/__init__.py", line 2, in <module>
    __import__('pkg_resources').declare_namespace(__name__)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 72, in <module>
    import packaging.requirements
  File "/usr/local/lib/python2.7/dist-packages/packaging/requirements.py", line 59, in <module>
    MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
~/src/get-pip $ echo $?
1

It seems get-pip.py is not compatible with Python2 anymore.

Can you please change the shebang from #!/usr/bin/env python to #!/usr/bin/env python3 ?

bootstrap.pypa.io/get-pip.py gives syntax error with python 2.66

I am using a RHEL 6.7 environment. I get the following error when trying to install pip.
Command: curl https://bootstrap.pypa.io/get-pip.py | python

Traceback:
Traceback (most recent call last):
File "", line 20649, in
File "", line 197, in main
File "", line 82, in bootstrap
File "/tmp/tmpsLrKHC/pip.zip/pip/_internal/init.py", line 42, in
File "/tmp/tmpsLrKHC/pip.zip/pip/_internal/cmdoptions.py", line 16, in
File "/tmp/tmpsLrKHC/pip.zip/pip/_internal/index.py", line 526
{str(c.version) for c in all_candidates},
^
SyntaxError: invalid syntax

Jython support

I found that my Jython installation on Gentoo doesn't include pip, setuptools or any other similar packages. Resorting to get-pip I got an error message instead:

Traceback (most recent call last):
  File "get-pip.py", line 19154, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "/tmp/tmp…/pip.zip/pip/__init__.py", line 15, in <module>
  File "/tmp/tmp…/pip.zip/pip/vcs/subversion.py", line 9, in <module>
  File "/tmp/tmp…/pip.zip/pip/index.py", line 30, in <module>
  File "/tmp/tmp…/pip.zip/pip/wheel.py", line 39, in <module>
  File "/tmp/tmp…/pip.zip/pip/_vendor/distlib/scripts.py", line 14, in <module>
  File "/tmp/tmp…/pip.zip/pip/_vendor/distlib/compat.py", line 31, in <module>
ImportError: cannot import name HTTPSHandler

I found that the official Jython installer will install pip and friends by default, so probably Gentoo is doing something strange here. Nevertheless, it would be nice if get-pip could deal with this in a reasonable way. By installing the module if possible, otherwise by suggesting users re-run the installer or something like that.

kali 2020 problem

python -m pip install --upgrade pip or pip2 install --upgrade pip gives me the same error
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/pip/main.py", line 19, in
sys.exit(_main())
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/init.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 24, in
from pip._internal.cli.req_command import RequirementCommand
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/req_command.py", line 15, in
from pip._internal.index.package_finder import PackageFinder
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index/package_finder.py", line 21, in
from pip._internal.index.collector import parse_links
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index/collector.py", line 12, in
from pip._vendor import html5lib, requests
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/init.py", line 97, in
from pip._vendor.urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in
import OpenSSL.SSL
File "build/bdist.linux-x86_64/egg/OpenSSL/init.py", line 8, in
File "build/bdist.linux-x86_64/egg/OpenSSL/crypto.py", line 15, in
File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 152, in
TypeError: from_buffer() cannot return the address of the raw string within a str or unicode object

python get-pip.py --require-hashes (without --src hack)

  • Pip version: None
  • Python version: 3.5
  • Operating System: various

Description:

I'm trying to bootstrap "pip setuptools wheel" with require hashes without using a hack.

What I've run:

tee requirements.txt <<HEREDOC
pip==8.1.2 \\
    --hash=sha256:6464dd9809fb34fc8df2bf49553bb11dac4c13d2ffa7a4f8038ad86a4ccb92a1 \\
    --hash=sha256:4d24b03ffa67638a3fa931c09fd9e0273ffa904e95ebebe7d4b1a54c93d7b732
setuptools==21.0.0 \\
    --hash=sha256:fb6378f65eb630281227720ae80276f38c1a1f16969eca499435c0ff2a815fe6 \\
    --hash=sha256:bdf0b7660f6673868d60d929e267e583bddc0e9623c71197b1ad79610c2ebe93 \\
    --hash=sha256:9ccd2f4eda0fb1af157eb2007e94bc53a48ea8c10f613e8cd7081d3d25f2991f
wheel==0.29.0 \\
    --hash=sha256:ea8033fc9905804e652f75474d33410a07404c1a78dd3c949a66863bd1050ebd \\
    --hash=sha256:1ebb8ad7e26b448e9caa4773d2357849bf80ff9e313964bcaf79cbf0201a1648
HEREDOC

python get-pip.py --require-hashes --no-wheel --no-setuptools -rrequirements.txt --src

This is a massive hack, because I'm using --src to 'comment' out the extra "pip" to avoid the dreaded DoubleRequirement error , getting get-pip.py to run,

pip.main(['install', '--upgrade', '--require-hashes', '--no-wheel', '--no-setuptools', '-rrequirements.txt', '--src', 'pip'])

Because "--src" is noop when there's no "-e"

What license is get-pip under?

Would like to use this, but at the moment, without a license we cannot clear it for use.

Are there any restrictions in the use of this code?

Is there a license I need to comply with in the use of this code?

Pip fails to install into clean virtualenv.

This happened approximately 12 hours ago.

I have a deploy script which has the following snippet:

python3 -m venv --without-pip venv
wget https://bootstrap.pypa.io/get-pip.py
./venv/bin/python3 get-pip.py
./venv/bin/pip install six

Prior to 12 hours ago, this worked.

Currently, this fails on ./venv/bin/pip install six, because ./venv/bin/python3 get-pip.py no longer results in the ./venv/bin/pip file being created.

Sourcing the venv prior to installing pip also fails to result in a proper install.

I can reproduce this reliably.

Platform: Ubuntu 14.04 LTS, Python 3.4.3.

Running get-pip in an environment with no pip installed gives "requirement already satisfied"

>python .\get-pip.py
Requirement already up-to-date: pip in c:\users\gustav\appdata\local\temp\tmpg92v1j4j\pip.zip (10.0.0)
Collecting setuptools
  Using cached setuptools-39.0.1-py2.py3-none-any.whl
Collecting wheel
  Using cached wheel-0.31.0-py2.py3-none-any.whl
Installing collected packages: setuptools, wheel
Successfully installed setuptools-39.0.1 wheel-0.31.0

Using --force-reinstall works around this.

Install on Ubuntu 16.10 fails

Hi,

I am on Ubuntu 16.10 with Python 3.5.2+.

After python3 get-pip.py I get:

Traceback (most recent call last):
  File "get-pip.py", line 20061, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/__init__.py", line 26, in <module>
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/utils/__init__.py", line 27, in <module>
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns
  File "/tmp/tmp2bsnrhpn/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path
AttributeError: '_NamespacePath' object has no attribute 'sort'

I reinstalled python3-pip, setuptools and pkg_resources with no succes.
Purging everything is not really an option, because a lot of packages depend on py3.

Does anyone have any pointers?

Cheers

Installation error

➜  ~ $ curl https://bootstrap.pypa.io/get-pip.py | python
zsh: command not found: $
➜  ~ curl https://bootstrap.pypa.io/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1734k  100 1734k    0     0   510k      0  0:00:03  0:00:03 --:--:--  510k
Traceback (most recent call last):
  File "<stdin>", line 22318, in <module>
  File "<stdin>", line 198, in main
  File "<stdin>", line 82, in bootstrap
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_internal/main.py", line 13, in <module>
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_internal/cli/autocompletion.py", line 11, in <module>
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_internal/cli/main_parser.py", line 7, in <module>
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_internal/cli/cmdoptions.py", line 28, in <module>
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_internal/models/target_python.py", line 4, in <module>
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_internal/utils/misc.py", line 19, in <module>
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 959, in <module>
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 963, in Environment
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 194, in get_supported_platform
  File "/var/folders/_p/d6bpxgbs52sclcyy9xg20ks40000gn/T/tmpgtAxpU/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 369, in _macosx_vers
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 809, in mac_ver
    info = _mac_ver_xml()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 786, in _mac_ver_xml
    pl = plistlib.readPlist(fn)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 78, in readPlist
    rootObject = p.parse(pathOrFile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 406, in parse
    parser.ParseFile(fileobj)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 17, column 1
➜  ~

Unhelpful error message when trying to use get-pip with Python 2.6

get-pip.py fails when run with Python 2.6. That's expected, but it should fail in a way that directs the user to bootstrap.pypa.io/2.6/get-pip.py

Sadly, due to cleared scrollback (and the fact that I was doing this with Ansible, which doesn't exactly give great error messages) I don't have the exact error message, but it was a SyntaxError on a set literal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.