IndentationError:创建python3 virtualenv时意外缩进

问题描述

以前,我的virtualenv命令对python3完全可用。但是现在当我尝试创建虚拟环境时:

$ virtualenv -p python3 .

它给我以下错误:

Running virtualenv with interpreter /home/user/anaconda3/bin/python3
Already using interpreter /home/user/anaconda3/bin/python3
Using base prefix '/home/user/anaconda3'
New python executable in /home/user/Documents/cynical/sitemap/bin/python3
Not overwriting existing python script /home/user/Documents/cynical/sitemap/bin/python (you must use /home/user/Documents/cynical/sitemap/bin/python3)
Command /home/user/Documents.../sitemap/bin/python3 -m pip config list had error code 1
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py",line 2635,in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py",line 870,in main
    symlink=options.symlink,File "/usr/local/lib/python2.7/dist-packages/virtualenv.py",line 1173,in create_environment
    install_wheel(to_install,py_executable,search_dirs,download=download)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py",line 1019,in install_wheel
    _install_wheel_with_search_dir(download,project_names,search_dirs)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py",line 1046,in _install_wheel_with_search_dir
    config = _pip_config(py_executable,python_path)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py",line 1128,in _pip_config
    config[key] = ast.literal_eval(value)
  File "/home/user/anaconda3/lib/python3.7/ast.py",line 46,in literal_eval
    node_or_string = parse(node_or_string,mode='eval')
  File "/home/user/anaconda3/lib/python3.7/ast.py",line 35,in parse
    return compile(source,filename,mode,PyCF_ONLY_AST)
  File "<unknown>",line 1
    _get_module_details(mod_name,_Error)
    ^
IndentationError: unexpected indent

我也尝试过更新pip3,python3和virtualenv。

$ apt install python3
$ apt install python3-pip
$ apt install virtualenv

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...