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

Mac: Could not find METADATA file when installing #81

Closed
uilianries opened this issue May 18, 2022 · 4 comments
Closed

Mac: Could not find METADATA file when installing #81

uilianries opened this issue May 18, 2022 · 4 comments

Comments

@uilianries
Copy link

For some reason, when running pip install -U pip, or even trying to upgrade platformsdirs directly, it fails during the installation due METADATA missing. Initially, I thought it was a permission flaw on my side (missing write permission on that folder), however, I noted that Metadata was changed on the latest release.

It may be related to #75

System information

OS: MacOS
Arch: amd64
Python version: 3.8.12 (but occurs on Python 3.9 too)
Platformdirs version: 2.5.2

Steps to reproduce

PYVER=py38
TEST_FOLDER="${TMPDIR}/${PYVER}"
mkdir -p ${TEST_FOLDER} || echo "ok"
python -m pip install tox==3.7.0 tox-venv==0.3.1 requests
python -m venv ${TEST_FOLDER}
source ${TEST_FOLDER}/bin/activate
python --version
which python
python -m pip install --upgrade platformdirs
python -m pip install --upgrade pip

Logs

+ python --version
Python 3.8.12
+ python -m pip install --upgrade platformdirs
Requirement already satisfied: platformdirs in /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages (2.5.2)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/platformdirs-2.5.2.dist-info/METADATA'

You can obtain the full log here: https://ci.conan.io/blue/organizations/jenkins/Hooks/detail/PR-419/2/pipeline/

@gaborbernat
Copy link
Contributor

Run:

python -m pip install --upgrade platformdirs --force-reinstall -vvv

And come back with output.

@ericLemanissier
Copy link

ericLemanissier commented May 18, 2022

tested in https://ci.conan.io/blue/organizations/jenkins/Hooks/detail/PR-418/9/pipeline/22#step-25-log-53

python -m pip install --upgrade platformdirs --force-reinstall -vvv


Using pip 22.1 from /var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip (python 3.8)

Non-user install because user site-packages disabled

Created temporary directory: /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-ephem-wheel-cache-6c590mku

Created temporary directory: /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-build-tracker-o9ycw4o4

Initialized build tracking at /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-build-tracker-o9ycw4o4

Created build tracker: /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-build-tracker-o9ycw4o4

Entered build tracker: /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-build-tracker-o9ycw4o4

Created temporary directory: /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-install-qr70ib3l

1 location(s) to search for versions of platformdirs:

* https://pypi.org/simple/platformdirs/

Fetching project page and analyzing links: https://pypi.org/simple/platformdirs/

Getting page https://pypi.org/simple/platformdirs/

Found index url https://pypi.org/simple

Looking up "https://pypi.org/simple/platformdirs/" in the cache

Request header has "max_age" as 0, cache bypassed

Starting new HTTPS connection (1): pypi.org:443

