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

.DS_Store in pyenv root cause pipenv "ValueError: Not a valid python version: <LegacyVersion('.DS_Store')>" #3208

Closed
fr0der1c opened this issue Nov 10, 2018 · 25 comments

Comments

@fr0der1c
Copy link

Issue description

When trying to run pipenv sync, got ValueError: Not a valid python version: <LegacyVersion('.DS_Store')> error. Deleting ~/.pyenv/versions/.DS_Store helps.

Expected result

pipenv should ignore .DS_Store file.

Actual result

Traceback (most recent call last):
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/pyenv.py", line 53, in get_versions
    version = PythonVersion.parse(p.name)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 119, in parse
    raise ValueError("Not a valid python version: %r" % version)
ValueError: Not a valid python version: <LegacyVersion('.DS_Store')>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/vencent/.pyenv/versions/3.6.0/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/cli/command.py", line 586, in sync
    pypi_mirror=state.pypi_mirror,
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py", line 2500, in do_sync
    pypi_mirror=pypi_mirror,
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py", line 565, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py", line 488, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py", line 401, in ensure_python
    path_to_python = find_a_system_python(python)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py", line 364, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 90, in find_python_version
    return self.system_path.find_python_version(
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 44, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 309, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 21cfbcaf749d3af30eb10d5110d156423170deac>", line 37, in __init__
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 102, in __attrs_post_init__
    self._setup_pyenv()
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 133, in _setup_pyenv
    self.pyenv_finder = PyenvFinder.create(root=PYENV_ROOT, ignore_unsupported=self.ignore_unsupported)
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/pyenv.py", line 98, in create
    return cls(root=root, ignore_unsupported=ignore_unsupported)
  File "<attrs generated init 622376ddae498c76611d8b35810e09515a0b8478>", line 7, in __init__
  File "/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/pyenv.py", line 58, in get_versions
    if not version:
UnboundLocalError: local variable 'version' referenced before assignment

Steps to replicate

(This happens on Mac, since .DS_Store is a macOS auto-generated file) Put a .DS_Store under pyenv's versions folder


$ pipenv --support

Pipenv version: '2018.10.13'

Pipenv location: '/Users/vencent/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv'

Python location: '/Users/vencent/.pyenv/versions/3.6.0/bin/python3.6'

Python installations found:

  • 3.6.0: /Users/vencent/.pyenv/shims/python3
  • 3.6.0: /Users/vencent/.pyenv/shims/python
  • 3.6.0: /Users/vencent/.pyenv/shims/python3.6
  • 3.6.0: /Users/vencent/.pyenv/shims/python3.6m
  • 3.6.0: /Users/vencent/.pyenv/versions/3.6.0/bin/python3.6
  • 3.6.0: /Users/vencent/.pyenv/versions/3.6.0/bin/python3.6m
  • 3.5.0: /Users/vencent/.pyenv/versions/3.5.0/bin/python3.5
  • 3.5.0: /Users/vencent/.pyenv/versions/3.5.0/bin/python3.5m
  • 2.7.14: /usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/bin/python2.7
  • 2.7.10: /usr/bin/python
  • 2.7.10: /usr/bin/pythonw
  • 2.7.10: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
  • 2.7: /Users/vencent/.pyenv/versions/2.7/bin/python
  • 2.7: /Users/vencent/.pyenv/versions/2.7/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '18.0.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT '
                     '2018; root:xnu-4903.201.2~1/RELEASE_X86_64',
 'python_full_version': '3.6.0',
 'python_version': '3.6',
 'sys_platform': 'darwin'}

System environment variables:

  • AUTOJUMP_ERROR_PATH
  • MODE
  • PYENV_ROOT
  • AUTOJUMP_SOURCED
  • TERM
  • SHELL
  • CLICOLOR
  • TMPDIR
  • Apple_PubSub_Socket_Render
  • PYENV_VERSION
  • LC_ALL
  • ZSH
  • http_proxy
  • USER
  • SSH_AUTH_SOCK
  • PYENV_DIR
  • __CF_USER_TEXT_ENCODING
  • PAGER
  • LSCOLORS
  • all_proxy
  • PATH
  • PWD
  • SENTRY_URL
  • LANG
  • PYENV_HOOK_PATH
  • XPC_FLAGS
  • SENTRY_AUTH_TOKEN
  • https_proxy
  • XPC_SERVICE_NAME
  • PYENV_SHELL
  • SHLVL
  • HOME
  • SENTRY_ORG
  • LESS
  • LOGNAME
  • LC_CTYPE
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/vencent/.pyenv/versions/3.6.0/bin:/usr/local/Cellar/pyenv/1.0.10/libexec:/Users/vencent/.pyenv/shims:/Users/vencent/.pyenv/bin:/Applications/CMake.app/Contents/bin:/opt/local/bin:/opt/local/sbin:/Users/vencent/Qt5.9.0/5.9/clang_64/bin:/Users/vencent/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  • SHELL: /bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /Users/vencent/.pyenv/versions

