ish icon indicating copy to clipboard operation
ish copied to clipboard

Pip fails

Open ifuchs opened this issue 4 years ago • 39 comments

I am trying to install several python packages using pip. All attempts to use pip (even pip list) result in:

pip list Traceback (most recent call last): File "/usr/bin/pip", line 6, in from pip._internal.cli.main import main File "/usr/lib/python3.8/site-packages/pip/_internal/init.py", line 40, in from pip._internal.cli.autocompletion import autocomplete File "/usr/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 8, in from pip._internal.cli.main_parser import create_main_parser File "/usr/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 11, in from pip._internal.commands import ( File "/usr/lib/python3.8/site-packages/pip/_internal/commands/init.py", line 6, in from pip._internal.commands.completion import CompletionCommand File "/usr/lib/python3.8/site-packages/pip/_internal/commands/completion.py", line 6, in from pip._internal.cli.base_command import Command File "/usr/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 26, in from pip._internal.index import PackageFinder ImportError: cannot import name 'PackageFinder' from 'pip._internal.index' (/usr/lib/python3.8/site-packages/pip/_internal/index/init.py)

ifuchs avatar Dec 07 '20 23:12 ifuchs

What's the output of apk list py3-pip?

62f avatar Dec 08 '20 17:12 62f

Null. (Even after apk add py3-pip).

On Tue, Dec 8, 2020 at 12:36 PM 62f [email protected] wrote:

What's the output of apk list py3-pip?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ish-app/ish/issues/1107#issuecomment-740787277, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSB4752DIXIEWSHI5B3STZPZPANCNFSM4URGAABQ .

ifuchs avatar Dec 08 '20 17:12 ifuchs

I suppose by your verbiage of "even" that you consider apk not to be of primary importance, or perhaps consider it an unrelated bug, but I must disagree to the latter. I would not have said 'even' unless I was applying some extraneous force, such as including sudo as part of the apk command. Regardless, getting pip itself to function could be academic because I am preparing to file my own issue- my pip install runs but crashes iSH. If you still demand pursuit of pip as your primary objective, try sudo python3 -m pip install foo.

62f avatar Dec 08 '20 19:12 62f

I have no preference to using a APK or PIP. I just want to be able to install pure python modules for use with python. PIP is not working for me and APK doesn't seem to have the modules I need.I tried sudo python3 -m pip install foo. Sudo does not exist and without it I get the same error as reported above.

ifuchs avatar Dec 08 '20 19:12 ifuchs

What is the output of apk info py3-pip?

tbodt avatar Dec 08 '20 19:12 tbodt

apk info py3-pip python3-3.8.2-r1 description: A high-level scripting language

python3-3.8.2-r1 webpage: https://www.python.org/

python3-3.8.2-r1 installed size: 58535936

On Tue, Dec 8, 2020 at 2:31 PM Theodore Dubois [email protected] wrote:

What is the output of apk info py3-pip?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ish-app/ish/issues/1107#issuecomment-740904863, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSBOJLXKSD5GARWD6A3STZ5J7ANCNFSM4URGAABQ .

ifuchs avatar Dec 08 '20 19:12 ifuchs

Well that's just odd. Ask for py3-pip's info and it gets Python's? Mine says:

`py3-pip-20.1.1-r0 description:pip Tool for installing and managing Python packages

py3-pip-20.1.1-r0 webpage: http://www.pip-installer.org

py3-pip-20.1.1-r0 installed size: 2285568`

62f avatar Dec 09 '20 02:12 62f

`apk info python3 python3-3.8.5-r0 description: A high-level scripting language

python3-3.8.5-r0 webpage: https://www.python.org/

python3-3.8.5-r0 installed size: 46739456`

In general, later versions of most programs take up more space than their predecessor. Ergo your 'installed size' seems paradoxical. https://alpine.pkgs.org/3.11/alpine-main-x86/python3-3.8.2-r1.apk.html Reports the correct installed size of that to be 55.82MB; which size shouldn't be off by more than a factor of 1024/1000, which at 59.94, your python3's filesize seems off by a staggering amount.

62f avatar Dec 09 '20 02:12 62f

What can I say? I’ve merely run the commands and cut/pasted the result. Perhaps I should delete and reinstall ish.

On Tue, Dec 8, 2020 at 9:51 PM 62f [email protected] wrote:

`apk info python3 python3-3.8.5-r0 description: A high-level scripting language

python3-3.8.5-r0 webpage: https://www.python.org/

python3-3.8.5-r0 installed size: 46739456`

In general, later versions of most programs take up more space than their predecessor. Ergo your 'installed size' seems paradoxical.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ish-app/ish/issues/1107#issuecomment-741491855, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSE2LKLXFTTYLW57IFTST3Q4NANCNFSM4URGAABQ .

ifuchs avatar Dec 09 '20 03:12 ifuchs

@62f I can only assume the apk for python3 includes pip.

tbodt avatar Dec 09 '20 03:12 tbodt

@tbodt what do you recommend I do to get pip working so that I can install python modules?

ifuchs avatar Dec 09 '20 03:12 ifuchs

Dunno, apk add py3-pip has always worked for me. Could you export your filesystem and send it to me so I can debug?

tbodt avatar Dec 09 '20 03:12 tbodt

That would be tricky as there are some files with confidential information. Is there a way to leave out a directory?

On Tue, Dec 8, 2020 at 10:37 PM Theodore Dubois [email protected] wrote:

Dunno, apk add py3-pip has always worked for me. Could you export your filesystem and send it to me so I can debug?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ish-app/ish/issues/1107#issuecomment-741505332, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSH2G4YZP2QU7TQ5MODST3WHJANCNFSM4URGAABQ .

ifuchs avatar Dec 09 '20 03:12 ifuchs

Not easily. I think the best you can do is export the filesystem, reimport it (making a copy), delete anything confidential, and export it again. Definitely don't send me anything confidential.

tbodt avatar Dec 09 '20 03:12 tbodt

How to send it to you (it will presumably be a large file).

On Dec 8, 2020, at 10:48 PM, Theodore Dubois [email protected] wrote:

Not easily. I think the best you can do is export the filesystem, reimport it (making a copy), delete anything confidential, and export it again. Definitely don't send me anything confidential.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ish-app/ish/issues/1107#issuecomment-741508095, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSASN3QFKQ76RHT3OC3ST3XQFANCNFSM4URGAABQ.

ifuchs avatar Dec 09 '20 03:12 ifuchs

I must disagree with that solution. It sounds much too cumbersome and far too involved. There is another way... if you can see it.

62f avatar Dec 09 '20 08:12 62f

And what might that be? On Wed, Dec 9, 2020 at 3:51 AM 62f [email protected] wrote:

I must disagree with that solution. It sounds much too cumbersome and far too involved. There is another way... if you can see it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ish-app/ish/issues/1107#issuecomment-741628430, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSABEQK22LFF2SWFXMLST4273ANCNFSM4URGAABQ .

ifuchs avatar Dec 09 '20 12:12 ifuchs

Try: apk verify py3-pip If something is off try: apk del py3-pip Then apk add py3-pip If that does not help apk del python3 Then apk add python3

gitdev-bash avatar Dec 10 '20 14:12 gitdev-bash

Thanks but none of that helped. Each of those commands simply returns with OK:653Mib in 131 packages. I think my only remaining option is to delete and reinstall the app. Hopefully I can export the filesystem and after reinstalling get my personal files back.

ifuchs avatar Dec 10 '20 14:12 ifuchs

Here's a hint for that path: export the fs and recheck the tar.gz TWICE by reimporting it BEFORE launching your iSH-reinstall nuke. I've had bad fs-exports before. Along with a wipe and reload, you may consider switching to the new AppStore version which now includes apk, and then clone your file system into that.

62f avatar Dec 10 '20 16:12 62f

I decided that I would uninstall the ish app and reinstall the appstore version. I was able to 'apk add py3-pip' to get python3 and pip. Then I tried to 'pip3 install alpha_vantage' and got errors as follows:

Building wheel for yarl (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pep517/_in_process.py build_wheel /tmp/tmpk_12e5fe
       cwd: /tmp/pip-install-7z1y34xr/yarl
  Complete output (38 lines):
  **********************
  * Accellerated build *
  **********************
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-i686-3.8
  creating build/lib.linux-i686-3.8/yarl
  copying yarl/_url.py -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting_py.py -> build/lib.linux-i686-3.8/yarl
  copying yarl/__init__.py -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting.py -> build/lib.linux-i686-3.8/yarl
  running egg_info
  writing yarl.egg-info/PKG-INFO
  writing dependency_links to yarl.egg-info/dependency_links.txt
  writing requirements to yarl.egg-info/requires.txt
  writing top-level names to yarl.egg-info/top_level.txt
  reading manifest file 'yarl.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.cache' found anywhere in distribution
  warning: no previously-included files found matching 'yarl/*.html'
  warning: no previously-included files found matching 'yarl/*.so'
  warning: no previously-included files found matching 'yarl/*.pyd'
  no previously-included directories found matching 'docs/_build'
  writing manifest file 'yarl.egg-info/SOURCES.txt'
  copying yarl/__init__.pyi -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting_c.c -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting_c.pyi -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting_c.pyx -> build/lib.linux-i686-3.8/yarl
  copying yarl/py.typed -> build/lib.linux-i686-3.8/yarl
  running build_ext
  building 'yarl._quoting_c' extension
  creating build/temp.linux-i686-3.8
  creating build/temp.linux-i686-3.8/yarl
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c yarl/_quoting_c.c -o build/temp.linux-i686-3.8/yarl/_quoting_c.o
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ----------------------------------------
  ERROR: Failed building wheel for multidict
  Building wheel for yarl (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pep517/_in_process.py build_wheel /tmp/tmpnijky6ss
       cwd: /tmp/pip-install-d9vc1bw2/yarl
  Complete output (38 lines):
  **********************
  * Accellerated build *
  **********************
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-i686-3.8
  creating build/lib.linux-i686-3.8/yarl
  copying yarl/_url.py -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting_py.py -> build/lib.linux-i686-3.8/yarl
  copying yarl/__init__.py -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting.py -> build/lib.linux-i686-3.8/yarl
  running egg_info
  writing yarl.egg-info/PKG-INFO
  writing dependency_links to yarl.egg-info/dependency_links.txt
  writing requirements to yarl.egg-info/requires.txt
  writing top-level names to yarl.egg-info/top_level.txt
  reading manifest file 'yarl.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.cache' found anywhere in distribution
  warning: no previously-included files found matching 'yarl/*.html'
  warning: no previously-included files found matching 'yarl/*.so'
  warning: no previously-included files found matching 'yarl/*.pyd'
  no previously-included directories found matching 'docs/_build'
  writing manifest file 'yarl.egg-info/SOURCES.txt'
  copying yarl/__init__.pyi -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting_c.c -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting_c.pyi -> build/lib.linux-i686-3.8/yarl
  copying yarl/_quoting_c.pyx -> build/lib.linux-i686-3.8/yarl
  copying yarl/py.typed -> build/lib.linux-i686-3.8/yarl
  running build_ext
  building 'yarl._quoting_c' extension
  creating build/temp.linux-i686-3.8
  creating build/temp.linux-i686-3.8/yarl
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c yarl/_quoting_c.c -o build/temp.linux-i686-3.8/yarl/_quoting_c.o
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for yarl
Failed to build multidict yarl
ERROR: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly

ifuchs avatar Dec 15 '20 01:12 ifuchs

You're lucky, in my one device in which pip actually got (others didn't) as far as trying for PEP 517, all it did is crash after depletion (see issue) of resources CPU/RAM (memory?), and since it was taking a couple of days to process per attempt, I gave up trying.

62f avatar Dec 15 '20 16:12 62f

The command is now pip3

dontbanmeplz avatar Dec 15 '20 22:12 dontbanmeplz

Not quite. @dontbanmeplz the command is now pip3.8

62f avatar Dec 16 '20 06:12 62f

Not quite. sudo python3 -m pip3 foo doesn’t function. pip3 worked when py3 and py2 coexisted. Now they’re both present, but since py2 has been deprecated, pip3 no longer works as it once did. They’re mostly the same script, & yet function a tad different. A tiny, but significant smidgen.

62f avatar Dec 16 '20 06:12 62f

@gitdev-bash I tried your suggestion myself, even though pip ‘runs’ in my system, but I don’t even get as far as the issue’s OP did.

ERROR: py3-pip: No such file or directory

62f avatar Dec 16 '20 14:12 62f

Can anyone suggest a way past the above error while installing alpha_vantage:

Failed to build multidict yarl ERROR: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly

ifuchs avatar Dec 22 '20 01:12 ifuchs

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c yarl/_quoting_c.c -o build/temp.linux-i686-3.8/yarl/_quoting_c.o yarl/_quoting_c.c:4:10: fatal error: Python.h: No such file or directory 4 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1 Building wheel for yarl (PEP 517) ... error ERROR: Failed building wheel for yarl Failed to build multidict yarl ERROR: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly Exception information: Traceback (most recent call last): File "/home/ish/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 224, in _main status = self.run(options, args) File "/home/ish/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper return func(self, options, args) File "/home/ish/.local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 361, in run raise InstallationError( pip._internal.exceptions.InstallationError: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly (06:06 ish /~)-> dmesg (13:45 ish /~)-> I don't see any problem c. iSH itself & suggest closing the issue.

62f avatar Dec 22 '20 14:12 62f

I don’t understand. Are you saying this can’t be done and it has nothing to do with ish? It works on Pythonista, Pyto, and Carnet so if it’s not an ish issue, what is it?

On Tue, Dec 22, 2020 at 9:22 AM 62f [email protected] wrote:

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c yarl/_quoting_c.c -o build/temp.linux-i686-3.8/yarl/_quoting_c.o yarl/_quoting_c.c:4:10: fatal error: Python.h: No such file or directory 4 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1 Building wheel for yarl (PEP 517) ... error ERROR: Failed building wheel for yarl Failed to build multidict yarl ERROR: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly Exception information: Traceback (most recent call last): File "/home/ish/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 224, in _main status = self.run(options, args) File "/home/ish/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper return func(self, options, args) File "/home/ish/.local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 361, in run raise InstallationError( pip._internal.exceptions.InstallationError: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly (06:06 ish /)-> dmesg (13:45 ish /)-> I don't see any problem c. iSH itself & suggest closing the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ish-app/ish/issues/1107#issuecomment-749563287, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSFAJWU77M4OFZKXR5DSWCTRJANCNFSM4URGAABQ .

ifuchs avatar Dec 22 '20 14:12 ifuchs

PyPI contains binary wheels for Linux, Windows and MacOS. If you want to install yarl on another operating system (like Alpine Linux, which is not manylinux-compliant because of the missing glibc and therefore, cannot be used with our wheels) the the tarball will be used to compile the library from the source code. It REQUIRES a C COMPILER and and Python headers installed. from https://libraries.io/conda/yarl sudo apk add g++ py3-ruamel.std.pathlib py3-urllib3 py3-rtslib py3-requests-oauthlib py3-jsonrpclib py3-contextlib2 py3-html5lib py3-hglib py3-ruamel.yaml.clib py3-liblarch py3-importlib-metadata py3-xlib py3-libmount py3-libblockdev py3-matplotlib py3-apache-libcloud py3-polib py3-pyftpdlib py3-libgpiod py3-pathlib2 py3-libvirt py3-openzwave-lib py3-google-auth-httplib2 py3-ufolib2 py3-libplist py3-sgmllib3k py3-httplib2 py3-flask-oauthlib py3-libpwquality py3-oauthlib py3-distlib py3-pyutilib py3-libproxy py3-libxml2 py3-libteam Right lib ought to be in there somewheres, but if not: apk search py3| grep lib

62f avatar Dec 22 '20 18:12 62f