Ubuntu 20.04“virtualenv -p python3。”命令不起作用

Ubuntu 20.04“virtualenv -p python3。”命令不起作用

升级到 ubuntu 20.04 后virtualenv -p python3 .无法正常工作。我显示错误

    Traceback (most recent call last):
  File "/home/mahmud/.local/bin/virtualenv", line 6, in <module>
    from virtualenv.__main__ import run_with_catch
  File "/home/mahmud/.local/lib/python2.7/site-packages/virtualenv/__init__.py", line 3, in <module>
    from .run import cli_run
  File "/home/mahmud/.local/lib/python2.7/site-packages/virtualenv/run/__init__.py", line 5, in <module>
    from virtualenv.run.app_data import AppDataAction
  File "/home/mahmud/.local/lib/python2.7/site-packages/virtualenv/run/app_data.py", line 8, in <module>
    from virtualenv.util.lock import ReentrantFileLock
  File "/home/mahmud/.local/lib/python2.7/site-packages/virtualenv/util/lock.py", line 11, in <module>
    from virtualenv.util.path import Path
  File "/home/mahmud/.local/lib/python2.7/site-packages/virtualenv/util/path/__init__.py", line 3, in <module>
    from ._pathlib import Path
  File "/home/mahmud/.local/lib/python2.7/site-packages/virtualenv/util/path/_pathlib/__init__.py", line 5, in <module>
    import six
ImportError: No module named six

似乎如果我使用/usr/bin/virtualenv p python3 .而不是virtualenv -p python3 .我已经升级了所有内容,它就可以正常工作pip3 是 20.1虚拟环境==20.0.20还有six==1.14.0
什么办法可以使用虚拟环境代替/usr/bin/virtualenv

答案1

尝试安装six

pip install six

或者如果你已经拥有它:

pip uninstall six
pip install six

相关内容