[https://pypi.org:443](https://pypi.org/) "GET /simple/platformdirs/ HTTP/1.1" 304 0

  Found link https://files.pythonhosted.org/packages/f2/23/c1404aae1c9b873ad72e13a379e687c562217a8f3d9966daa597b44cb409/platformdirs-2.0.0a1-py2.py3-none-any.whl#sha256=3863321f24fa453f17c21576f42e2053f5a83f87a7cdcce83ed417de842969ce (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.0a1

  Found link https://files.pythonhosted.org/packages/a0/b2/8385f87ea82fa9ac21befdfc3a53faad7e2824c345fb8a1499c55e6f805b/platformdirs-2.0.0a1.tar.gz#sha256=f2d5ff72e78fbccab5b0a0f3393a331e881dccd335507fda3f865ff9a1551767 (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.0a1

  Found link https://files.pythonhosted.org/packages/f3/77/b4da4439d8f0b405d3f7786e7cc963328aaaf245557562c7796992fe0347/platformdirs-2.0.0a2-py2.py3-none-any.whl#sha256=77d6856c1af18dab217d5020fdde8fb0539c3f18d5d82f08e72ac875d78533f8 (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.0a2

  Found link https://files.pythonhosted.org/packages/01/75/c078aac4c0a8fb1aef076780ae60a771e626b5e68e40464a0c14f007e561/platformdirs-2.0.0a2.tar.gz#sha256=0580c1effd7a00d4f75f6f345f53b96ec0bf866507d75b8e59820a2d7683ada3 (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.0a2

  Found link https://files.pythonhosted.org/packages/2c/48/bd2bb37da0518e190c892f1e3a8cae3ed6c366511f576e37708bab6e6a6d/platformdirs-2.0.0a3-py2.py3-none-any.whl#sha256=a26d4732214a64552e78752187732ddeda8c76ab0ab1dbf30935d967961cb028 (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.0a3

  Found link https://files.pythonhosted.org/packages/b7/68/53f1b08abdacd9ba4478090970b2b6fbfdfc82933801c26f23c4f53aa035/platformdirs-2.0.0a3.tar.gz#sha256=d982848684555a2ffc9f51d6c28b94062624f5e2600328e326e937fc75f7a14c (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.0a3

  Found link https://files.pythonhosted.org/packages/88/c4/71ec865898efd2473c7d17d91b95d90e7de5cef9353d42b82c7c5a477d83/platformdirs-2.0.0-py2.py3-none-any.whl#sha256=c4d969c6d051f37548994641338c74f3125b771e8fbbe4a45d60d4a976e34533 (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.0

  Found link https://files.pythonhosted.org/packages/78/2e/08c596d570bf3f53881d43306c9d88bd60b78532ca232ff59645f586b102/platformdirs-2.0.0.tar.gz#sha256=9fc2bc9a5f04bfd5b12c1edb64394f6108c17b2a5be0a461f9a8b08c8a7d8991 (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.0

  Found link https://files.pythonhosted.org/packages/12/57/f4e6d433fba8bde239baa65f626a31fc6d0556a2065fcc81aaa0f4f1507b/platformdirs-2.0.2-py2.py3-none-any.whl#sha256=0b9547541f599d3d242078ae60b927b3e453f0ad52f58b4d4bc3be86aed3ec41 (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.2

  Found link https://files.pythonhosted.org/packages/c1/03/1dcc356abdfbe22bec1194852b02ed809c8bdf91e416b26f17f485c62984/platformdirs-2.0.2.tar.gz#sha256=3b00d081227d9037bbbca521a5787796b5ef5000faea1e43fd76f1d44b06fcfa (from https://pypi.org/simple/platformdirs/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*), version: 2.0.2

  Found link https://files.pythonhosted.org/packages/7e/2e/13312b1a9e49c711512b3a3eef92249e8610ae8ae6837fd1b61a0df99bfc/platformdirs-2.1.0-py3-none-any.whl#sha256=b2b30ae52404f93e2024e85bba29329b85715d6b2f18ffe90ecd25a5c67553df (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.6), version: 2.1.0

  Found link https://files.pythonhosted.org/packages/66/0d/e489482b5dc9530007a7ec3a3ce4308c3b0c802bd9bdda1da38202315f11/platformdirs-2.1.0.tar.gz#sha256=1964be5aba107a7ccb7de0e6f1f1bfde0dee51641f0e733028121f8e02e2e16b (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.6), version: 2.1.0

  Found link https://files.pythonhosted.org/packages/a5/a6/45f6d6b848d7ac273f261b35ed048ea8f301d2ec0594fbcf7616b4012f45/platformdirs-2.2.0-py3-none-any.whl#sha256=4666d822218db6a262bdfdc9c39d21f23b4cfdb08af331a81e92751daf6c866c (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.6), version: 2.2.0

  Found link https://files.pythonhosted.org/packages/58/cb/ee4234464290e3dee893cf37d1adc87c24ade86ff6fc55f04a9bf9f1ec4f/platformdirs-2.2.0.tar.gz#sha256=632daad3ab546bd8e6af0537d09805cec458dce201bccfe23012df73332e181e (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.6), version: 2.2.0

  Found link https://files.pythonhosted.org/packages/15/4d/23989bdcb80a095a4b92a54a1f568e95bfc9793c70707be623dc75c11257/platformdirs-2.3.0-py3-none-any.whl#sha256=8003ac87717ae2c7ee1ea5a84a1a61e87f3fbd16eb5aadba194ea30a9019f648 (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.6), version: 2.3.0

  Found link https://files.pythonhosted.org/packages/e2/d4/c6ffe89de09851892b1418dc22f6ab019b7b6f362532ab813c262e1722bb/platformdirs-2.3.0.tar.gz#sha256=15b056538719b1c94bdaccb29e5f81879c7f7f0f4a153f46086d155dffcd4f0f (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.6), version: 2.3.0

  Found link https://files.pythonhosted.org/packages/b1/78/dcfd84d3aabd46a9c77260fb47ea5d244806e4daef83aa6fe5d83adb182c/platformdirs-2.4.0-py3-none-any.whl#sha256=8868bbe3c3c80d42f20156f22e7131d2fb321f5bc86a2a345375c6481a67021d (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.6), version: 2.4.0

  Found link https://files.pythonhosted.org/packages/4b/96/d70b9462671fbeaacba4639ff866fb4e9e558580853fc5d6e698d0371ad4/platformdirs-2.4.0.tar.gz#sha256=367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2 (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.6), version: 2.4.0

  Found link https://files.pythonhosted.org/packages/9f/3d/4606ee54e0af98aa8f9a672b5acfd69318a5917fbb9f8e2c3aaf9c2f293f/platformdirs-2.4.1-py3-none-any.whl#sha256=1d7385c7db91728b83efd0ca99a5afb296cab9d0ed8313a45ed8ba17967ecfca (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.7), version: 2.4.1

  Found link https://files.pythonhosted.org/packages/be/00/bd080024010e1652de653bd61181e2dfdbef5fa73bfd32fec4c808991c31/platformdirs-2.4.1.tar.gz#sha256=440633ddfebcc36264232365d7840a970e75e1018d15b4327d11f91909045fda (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.7), version: 2.4.1

  Found link https://files.pythonhosted.org/packages/63/ab/58f9554b0ec477e9eb014f177a3ac4bdacb1268cf9f008eccfeea35c452b/platformdirs-2.5.0-py3-none-any.whl#sha256=30671902352e97b1eafd74ade8e4a694782bd3471685e78c32d0fdfd3aa7e7bb (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.7), version: 2.5.0

  Found link https://files.pythonhosted.org/packages/47/73/046da71a75870bbcc0469e2ea71b56ffc865e2b4b39337754e8fdb516028/platformdirs-2.5.0.tar.gz#sha256=8ec11dfba28ecc0715eb5fb0147a87b1bf325f349f3da9aab2cd6b50b96b692b (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.7), version: 2.5.0

  Found link https://files.pythonhosted.org/packages/de/de/d8b9da351517c3dece273224522d4714cfdb9a89e2e6f7f7f054a340cc2b/platformdirs-2.5.1-py3-none-any.whl#sha256=bcae7cab893c2d310a711b70b24efb93334febe65f8de776ee320b517471e227 (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.7), version: 2.5.1

  Found link https://files.pythonhosted.org/packages/33/66/61da40aa546141b0d70b37fe6bb4ef1200b4b4cb98849f131b58faa9a5d2/platformdirs-2.5.1.tar.gz#sha256=7535e70dfa32e84d4b34996ea99c5e432fa29a708d0f4e394bbcb2a8faa4f16d (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.7), version: 2.5.1

  Found link https://files.pythonhosted.org/packages/ed/22/967181c94c3a4063fe64e15331b4cb366bdd7dfbf46fcb8ad89650026fec/platformdirs-2.5.2-py3-none-any.whl#sha256=027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788 (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.7), version: 2.5.2

  Found link https://files.pythonhosted.org/packages/ff/7b/3613df51e6afbf2306fc2465671c03390229b55e3ef3ab9dd3f846a53be6/platformdirs-2.5.2.tar.gz#sha256=58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19 (from https://pypi.org/simple/platformdirs/) (requires-python:>=3.7), version: 2.5.2

Skipping link: not a file: https://pypi.org/simple/platformdirs/

Given no hashes to check 20 links for project 'platformdirs': discarding no candidates

Collecting platformdirs

  Created temporary directory: /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-unpack-lpmmklzz

  Looking up "https://files.pythonhosted.org/packages/ed/22/967181c94c3a4063fe64e15331b4cb366bdd7dfbf46fcb8ad89650026fec/platformdirs-2.5.2-py3-none-any.whl" in the cache

  Current age based on date: 1894572

  Ignoring unknown cache-control directive: immutable

  Freshness lifetime from max-age: 365000000

  The response is "fresh", returning cached response

  365000000 > 1894572

  Using cached platformdirs-2.5.2-py3-none-any.whl (14 kB)

  Added platformdirs from https://files.pythonhosted.org/packages/ed/22/967181c94c3a4063fe64e15331b4cb366bdd7dfbf46fcb8ad89650026fec/platformdirs-2.5.2-py3-none-any.whl#sha256=027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788 to build tracker '/private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-build-tracker-o9ycw4o4'

  Removed platformdirs from https://files.pythonhosted.org/packages/ed/22/967181c94c3a4063fe64e15331b4cb366bdd7dfbf46fcb8ad89650026fec/platformdirs-2.5.2-py3-none-any.whl#sha256=027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788 from build tracker '/private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-build-tracker-o9ycw4o4'

Created temporary directory: /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-unpack-eahbg50r

WARNING: Error parsing requirements for platformdirs: [Errno 2] No such file or directory: '/private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/platformdirs-2.5.2.dist-info/METADATA'

Installing collected packages: platformdirs

  Attempting uninstall: platformdirs

    WARNING: No metadata found in /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages

    Found existing installation: platformdirs 2.5.2

    WARNING: No metadata found in /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages

    WARNING: No metadata found in /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages

    WARNING: No metadata found in /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages

    WARNING: No metadata found in /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages

    WARNING: No metadata found in /private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages

ERROR: Cannot uninstall platformdirs 2.5.2, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps platformdirs==2.5.2'.

Exception information:

Traceback (most recent call last):

  File "/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper

    status = run_func(*args)

  File "/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper

    return func(self, options, args)

  File "/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 406, in run

    installed = install_given_reqs(

  File "/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 68, in install_given_reqs

    uninstalled_pathset = requirement.uninstall(auto_confirm=True)

  File "/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 641, in uninstall

    uninstalled_pathset = UninstallPathSet.from_dist(dist)

  File "/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", line 526, in from_dist

    for path in uninstallation_paths(dist):

  File "/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", line 45, in unique

    for item in fn(*args, **kw):

  File "/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/py38/lib/python3.8/site-packages/pip/_internal/req/req_uninstall.py", line 83, in uninstallation_paths

    raise UninstallationError(msg)

pip._internal.exceptions.UninstallationError: Cannot uninstall platformdirs 2.5.2, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps platformdirs==2.5.2'.

Remote version of pip: 22.1

Local version of pip:  22.1

Was pip installed by pip? True

Removed build tracker: '/private/var/folders/c2/vd5y5mfs33q84hyzmxvqmyjm0000gp/T/pip-build-tracker-o9ycw4o4'

@gaborbernat
Copy link
Contributor

Seems pip refuses to remove the package, likely because wasn't installed with pip and is missing files needed for pip to handle that. This is likely a OS package manager vs pip issue. Not related to this project.

@uilianries
Copy link
Author

Thank you!

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

No branches or pull requests

3 participants