@frostming
Copy link
Contributor

frostming commented Nov 13, 2018

Can you try update-vendor branch and see if the issue exists?

@techalchemy
Copy link
Member

This should be handles now

@fr0der1c
Copy link
Author

Yes seems it's fixed now. I reinstalled python via pyenv due to other reason and now I cannot reproduce the problem.

@techalchemy
Copy link
Member

okay, sorry for the trouble!

@fr0der1c
Copy link
Author

I'm not sure what's happening but the problem happened again on my computer. Do I have to use update-vendor branch or just using pip to install is fine?

@timburgess
Copy link

I can produce pretty much the same error on an Ubuntu Linux machine. Obviously no .DS_Store file present.

➜ pipenv install
Traceback (most recent call last):
  File "/home/tim/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/cli/command.py", line 249, in install
    editable_packages=state.installstate.editables,
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/core.py", line 1725, in do_install
    pypi_mirror=pypi_mirror,
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/core.py", line 569, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/core.py", line 489, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/core.py", line 397, in ensure_python
    path_to_python = find_a_system_python(python)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/core.py", line 360, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 114, in find_python_version
    major=major, minor=minor, patch=patch, pre=pre, dev=dev, arch=arch, name=name
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 396, in find_python_version
    ver = next(iter(self.get_pythons(sub_finder)), None)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 279, in get_pythons
    reverse=True
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 277, in <genexpr>
    (p for p in self._filter_paths(finder) if p.is_python),
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 264, in <genexpr>
    pth for pth in unnest(finder(p) for p in self.path_entries if p is not None)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/utils.py", line 138, in unnest
    for el in target:
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 264, in <genexpr>
    pth for pth in unnest(finder(p) for p in self.path_entries if p is not None)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/mixins.py", line 121, in find_python_version
    for child in unnest(self.pythons.values())
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 523, in pythons
    for path, entry in self.children.items():
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/cached_property.py", line 35, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 494, in children
    for child_key, child_val in self._gen_children():
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 487, in _gen_children
    yield (child.as_posix(), PathEntry.create(path=child, **pass_args))
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 567, in create
    _new = cls(**creation_args)
  File "<attrs generated init 9a068b85df670df4876e3ba2167b54d388a2116a>", line 16, in __init__
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 510, in get_py_version
    py_version = PythonVersion.from_path(path=self, name=self.name)
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 418, in from_path
    instance_dict = cls.parse(py_version.strip())
  File "/home/tim/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 366, in parse
    raise ValueError("Not a valid python version: %r" % version)
ValueError: Not a valid python version: <LegacyVersion('2.7.15+')>

@Mortuie
Copy link

Mortuie commented Nov 16, 2018

@timburgess have you found a solution, I have tried installing update-vendor branch and it doesn't solve it. What linux distro/version do you use?

@timburgess
Copy link

I’m running Ubuntu 18.10 No, I haven’t found any resolution - this is my first exposure to pipenv.

@Mortuie
Copy link

Mortuie commented Nov 16, 2018

@timburgess same for me Ubuntu 18.10! Keep me posted, if you do find anything!

@techalchemy
Copy link
Member

Try installing the latest version and if you have a problem similar to this one please file a separate issue so we can triage and get a fix into tomorrow’s bugfix release

@fr0der1c
Copy link
Author

fr0der1c commented Nov 19, 2018

