Never click OK, this will erase your existing virtual environment!

图片.png

Instead, open the terminal and enter pipenv shell to activate the virtual environment

 ─➤  pipenv shell
Launching subshell in virtual environment...
 . /Users/bot/.local/share/virtualenvs/rabbit_deliverer_service-tvDaA2VB/bin/activate

Enter where python to find the path to the Python interpreter in the virtual environment

 ─➤  where python
/Users/bot/.local/share/virtualenvs/rabbit_deliverer_service-tvDaA2VB/bin/python

Copy this path /Users/bot/.local/share/virtualenvs/rabbit_deliverer_service-tvDaA2VB/bin/python to the clipboard!

Then click 无解释器 in the lower right corner, select 添加解释器

图片.png

Be sure to select 现有环境 , then click the three dots on the right

图片.png

Copy the path and click OK

图片.png

Pay attention pay attention! ! ! ! ! ! Be sure to check if the path is correct. Pycharm is very low in that it will fail 9 times out of 10. If the path is not correct, try again

图片.png

If the path is correct, click OK

图片.png

You can see that the interpreter is cut over!


universe_king
3.4k 声望682 粉丝