Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

pip install fails on platforms without binary wheels #18

Closed
AgentConDier opened this issue Oct 29, 2022 · 4 comments
Closed

pip install fails on platforms without binary wheels #18

AgentConDier opened this issue Oct 29, 2022 · 4 comments

Comments

@AgentConDier
Copy link

I'm running mitmdump inside Termux. While trying to update to the latest version, the mitmproxy-wireguard wheel failed to build locally:

~ $ pip install -U --upgrade-strategy eager mitmproxy
Requirement already satisfied: mitmproxy in /data/data/com.termux/files/usr/lib/python3.10/site-packages (8.1.1)
Collecting mitmproxy
  Using cached mitmproxy-9.0.0-py3-none-any.whl (1.6 MB)
Requirement already satisfied: wsproto<1.3,>=1.0 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (1.1.0)
Collecting wsproto<1.3,>=1.0
  Using cached wsproto-1.2.0-py3-none-any.whl (24 kB)
Requirement already satisfied: urwid<2.2,>=2.1.1 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (2.1.2)
Requirement already satisfied: pyperclip<1.9,>=1.6.0 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (1.8.2)
Collecting pyOpenSSL<22.2,>=22.1
  Using cached pyOpenSSL-22.1.0-py3-none-any.whl (57 kB)
Requirement already satisfied: msgpack<1.1.0,>=1.0.0 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (1.0.4)
Requirement already satisfied: asgiref<3.6,>=3.2.10 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (3.5.2)
Requirement already satisfied: flask<2.3,>=1.1.1 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (2.1.2)
Collecting flask<2.3,>=1.1.1
  Using cached Flask-2.2.2-py3-none-any.whl (101 kB)
Requirement already satisfied: hyperframe<7,>=6.0 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (6.0.1)
Requirement already satisfied: protobuf<5,>=3.14 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (4.21.2)
Collecting protobuf<5,>=3.14
  Using cached protobuf-4.21.9-py3-none-any.whl (291 kB)
Requirement already satisfied: pyparsing<3.1,>=2.4.2 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (3.0.9)
Requirement already satisfied: ruamel.yaml<0.18,>=0.16 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (0.17.21)
Requirement already satisfied: sortedcontainers<2.5,>=2.3 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (2.4.0)
Requirement already satisfied: passlib<1.8,>=1.6.5 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (1.7.4)
Requirement already satisfied: zstandard<0.19,>=0.11 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (0.18.0)
Collecting cryptography<38.1,>=38.0
  Using cached cryptography-38.0.1.tar.gz (599 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: h11<0.15,>=0.11 in /data/data/com.termux/files/usr/lib/python3.10/site-packages (from mitmproxy) (0.12.0)
Collecting h11<0.15,>=0.11
  Downloading h11-0.14.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 852.4 kB/s eta 0:00:00
Collecting mitmproxy-wireguard<0.2,>=0.1.6
  Using cached mitmproxy_wireguard-0.1.14.tar.gz (25 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
   exit code: 1
  ╰─> [12 lines of output]
      💥 maturin failed
        Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
        Caused by: `cargo metadata` exited with an error: error: failed to load manifest for workspace member `/data/data/com.termux/files/usr/tmp/pip-install-fyxt3ct_/mitmproxy-wireguard_05d31e8eb7024923b70ca8f0f700dfe5/test-client`
      
      Caused by:
        failed to read `/data/data/com.termux/files/usr/tmp/pip-install-fyxt3ct_/mitmproxy-wireguard_05d31e8eb7024923b70ca8f0f700dfe5/test-client/Cargo.toml`
      
      Caused by:
        No such file or directory (os error 2)
      Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-_vzn0zuw', '--interpreter', '/data/data/com.termux/files/usr/bin/python3']' returned non-zero exit status 1.
      Checking for Rust toolchain....
      Running `maturin pep517 write-dist-info --metadata-directory /data/data/com.termux/files/usr/tmp/pip-modern-metadata-_vzn0zuw --interpreter /data/data/com.termux/files/usr/bin/python3`
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip available: 22.2.2 -> 22.3
[notice] To update, run: pip install --upgrade pip

My best guess would be that this happens because

"test-client",

is included in the PyPi source archive, but the test client code isn't.

Software versions:

~ $ rustc -Vv
rustc 1.64.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: aarch64-linux-android
release: 1.64.0
LLVM version: 15.0.1
~ $ python --version
Python 3.10.8
~ $ maturin --version
maturin 0.13.7
@AgentConDier
Copy link
Author

I can confirm that after removing the test-client line from Cargo.toml, pip is able to install from the source archive just fine.

@AgentConDier AgentConDier changed the title pip install fails in Termux pip install fails on platforms without binary wheels Oct 29, 2022
@decathorpe
Copy link
Owner

Oh dear, this looks like a bug in maturin (the tool we use for building / publishing sdist and binary wheels). The [workspace] table should either be dropped, or the test-client directory should be included ... I'll try to figure out how to work around this problem.

@decathorpe
Copy link
Owner

I've tagged and published a new version that should contain a workaround for this problem:

It would be great if you could confirm that this actually fixes the problem for you, as well.

@AgentConDier
Copy link
Author

Yes, it's building successfully now for me. Thanks for the quick fix!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants