python创建虚拟环境报错_使用 virtualenvwrapper 创建 python2.7,2.5 版本的虚拟环境均报错...

环境

virtualenv 16.7.9

virtualenvwrapper-win 1.2.5

报错信息

2.5

Running virtualenv with interpreter E:\Software\Python\Python25\python.exe

e:\software\python\python38\lib\site-packages\virtualenv.py:432: Warning: 'with' will become a reserved keyword in Python 2.6

File "e:\software\python\python38\lib\site-packages\virtualenv.py", line 432

with open(dest, "wb") as f:

^

SyntaxError: invalid syntax

2.7

Cleaning up...

Removed build tracker 'c:\\users\\\xb9\xf9\xea\xbb\xc7\xbf\\appdata\\local\\temp\\pip-req-tracker-dd3usp'

ERROR: Exception:

Traceback (most recent call last):

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\cli\base_command.py", line 153, in _main

status = self.run(options, args)

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\commands\install.py", line 382, in run

resolver.resolve(requirement_set)

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\legacy_resolve.py", line 201, in resolve

self._resolve_one(requirement_set, req)

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\legacy_resolve.py", line 365, in _resolve_one

abstract_dist = self._get_abstract_dist_for(req_to_install)

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\legacy_resolve.py", line 311, in _get_abstract_dist_for

req.populate_link(self.finder, upgrade_allowed, self.require_hashes)

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\req\req_install.py", line 225, in populate_link

self.link = finder.find_requirement(self, upgrade)

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\index.py", line 879, in find_requirement

req.name, specifier=req.specifier, hashes=hashes,

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\index.py", line 861, in find_best_candidate

candidates = self.find_all_candidates(project_name)

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\index.py", line 791, in find_all_candidates

collected_links = self._link_collector.collect_links(project_name)

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\collector.py", line 509, in collect_links

self.find_links, expand_dir=True,

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\collector.py", line 408, in group_locations

sort_path(os.path.join(path, item))

File "e:\software\python\python38\lib\site-packages\virtualenv_support\pip-19.3.1-py2.py3-none-any.whl\pip\_internal\collector.py", line 389, in sort_path

if mimetypes.guess_type(url, strict=False)[0] == 'text/html':

File "E:\Software\Python\Python27\Lib\mimetypes.py", line 297, in guess_type

init()

File "E:\Software\Python\Python27\Lib\mimetypes.py", line 358, in init

db.read_windows_registry()

File "E:\Software\Python\Python27\Lib\mimetypes.py", line 258, in read_windows_registry

for subkeyname in enum_types(hkcr):

File "E:\Software\Python\Python27\Lib\mimetypes.py", line 249, in enum_types

ctype = ctype.encode(default_encoding) # omit in 3.x!

UnicodeDecodeError: 'ascii' codec can't decode byte 0xb1 in position 9: ordinal not in range(128)

--------------------------------------------------------------------------

...Installing setuptools, pip, wheel...done.

Traceback (most recent call last):

File "e:\software\python\python38\lib\site-packages\virtualenv.py", line 2634, in

main()

File "e:\software\python\python38\lib\site-packages\virtualenv.py", line 870, in main

symlink=options.symlink,

File "e:\software\python\python38\lib\site-packages\virtualenv.py", line 1179, in create_environment

install_wheel(to_install, py_executable, search_dirs, download=download)

File "e:\software\python\python38\lib\site-packages\virtualenv.py", line 1023, in install_wheel

_install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)

File "e:\software\python\python38\lib\site-packages\virtualenv.py", line 1116, in _install_wheel_with_search_dir

call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)

File "e:\software\python\python38\lib\site-packages\virtualenv.py", line 963, in call_subprocess

raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))

OSError: Command E:\Software\Python\E...7\Scripts\python.exe - setuptools pip wheel failed with error code 2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值