运行以下内容
poetry shell
返回以下错误
/home/harshagoli/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
"program uses threads.", RuntimeWarning)
The currently activated Python version 2.7.17 is not supported by the project (^3.7).
Trying to find and use a compatible version.
Using python3 (3.7.5)
Virtual environment already activated: /home/harshagoli/.cache/pypoetry/virtualenvs/my-project-0wt3KWFj-py3.7
如何克服这个错误?为什么此命令不起作用?
答案 0 :(得分:2)
poetry shell
是一个非常有问题的命令,经常在维护人员中谈论。解决此特定问题的方法是手动激活外壳。可能值得混淆以下内容
source "$( poetry env list --full-path )/bin/activate"
答案 1 :(得分:1)
我必须执行以下操作
source "$( poetry env list --full-path | grep Activated | cut -d' ' -f1 )/bin/activate"