我需要在PyCharm中创建Django项目。我正在使用翻译3.6.3 at /usr/bin/python3.6
。创建后,我收到消息Authentication is needed to run /usr/bin/python3.6 as the superuser
。我点击了取消,我得到了:
Executed command: pip install Django
Error occurred: Non-zero exit code (126)
Proposed solution:
Try to run this command from the system terminal. Make sure that you use correct version of 'pip' installed for your Python interpreter located at '/usr/bin/python3.6'.
Command output:
Error executing command as another user: Request dismissed
但是,如果我将提供密码并单击Authenticate然后pip,pip3和virtualenv将被破坏,因为IDE正在尝试以root身份安装Django。我怎样才能阻止PyCharm以root身份运行pip?
答案 0 :(得分:1)
要使PyCharm在虚拟环境中发挥出色,请执行以下操作:
virtualenv <virtualEnvName>
. <virtualEnvName>/bin/activate
pip install <pkg>
File > Open > urProject
PyCharm Community Edition > Preferences > Project > Project Interpreter