😂The latest version is completely broken(#3224, even setting pyenv global version won't help) and I have to downgrade to 2018.10.13 again.

@stianlagstad
Copy link

Thank you for that, @fr0der1c! I was able to continue using pipenv for now by installing it with python3 -m pip install pipenv==2018.10.13 --user.

@techalchemy
Copy link
Member

We have a fix merged for this already and should be releasing today

@j-strum
Copy link

j-strum commented Dec 7, 2018

Today I saw the original error message from pipenv==2018.10.13, and the related error below from 2018.11.26.

Deleting ~/.pyenv/versions/.DS_Store still helps, fortunately!

$ pipenv install

Traceback (most recent call last):
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 112, in get_versions
    version = PythonVersion.parse(p.name)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 359, in parse
    version_dict = parse_python_version(str(version))
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/utils.py", line 86, in parse_python_version
    raise InvalidPythonVersion("%s is not a python version" % version_str)
pipenv.vendor.pythonfinder.exceptions.InvalidPythonVersion: .DS_Store is not a python version

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/psm/.pyenv/versions/3.7.1/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/cli/command.py", line 254, in install
    editable_packages=state.installstate.editables,
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/core.py", line 1741, in do_install
    pypi_mirror=pypi_mirror,
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/core.py", line 574, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/core.py", line 494, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/core.py", line 397, in ensure_python
    path_to_python = find_a_system_python(python)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/core.py", line 360, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 113, in find_python_version
    return self.system_path.find_python_version(
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 54, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 451, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 196, in _setup_pyenv
    version_glob_path="versions/*", ignore_unsupported=self.ignore_unsupported
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 156, in create
    sort_function=sort_function, version_glob_path=version_glob_path)
  File "<attrs generated init a1a05d8eafbd2700b304c565646ba66e3f0eaec0>", line 17, in __init__
  File "/Users/psm/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 114, in get_versions
    entry = next(iter(version_path.find_all_python_versions()), None)
AttributeError: 'NoneType' object has no attribute 'find_all_python_versions'

@seasonedgeek
Copy link

I think this "closed" issue should be revisited. While using pipenv, version 2018.11.26, and upon executing the pipenv install command, I too observed the following:
AttributeError: 'NoneType' object has no attribute 'find_all_python_versions'

I tried executing pipenv install --dev lettuce (after reading the pipenv docs regarding the Pipfile)
and the result was:

AttributeError: 'NoneType' object has no attribute 'find_all_python_versions'
...
raise InvalidPythonVersion("%s is not a python version" % version_str)
pipenv.vendor.pythonfinder.exceptions.InvalidPythonVersion: .DS_Store is not a python version

I removed the ~/.pyenv/versions/.DS_Store as indicated above as a possible solution.
I then re-executed pipenv install --dev lettuce and happily observed:

Practice/Python Playground/myBankAccount
➜ pipenv install --dev lettuce
Creating a Pipfile for this project…
Installing lettuce…
Adding lettuce to Pipfile's [dev-packages]…
✔ Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
✔ Success!
Locking [packages] dependencies…
Updated Pipfile.lock (7b489f)!
Installing dependencies from Pipfile.lock (7b489f)…
  🎅   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 15/15 — 00:00:03
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

Perhaps pipenv should explicitedly ignore the .DS_Store file on a Mac(?).
Cheers!

@oerd
Copy link

oerd commented Dec 29, 2018

Yeah, sorry to bug about this but it's been a really annoying couple of hours for me.

For all who look into this problem on their own:

  • look for .DS_Store up to your home folder (IIRC pyenv will look in the folder hierarchy for a python version file
  • if you installed via Homebrew (on a Mac) have a look at your HOMEBREW_PREFIX (i.e. /usr/local) for a .DS_Store and get rid of it. Here's how to search for it on a terminal :find /usr/local/var/pyenv/versions -name ".DS_Store"

@jurrinus
Copy link

jurrinus commented Mar 3, 2019

Tried every which way I could to install pipenv, brew, pip etc. with no luck. I could install it with brew, latest version only of course, pipenv still fails. If I install it using pip install it would in essence perform a python -m pip install. Even that failed with the .DS_Store error because it installed the latest version. It was only when I specifically installed version 2018.10.13 did it finally work. If I did a brew search for the 2018.10.13 version and used the url it failed the install on a tag error. Spent many hours sorting this out.

@waysup
Copy link

waysup commented Mar 10, 2019

Just remove ~/.pyenv/versions/.DS_Store, then run pipenv install again. Everything goes fine.

@techalchemy
Copy link
Member

This issue is fixed on the master branch of pipenv but can be resolved by deleting the folder mentioned by @waysup in the meantime

@skycaptain
Copy link

skycaptain commented Nov 23, 2019

Just for the record, this issue still exists. #3208 (comment) helps but is cumbersome.

@melMass
Copy link

melMass commented Feb 4, 2020

Still there ;(

@izhangzhihao
Copy link

rm ~/.pyenv/versions/.DS_Store works for me.

@armchairdeity
Copy link

rm ~/.pyenv/versions/.DS_Store works for me.

I had one in two places... I think a better version is:

find ~/.pyenv -name ".DS_Store" -delete

@armchairdeity
Copy link

This issue is fixed on the master branch of pipenv but can be resolved by deleting the folder mentioned by @waysup in the meantime

I just installed the latest today and it's definitely still there.

@techalchemy
Copy link
Member

I have just released a pre-release of the latest version of pipenv, this should address the issue mentioned here. You can test it by running pip install --upgrade --pre pipenv and trying pipenv out. Please file new issues for any problems that arise

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