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

Upgraded pip not used #10

Closed
jayvdb opened this issue Oct 23, 2019 · 8 comments · Fixed by #13
Closed

Upgraded pip not used #10

jayvdb opened this issue Oct 23, 2019 · 8 comments · Fixed by #13

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Oct 23, 2019

See You are using pip version 9.0.1, however version 19.3.1 is available. in

> vpip install -g story
building venv at /home/jayvdb/.vpip/pkg_venvs/story
Collecting pip
  Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-19.3.1
Collecting story
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/ab/0d/35476f94059d480573ddd46b84f318721d9de8bc120d763cf11fd831d1ab/story-0.21.2.tar.gz (76kB)
    100% |████████████████████████████████| 81kB 499kB/s 
Collecting click-completion==0.5.1 (from story)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/77/fd/2d7ec2b86cd4d487abf0b13dce58e98413096c45b9645470be0cb8de6ff2/click-completion-0.5.1.tar.gz
Collecting click-help-colors==0.5 (from story)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/4e/88/10c3472e038bad3a504496df1cb657a8caf505b5cf4c6b95f3cae4cd4b10/click-help-colors-0.5.tar.gz
Collecting click-spinner==0.1.8 (from story)
  Cache entry deserialization failed, entry ignored
Requirement already satisfied: click==7.0 in /usr/lib/python2.7/site-packages (from story)
Collecting emoji==0.5.0 (from story)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/47/e7/cf76e0774b13459e61ffe16a042a35f42e292aeebba060b919c05b0854ab/emoji-0.5.0.tar.gz
Collecting raven==6.9.0 (from story)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/11/3a/b3e46b279b8bdd9eb55857d0e95044cad31732c80f628bb75e1e9e881a32/raven-6.9.0-py2.py3-none-any.whl
Requirement already satisfied: requests~=2.20 in /usr/lib/python2.7/site-packages (from story)
Collecting storyscript==0.25.2 (from story)
  Cache entry deserialization failed, entry ignored
  Could not find a version that satisfies the requirement storyscript==0.25.2 (from story) (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.14, 0.0.15, 0.0.16, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.4.2, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.18.0)
No matching distribution found for storyscript==0.25.2 (from story)
You are using pip version 9.0.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Traceback (most recent call last):
  File "/usr/bin/vpip", line 11, in <module>
    load_entry_point('vpip==0.2.3', 'console_scripts', 'vpip')()
  File "/usr/lib/python3.7/site-packages/vpip/cli.py", line 57, in cli
    module.run(ns)
  File "/usr/lib/python3.7/site-packages/vpip/commands/install.py", line 33, in run
    install_global(ns.PACKAGE)
  File "/usr/lib/python3.7/site-packages/vpip/commands/install.py", line 59, in install_global
    pip_api.install(pkg, upgrade=upgrade, latest=latest)
  File "/usr/lib/python3.7/site-packages/vpip/pip_api.py", line 39, in install
    execute_pip("{} {}".format(cmd, package))
  File "/usr/lib/python3.7/site-packages/vpip/pip_api.py", line 119, in execute_pip
    return execute(prefix + cmd, capture)
  File "/usr/lib/python3.7/site-packages/vpip/execute.py", line 30, in execute
    list(do_execute())
  File "/usr/lib/python3.7/site-packages/vpip/execute.py", line 27, in do_execute
    raise subprocess.CalledProcessError(process.returncode, cmd)
subprocess.CalledProcessError: Command 'python -m pip install story' returned non-zero exit status 1.
@eight04
Copy link
Owner

eight04 commented Oct 23, 2019

I also failed at installing story but it is a different error.

building venv at C:\Users\Owner\.vpip\pkg_venvs\story
Collecting pip
  Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b
0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-19.3.1
Collecting story
  Downloading https://files.pythonhosted.org/packages/d5/30/8edeadc7b03457aafd7f
e9c850071ddcd09b25c376da7cbe539c54a0d44c/story-0.21.4.tar.gz (76kB)
     |█████████████████               | 40kB 327kB/s eta 0:00:0
     |█████████████████████▌          | 51kB 363kB/s eta 0
     |██████████████████████████      | 61kB 435kB/s e
     |██████████████████████████████  | 71kB 508kB
     |████████████████████████████████| 81kB 525
kB/s
Collecting click-completion==0.5.1
  Downloading https://files.pythonhosted.org/packages/77/fd/2d7ec2b86cd4d487abf0
b13dce58e98413096c45b9645470be0cb8de6ff2/click-completion-0.5.1.tar.gz
Collecting click-help-colors==0.5
  Downloading https://files.pythonhosted.org/packages/f8/a2/bbd2b60ba4f82048613b
480a373339753539f77e243fae74340ac6410384/click_help_colors-0.5-py3-none-any.whl
Collecting click-spinner==0.1.8
  Downloading https://files.pythonhosted.org/packages/4d/c4/e4cc6595266021b549f7
