我是Python的新手,我正在尝试找出如何处理多个开发人员的依赖关系。我遇到了我要遵循的本指南-https://packaging.python.org/tutorials/managing-dependencies/
我已经安装了pipenv,但是当我尝试运行pipenv install
时,出现以下错误:
AssertionError:文件名 C:\ Users \ Andy \ AppData \ Local \ Programs \ Python \ Python37-32 \ Lib \ os.py确实 不以以下任何前缀开头: ['C:\ users \ andy \ appdata \ local \ programs \ python \ python37-32', 'C:\ users \ andy \ appdata \ local \ programs \ python \ python37-32']
无法创建虚拟环境。
我正在使用Windows。
有人能把我指向正确的方向吗?
如果有任何用途,这里是完整的踪迹。
pipenv install
Creating a virtualenv for this project…
Pipfile: C:\Projects\Test\TAP.API\Users\LogUserInterest\Pipfile
Using c:\users\andy\appdata\local\programs\python\python37-32\python.exe (3.7.2) to create virtualenv…
[= ] Creating virtual environment...Already using interpreter c:\users\andy\appdata\local\programs\python\python37-32\python.exe
Using base prefix 'c:\\users\\andy\\appdata\\local\\programs\\python\\python37-32'
Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\pipenv\cli\command.py", line 254, in install
[pipenv.exceptions.VirtualenvCreationException]: editable_packages=state.installstate.editables,
[pipenv.exceptions.VirtualenvCreationException]: File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\pipenv\core.py", line 1741, in do_install
[pipenv.exceptions.VirtualenvCreationException]: pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]: File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\pipenv\core.py", line 574, in ensure_project
[pipenv.exceptions.VirtualenvCreationException]: pypi_mirror=pypi_mirror,
[pipenv.exceptions.VirtualenvCreationException]: File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\pipenv\core.py", line 506, in ensure_virtualenv
[pipenv.exceptions.VirtualenvCreationException]: python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
[pipenv.exceptions.VirtualenvCreationException]: File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\pipenv\core.py", line 935, in do_create_virtualenv
[pipenv.exceptions.VirtualenvCreationException]: extra=[crayons.blue("{0}".format(c.err)),]
[pipenv.exceptions.VirtualenvCreationException]: Traceback (most recent call last):
File "C:\Users\Andy\AppData\Local\Programs\Python\Python37-32\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Andy\AppData\Local\Programs\Python\Python37-32\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 2502, in <module>
main()
File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 793, in main
symlink=options.symlink,
File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1070, in create_environment
install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1297, in install_python
copy_required_modules(home_dir, symlink)
File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1220, in copy_required_modules
dst_filename = change_prefix(filename, dst_prefix)
File "C:\Users\Andy\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1185, in change_prefix
assert False, "Filename {} does not start with any of these prefixes: {}".format(filename, prefixes)
AssertionError: Filename C:\Users\Andy\AppData\Local\Programs\Python\Python37-32\Lib\os.py does not start with any of these prefixes: ['C:\\users\\andy\\appdata\\local\\programs\\python\\python37-32', 'C:\\users\\andy\\appdata\\local\\programs\\python\\python37-32']