Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update distlib to 0.2.7 #5257

Merged
merged 2 commits into from
Apr 17, 2018
Merged

Update distlib to 0.2.7 #5257

merged 2 commits into from
Apr 17, 2018

Conversation

pfmoore
Copy link
Member

@pfmoore pfmoore commented Apr 16, 2018

No description provided.

@pfmoore pfmoore added the skip news Does not need a NEWS file entry (eg: trivial changes) label Apr 16, 2018
@pfmoore pfmoore added this to the 10.0.1 milestone Apr 16, 2018
Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a news file -- news/distlib.vendor?

@pradyunsg pradyunsg added type: enhancement Improvements to functionality project: vendored dependency Related to a vendored dependency and removed skip news Does not need a NEWS file entry (eg: trivial changes) labels Apr 17, 2018
@pfmoore
Copy link
Member Author

pfmoore commented Apr 17, 2018

@pradyunsg Yep, I'll do that.

@dstufft
Copy link
Member

dstufft commented Apr 17, 2018 via email

@pfmoore
Copy link
Member Author

pfmoore commented Apr 17, 2018

@dstufft yes, that's what I was going to do. I got sidetracked because the vendoring task seemed to be doing something odd - it modified https://github.com/pypa/pip/blob/master/src/pip/_vendor/urllib3/util/ssl_.py#L6 as if binascii was vendored, and it added a src/pip/_vendor/bin file full of exes, plus a src/pip/_vendor/bin.pyi. I basically ignored them when I did this PR, but I've been looking to see if I can work out what went on. It didn't do that when I did the vendoring for pip 10.

I suspect it may be a change in pip 10 (the previous revendor I did with pip 9 active), but I don't think I'm going to worry about it for now.

@pfmoore pfmoore merged commit 64bf4dc into pypa:master Apr 17, 2018
@perfectcream
Copy link

This is my test on my Windows 10 box (Microsoft Windows [Version 10.0.16299.371]) below.

I had try to uninstall my python 3.6.4 (amd64) and install python 3.6.5 (amd64), and upgrade pip with python -m pip install -U pip, now I run pip in cmd as Administrator, I got...

C:\WINDOWS\system32>where pip3
C:\Program Files\Python36\Scripts\pip3.exe

C:\WINDOWS\system32>pip3 -V
Fatal error in launcher: Unable to create process using '""c:\program files\python36\python.exe" "C:\Program Files\Python36\Scripts\pip3.exe" -V'

C:\WINDOWS\system32>"c:\program files\python36\python.exe" "C:\Program Files\Python36\Scripts\pip.exe" -V
pip 10.0.0 from c:\program files\python36\lib\site-packages\pip (python 3.6)

C:\WINDOWS\system32>python -m pip -V
pip 10.0.0 from C:\Program Files\Python36\lib\site-packages\pip (python 3.6)

@perfectcream
Copy link

I uninstall Python 3.6.5 (amd64) and clean pip cache, and reinstall Python 3.6.5 (amd64) then try to install pipenv on my box, I got these errors...

C:\WINDOWS\system32>pip -V
pip 9.0.3 from c:\program files\python36\lib\site-packages (python 3.6)

C:\WINDOWS\system32>pip install -U pipenv
Collecting pipenv
Downloading https://files.pythonhosted.org/packages/e5/fd/740a41c68c38262265d73191fb686f38d26c4ea1ea6080a65b2b626bedc7/pipenv-11.10.0-py3-none-any.whl (5.6MB)
100% |████████████████████████████████| 5.6MB 177kB/s
Collecting virtualenv-clone>=0.2.5 (from pipenv)
Downloading https://files.pythonhosted.org/packages/6d/c2/dccb5ccf599e0c5d1eea6acbd058af7a71384f9740179db67a9182a24798/virtualenv_clone-0.3.0-py2.py3-none-any.whl
Collecting pip>=9.0.1 (from pipenv)
Downloading https://files.pythonhosted.org/packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 504kB/s
Collecting virtualenv (from pipenv)
Downloading https://files.pythonhosted.org/packages/ed/ea/e20b5cbebf45d3096e8138ab74eda139595d827677f38e9dd543e6015bdf/virtualenv-15.2.0-py2.py3-none-any.whl (2.6MB)
100% |████████████████████████████████| 2.6MB 327kB/s
Requirement already up-to-date: setuptools>=36.2.1 in c:\program files\python36\lib\site-packages (from pipenv)
Collecting certifi (from pipenv)
Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl (150kB)
100% |████████████████████████████████| 153kB 1.1MB/s
Installing collected packages: virtualenv-clone, pip, virtualenv, certifi, pipenv
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
Exception:
Traceback (most recent call last):
File "c:\program files\python36\lib\shutil.py", line 387, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] 存取被拒。: 'C:\Users\fish\AppData\Local\Temp\pip-py2p8fdp-uninstall\program files\python36\scripts\pip.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\pip\basecommand.py", line 215, in main
File "c:\program files\python36\lib\site-packages\pip\commands\install.py", line 342, in run
File "c:\program files\python36\lib\site-packages\pip\req\req_set.py", line 795, in install
File "c:\program files\python36\lib\site-packages\pip\req\req_install.py", line 767, in commit_uninstall
File "c:\program files\python36\lib\site-packages\pip\req\req_uninstall.py", line 142, in commit
File "c:\program files\python36\lib\site-packages\pip_vendor\retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "c:\program files\python36\lib\site-packages\pip_vendor\retrying.py", line 212, in call
raise attempt.get()
File "c:\program files\python36\lib\site-packages\pip_vendor\retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "c:\program files\python36\lib\site-packages\pip_vendor\six.py", line 686, in reraise
File "c:\program files\python36\lib\site-packages\pip_vendor\retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "c:\program files\python36\lib\site-packages\pip\utils_init_.py", line 102, in rmtree
File "c:\program files\python36\lib\shutil.py", line 494, in rmtree
return _rmtree_unsafe(path, onerror)
File "c:\program files\python36\lib\shutil.py", line 384, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "c:\program files\python36\lib\shutil.py", line 384, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "c:\program files\python36\lib\shutil.py", line 384, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "c:\program files\python36\lib\shutil.py", line 389, in rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "c:\program files\python36\lib\site-packages\pip\utils_init
.py", line 114, in rmtree_errorhandler
PermissionError: [WinError 5] 存取被拒。: 'C:\Users\fish\AppData\Local\Temp\pip-py2p8fdp-uninstall\program files\python36\scripts\pip.exe'

C:\WINDOWS\system32>python -m pip install -U pipenv
Collecting pipenv
Using cached https://files.pythonhosted.org/packages/e5/fd/740a41c68c38262265d73191fb686f38d26c4ea1ea6080a65b2b626bedc7/pipenv-11.10.0-py3-none-any.whl
Requirement not upgraded as not directly required: pip>=9.0.1 in c:\program files\python36\lib\site-packages (from pipenv) (10.0.0)
Collecting virtualenv (from pipenv)
Using cached https://files.pythonhosted.org/packages/ed/ea/e20b5cbebf45d3096e8138ab74eda139595d827677f38e9dd543e6015bdf/virtualenv-15.2.0-py2.py3-none-any.whl
Requirement not upgraded as not directly required: virtualenv-clone>=0.2.5 in c:\program files\python36\lib\site-packages (from pipenv) (0.3.0)
Requirement not upgraded as not directly required: setuptools>=36.2.1 in c:\program files\python36\lib\site-packages (from pipenv) (39.0.1)
Collecting certifi (from pipenv)
Using cached https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl
Installing collected packages: virtualenv, certifi, pipenv
The script virtualenv.exe is installed in 'C:\Program Files\Python36\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.

The scripts pewtwo.exe, pipenv-resolver.exe and pipenv.exe are installed in 'C:\Program Files\Python36\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 certifi-2018.4.16 pipenv-11.10.0 virtualenv-15.2.0

C:\WINDOWS\system32>python -m pip -V
pip 10.0.0 from C:\Program Files\Python36\lib\site-packages\pip (python 3.6)

C:\WINDOWS\system32>path
PATH=C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS\System32\Wbem;C:\Program Files\Python36\Scripts;C:\Program Files\Python36;

@pfmoore pfmoore deleted the distlib_027 branch April 19, 2018 08:04
@pfmoore
Copy link
Member Author

pfmoore commented Apr 19, 2018

@perfectcream The error is because pipenv depends on pip, and so could potentially upgrade pip (in this case it did). Upgrading pip when using pip.exe fails on Windows as shown, because Windows won't allow the upgrade to replace the in-use pip.exe. So when installing or upgrading pipenv, you need to run python -m pip ... rather than pip .... As you saw in your second test, this works. So this is not exactly intended behaviour, but expected due to a known OS limitation.

@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation project: vendored dependency Related to a vendored dependency type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants