python 3.9 的 Virtualenvwrapper

Virutalenvwrapper with python 3.9

我尝试使用 virtualenvwrapperPython 3.9 设置虚拟环境,但遇到了这个错误。

➜  mkvirtualenv env --python=$(which python3.9)

RuntimeError: failed to query /usr/bin/python3.9 with code 1 err: 'Traceback (most recent call last):\n  File "/home/sid/.local/lib/python3.6/site-packages/virtualenv/discovery/py_info.py", line 16, in <module>\n    from distutils import dist\nImportError: cannot import name \'dist\' from \'distutils\' (/usr/lib/python3.9/distutils/__init__.py)\n'

我错过了什么?

  1. apt-get install -y python3.9-distutils
  2. 那么它应该可以正常工作。