简体   繁体   中英

Issue while trying to run $pipenv --python 3.7

I'm having issues while trying to run $pipenv --python 3.7 , in this case I am running it while inside my virtual environment. As I see, this could be having trouble with another virtual environment called venvAmazon , thar I don't need or use anymore.

I noticed that, when I created my actual virtual environment, 1. it didn't created a pipfile, 2. It was created in python 2.7. (I do have 3.7 in my pc), 3. It also throws me an error if I try to run outside the venv

Traceback (most recent call last):
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 112, in get_versions
    version = PythonVersion.parse(p.name)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 359, in parse
    version_dict = parse_python_version(str(version))
  File "/home/daniel/.local/lib/python3.6/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: venvAmazon is not a python version

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/daniel/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/daniel/.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/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/daniel/.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/daniel/.local/lib/python3.6/site-packages/pipenv/cli/command.py", line 208, in cli
    clear=state.clear,
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/core.py", line 574, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/core.py", line 516, in ensure_virtualenv
    ensure_python(three=three, python=python)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/core.py", line 397, in ensure_python
    path_to_python = find_a_system_python(python)
  File "/home/daniel/.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/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 113, in find_python_version
    return self.system_path.find_python_version(
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 54, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "/home/daniel/.local/lib/python3.6/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 "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 196, in _setup_pyenv
    version_glob_path="versions/*", ignore_unsupported=self.ignore_unsupported
  File "/home/daniel/.local/lib/python3.6/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 3d06d7bc6a0a13af152279598b774c410bafffe4>", line 17, in __init__
  File "/home/daniel/.local/lib/python3.6/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'

After I tried pip install --upgrade --pre pipenv It gave me another error:

 File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/core.py", line 541, in ensure_virtualenv
    pypi_mirror=pypi_mirror,
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/core.py", line 541, in ensure_virtualenv
    pypi_mirror=pypi_mirror,
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/core.py", line 541, in ensure_virtualenv
    pypi_mirror=pypi_mirror,
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/core.py", line 535, in ensure_virtualenv
    cleanup_virtualenv(bare=True)
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/core.py", line 181, in cleanup_virtualenv
    vistir.path.rmtree(project.virtualenv_location)
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/path.py", line 433, in rmtree
    shutil.rmtree(directory, ignore_errors=ignore_errors, onerror=onerror)
  File "/usr/lib/python2.7/shutil.py", line 270, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 275, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/path.py", line 494, in handle_remove_readonly
    if is_readonly_path(path):
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/path.py", line 263, in is_readonly_path
    fn = fs_decode(fs_encode(fn))
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/compat.py", line 382, in fs_encode
    path = _get_path(path)
  File "/home/daniel/.local/lib/python2.7/site-packages/pipenv/vendor/vistir/compat.py", line 297, in _get_path
    if isinstance(path, (six.string_types, bytes)):
RuntimeError: maximum recursion depth exceeded while calling a Python object

It seems this is a currently open issue with pipenv . It might worth trying what they suggest there:

pip install --upgrade --pre pipenv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM