Python 如何在Pycharm的虚拟环境中运行grunt,以便调试代码?
我目前正在虚拟环境中从cmd行运行grunt,方法是执行以下命令分别启动虚拟环境和grunt服务器Python 如何在Pycharm的虚拟环境中运行grunt,以便调试代码?,python,gruntjs,pycharm,virtualenv,Python,Gruntjs,Pycharm,Virtualenv,我目前正在虚拟环境中从cmd行运行grunt,方法是执行以下命令分别启动虚拟环境和grunt服务器 source ./env/bin/activate grunt serve 如何从Pycharm运行此服务器,以便逐步浏览项目代码 这是我当前尝试运行时收到的错误消息。如果我尝试从命令行运行grunt Service,但我不在虚拟环境中(即,在尝试启动grunt Service之前,PyCharm似乎没有激活virtualenv),则得到的消息与此完全相同: /usr/local/bin/nod
source ./env/bin/activate
grunt serve
如何从Pycharm运行此服务器,以便逐步浏览项目代码
这是我当前尝试运行时收到的错误消息。如果我尝试从命令行运行grunt Service,但我不在虚拟环境中(即,在尝试启动grunt Service之前,PyCharm似乎没有激活virtualenv),则得到的消息与此完全相同:
/usr/local/bin/node--debug brk=51383--expose_debug_as=v8debug/usr/local/lib/node_modules/grunt cli/bin/gruntfile--gruntfile/Users/tcl/_myproject/workspace/myproject_web/gruntfile.js
正在[:]上侦听的调试器:51383
正在运行“bgShell:runDjango”(bgShell)任务
运行“监视”任务
正在等待…>>回溯(最近一次呼叫最后一次):
>>文件“myproject\u web/manage.py”,第13行,在
>>从configurations.management导入从命令行执行
>>ImportError:没有名为configurations.management的模块
>>错误:命令失败:python myproject_web/manage.py runserver 0.0.0.0:7000
我猜是在这里完成的:
按下Environment(环境)按钮会显示这一点(我不确定在这里输入什么,或者这是否是正确的配置位置)
我还尝试使用以下命令从虚拟环境命令行启动Python:
/usr/local/bin/node --debug-brk=51694 --expose_debug_as=v8debug /usr/local/lib/node_modules/grunt-cli/bin/grunt --gruntfile /Users/tcl/_my_project/workspace/my_project_web/Gruntfile.js serve
Debugger listening on [::]:51694
Running "bgShell:runDjango" (bgShell) task
Running "watch" task
Waiting...>> Traceback (most recent call last):
>> File "my_project_web/manage.py", line 13, in <module>
>> from configurations.management import execute_from_command_line
>> ImportError: No module named configurations.management
>> Error: Command failed: python my_project_web/manage.py runserver 0.0.0.0:7000
/usr/local/bin/node--debug brk=51694--expose_debug_as=v8debug/usr/local/lib/node_modules/grunt cli/bin/grunt--gruntfile/Users/tcl/_my_project/workspace/my_project\u web/gruntfile.js
正在[:]上侦听的调试器:51694
正在运行“bgShell:runDjango”(bgShell)任务
运行“监视”任务
正在等待…>>回溯(最近一次呼叫最后一次):
>>文件“my_project_web/manage.py”,第13行,在
>>从configurations.management导入从命令行执行
>>ImportError:没有名为configurations.management的模块
>>错误:命令失败:python my_project_web/manage.py runserver 0.0.0.0:7000
虚拟环境似乎没有被激活。如何激活virtualenv以使grunt工作(我曾尝试从终端窗口激活它,但PyCharm不在激活版本中)
/usr/local/bin/node --debug-brk=51694 --expose_debug_as=v8debug /usr/local/lib/node_modules/grunt-cli/bin/grunt --gruntfile /Users/tcl/_my_project/workspace/my_project_web/Gruntfile.js serve
Debugger listening on [::]:51694
Running "bgShell:runDjango" (bgShell) task
Running "watch" task
Waiting...>> Traceback (most recent call last):
>> File "my_project_web/manage.py", line 13, in <module>
>> from configurations.management import execute_from_command_line
>> ImportError: No module named configurations.management
>> Error: Command failed: python my_project_web/manage.py runserver 0.0.0.0:7000