Skip to content

Windows update breaks pipenv virtual environments creation #2983

@alejmolinas

Description

@alejmolinas

Issue description

> pipenv install and > pipenv --python 3 fails in a desktop folder after windows update.

Expected result

Creation of a virtual environment and installing all dependencies declared in Pipfile.lock

Actual result

> pipenv install
Traceback (most recent call last):
  File "c:\users\ale\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Ale\AppData\Local\Programs\Python\Python36\Scripts\pipenv.exe\__main__.py", line 9, in <module>
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\click\decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\click\decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\cli\command.py", line 249, in install
    editable_packages=state.installstate.editables,
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\core.py", line 1695, in do_install
    pypi_mirror=pypi_mirror,
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\core.py", line 561, in ensure_project
    pypi_mirror=pypi_mirror,
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\core.py", line 484, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\core.py", line 397, in ensure_python
    path_to_python = find_a_system_python(python)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\core.py", line 360, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 81, in find_python_version
    match = self.windows_finder.find_python_version(
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\pythonfinder\pythonfinder.py", line 49, in windows_finder
    self._windows_finder = WindowsFinder()
  File "<attrs generated init 87ada516ba10af7bd87735a5460aaaf86a1d070f>", line 13, in __init__
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\pythonfinder\models\windows.py", line 66, in get_versions
    path = ensure_path(install_path.__getattr__(""))
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\pythonfinder\_vendor\pep514tools\_registry.py", line 75, in __getattr__
    raise AttributeError(attr)
AttributeError
> pipenv --python 3
*
* (Same as pipenv install)
 AttributeError

Steps to replicate

I was working on a project after updating windows and I wanted to test my configuration so I did
> pipenv --rm to delete my current environment. When I tried to use > pipenv install --dev I got that error.
I have already tried reinstalling pipenv and python and deleting all my site-packages.

It once let me create an environment in c:\\users\\ale, but not in other directories. I also tried > pipenv -support, but it failed at getting the python installations with the same error as always.
I again tested removing the environment and performing a > pipenv install but this time it failed.

After some testing I removed the Pipfile and Pipfile.lock in c:\\users\\ale and >pipenv install worked again but only in that directory as creating an empty folder in the desktop or other directories and executing pipenv install always fails with the same traceback.


Windows 10 Home: '1803 (OS build 17134.345)'

Pip version: '18.1'

Pipenv version: '2018.10.9'

Pipenv location: 'c:\\users\\ale\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\pipenv'

Python location: 'c:\\users\\ale\\appdata\\local\\programs\\python\\python36\\python.exe'

Python installations found:

Traceback (most recent call last):
 *
 * (Same error as above)
 *
  File "c:\users\ale\appdata\local\programs\python\python36\lib\site-packages\pipenv\vendor\pythonfinder\_vendor\pep514tools\_registry.py", line 75, in __getattr__
    raise AttributeError(attr)
AttributeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions