1

pipenv install在空文件夹上的 Windows 10 上给我一个错误:

Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Scripts\pipenv.exe\__main__.py", line 9, in <module>
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\vendor\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\vendor\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\vendor\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\vendor\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\cli.py", line 366, in install
    selective_upgrade=selective_upgrade,
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\core.py", line 1730, in do_install
    skip_requirements=skip_requirements,
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\core.py", line 604, in ensure_project
    three=three, python=python, site_packages=site_packages
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\core.py", line 537, in ensure_virtualenv
    if not project.virtualenv_exists:
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\project.py", line 207, in virtualenv_exists
    if self.pipfile_exists and os.path.exists(self.virtualenv_location):
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\project.py", line 299, in virtualenv_location
    loc = self._get_virtualenv_location(self.virtualenv_name)
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\project.py", line 279, in virtualenv_name
    sanitized, encoded_hash = self._get_virtualenv_hash(self.name)
  File "C:\Users\ext.thipier1\AppData\Roaming\Python\Python27\site-packages\pipenv\project.py", line 267, in _get_virtualenv_hash
    if not (env[-9] != '-' and
IndexError: string index out of range

它仅在我在运行命令之前激活虚拟环境时才有效。

我在 macOS 上尝试了相同的程序,但没有这个问题。

我按照安装说明进行操作。

我该怎么做才能让它发挥作用?

4

0 回答 0