74a20329188e68b63f06896eba94c1c952027c6e/click-spinner-0.1.8.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Owner\.vpip\pkg_venvs\story\Scripts\python.exe' -c 'impo
rt sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owner\\AppData\\Loca
l\\Temp\\pip-install-938uiisd\\click-spinner\\setup.py'"'"'; __file__='"'"'C:\\U
sers\\Owner\\AppData\\Local\\Temp\\pip-install-938uiisd\\click-spinner\\setup.py
'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace(
'"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"
'"'))' egg_info --egg-base 'C:\Users\Owner\AppData\Local\Temp\pip-install-938uii
sd\click-spinner\pip-egg-info'
         cwd: C:\Users\Owner\AppData\Local\Temp\pip-install-938uiisd\click-spinn
er\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Owner\AppData\Local\Temp\pip-install-938uiisd\click-spinner
\setup.py", line 6, in <module>
        readme = f.read()
    UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 373: il
legal multibyte sequence
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
e logs for full command output.
Traceback (most recent call last):
  File "c:\users\owner\appdata\local\programs\python\python37\lib\runpy.py", lin
e 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\owner\appdata\local\programs\python\python37\lib\runpy.py", lin
e 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Owner\AppData\Local\Programs\Python\Python37\Scripts\vpip.exe\_
_main__.py", line 9, in <module>
  File "c:\users\owner\appdata\local\programs\python\python37\lib\site-packages\
vpip\cli.py", line 57, in cli
    module.run(ns)
  File "c:\users\owner\appdata\local\programs\python\python37\lib\site-packages\
vpip\commands\install.py", line 33, in run
    install_global(ns.PACKAGE)
  File "c:\users\owner\appdata\local\programs\python\python37\lib\site-packages\
vpip\commands\install.py", line 59, in install_global
    pip_api.install(pkg, upgrade=upgrade, latest=latest)
  File "c:\users\owner\appdata\local\programs\python\python37\lib\site-packages\
vpip\pip_api.py", line 39, in install
    execute_pip("{} {}".format(cmd, package))
  File "c:\users\owner\appdata\local\programs\python\python37\lib\site-packages\
vpip\pip_api.py", line 119, in execute_pip
    return execute(prefix + cmd, capture)
  File "c:\users\owner\appdata\local\programs\python\python37\lib\site-packages\
vpip\execute.py", line 30, in execute
    list(do_execute())
  File "c:\users\owner\appdata\local\programs\python\python37\lib\site-packages\
vpip\execute.py", line 27, in do_execute
    raise subprocess.CalledProcessError(process.returncode, cmd)
subprocess.CalledProcessError: Command 'python -m pip install story' returned no
n-zero exit status 1.

I can't reproduce this issue on Windows. Can you verify if vpip has executed the correct python binary?

def execute_pip(cmd, capture=False):

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 23, 2019

Your failure is due to invoking in cp950 , code pages 950, and is a common Windows problem. I havent looked at all of the logic yet, so I dont know if this is possible in vpip, but I suspect that group of problems can be solved by vpip setting the code page to 65001 (utf8), and/or set envvar PYTHONIOENCODING=utf8 before invoking an inner python runtime, so that it defaults to utf8 when none is explicitly requested.

@eight04
Copy link
Owner

eight04 commented Oct 23, 2019

It is a default encoding problem with open. I've filed an issue here: click-contrib/click-spinner#28

I can't reproduce this issue on Windows

To clarify, I can't reproduce this issue with other packages e.g. grip, youtube-dl.

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 23, 2019

Ya, this is a problem with a specific package, but it is a common one, so common that you might want to solve it in vpip for Windows users who dont run their cmd in utf-8 code page. I see the exact same problem on linux VM's when LANG isnt set. To give you an idea of the size of the problem, if you disable wheels, you will very likely find the same problem with all of amqpstorm, baron, bidict, blindspin, cbor2, convertdate, digitalocean, djangorestframework-simplejwt, ephem, httpbin, HTTPolice, jira, jsonextended, mocket, openapi-core, Parsley, pprintpp, pylama, pyroma, pyVows, requirementslib, rope, simplebayes, socketpool, tap.py wakeonlan, whois_similarity_distance, xmltodict, xxhash, yacron. That is based on a quick text analysis of one group of ~1700 packages. And of course those packages failing causes any package which uses them to also fail.

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 23, 2019

I can't reproduce this issue on Windows. Can you verify if vpip has executed the correct python binary?

execute_pip is executing python, but often it appears to be executing the python outside the created venv, which on my system is Python 2, not the Python 3 I am using to invoke vpip. If I change execute_pip to use python3 instead of python, the "You are using pip version 9.0.1, however version 19.3.1 is available." error doesnt appear, but then I encounter the problems at #11 (comment)

@eight04
Copy link
Owner

eight04 commented Oct 23, 2019

I think there are some problems with the path, which should use : as the separator:

self.path = "{};{}".format(

return ";".join(p for p in re.split("\s*;\s*", path)

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 23, 2019

Ya, that would be part of it. I'm testing a fix for that now.

jayvdb added a commit to jayvdb/vpip that referenced this issue Oct 23, 2019
@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 23, 2019

That fixed it, and the python -> python3 hack was no longer needed.

eight04 pushed a commit that referenced this issue Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants