I have an empty Python 3.10 virtual environment activated. I install grpcio like so:
% pip install 'grpcio<1.45.0,>=1.43.0'
Collecting grpcio<1.45.0,>=1.43.0
Using cached grpcio-1.44.0-cp310-cp310-macosx_10_10_universal2.whl (4.1 MB)
Collecting six>=1.5.2
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, grpcio
Successfully installed grpcio-1.44.0 six-1.16.0
WARNING: You are using pip version 21.2.4; however, version 22.3 is available.
You should consider upgrading via the '.../bin/python3.10 -m pip install --upgrade pip' command.
Unfortunately, this universal grpcio-1.44.0-cp310-cp310-macosx_10_10_universal2.whl wheel seems to be broken (architecture mismatch):
% python -c "import grpc"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../lib/python3.10/site-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File ".../lib/python3.10/site-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: dlopen(.../lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): tried: '.../lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))), '.../.pyenv/versions/3.10.2/envs/.../lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
I want to remove it. But apparently it isn't in my cache:
% pip cache list | grep grpc
- grpcio-1.44.0-cp39-cp39-macosx_12_0_arm64.whl (3.6 MB)
- grpcio-1.44.0-cp39-cp39-macosx_12_0_arm64.whl (3.7 MB)
- grpcio-1.44.0-cp39-cp39-macosx_12_0_arm64.whl (3.7 MB)
- grpcio-1.46.0rc2-cp39-cp39-macosx_12_0_arm64.whl (3.7 MB)
- grpcio-1.46.1-cp39-cp39-macosx_12_0_arm64.whl (3.7 MB)
- grpcio-1.46.3-cp38-cp38-macosx_12_0_arm64.whl (3.7 MB)
- grpcio-1.46.3-cp39-cp39-macosx_12_0_arm64.whl (3.7 MB)
- grpcio-1.48.0rc1-cp39-cp39-macosx_12_0_arm64.whl (3.9 MB)
- grpcio-1.50.0-cp310-cp310-macosx_12_0_arm64.whl (4.0 MB)
That's the stuff in ~/Library/Caches/pip, but the universal wheel isn't there.
Where can I look for this universal cached wheel to get rid of it?
UPDATE:
I've been running pip in the debugger, and I'm seeing that in pip._internal.index.package_finder.find_all_candidates(), page_candidates has 189 items in it, including one for https://files.pythonhosted.org/packages/53/73/972df49733bc60f77452efcbb7ba087fcfe89b432f7d0c9fad68544d56ef/grpcio-1.44.0-cp310-cp310-macosx_10_10_universal2.whl - but file_candidates is an empty list. Is the pip output perhaps just lying about whether it was found in the cache?