Using Powershell as terminal in IntelliJ IDEA IDEs like PyCharm, PHPStorm or RubyMine(在 PyCharm、PHPStorm 或 RubyMine 等 IntelliJ IDEA IDE 中使用 Powershell 作为终端)
问题描述
我一直在尝试在 pycharm 中将 powershell 作为我的终端在 windows 上运行,所以我做了以下操作:
I have been attempting to run powershell as my terminal on windows in pycharm, so I did the following:
但是,当我尝试这个时,它说它无法执行我的脚本,因此我收到以下错误:SecurityError
并且完全限定 ID 是:UnAuthorizedAccess
.
However, when I try this, it says that it cannot execute my scripts, and hence I get the following error: SecurityError
and the Fully Qualified Id is : UnAuthorizedAccess
.
这是因为 pycharm 的终端无法执行我的 Powershell_profile.ps1
配置文件.
This arises from the fact that pycharm's terminal cannot execute my Powershell_profile.ps1
profile file.
如何使用 Powershell 成功运行 Pycharm 的终端?
How can I successfully run Pycharm's terminal with Powershell?
到目前为止,我已经尝试过进入我的主 powershell 目录,如 %windir%/system32/WindowsPowerShell/1.0/profile.ps1
,然后将其更改为包含以下内容:
What I have tried so far, is going into my main powershell directory as in %windir%/system32/WindowsPowerShell/1.0/profile.ps1
, and then change it to include the following:
Set-ExecutionPolicy Unrestricted
但是,这并没有帮助,当我尝试打开 pycharm 的终端时,我得到了同样的错误.
However, this does not help, and I get the same error when I try to open of pycharm's terminal.
我也尝试过以管理员身份运行 pycharm,但这也不能解决问题,我得到了 same 上述错误.
I have also tried to run pycharm as Admin, however this does not solve the problem either, and I get the same aforementioned error.
推荐答案
我已经用 powershell.exe 以更简单的方式替换了 cmd.exe,希望它可以提供帮助.我正在使用 webstorm2017 和 Win10 操作系统.
I've replaced cmd.exe with powershell.exe in a simpler way and hope it can help. I'm using webstorm2017 and Win10 os.
1.找到 powershell.exe
的确切位置.在我的,我相信在大多数计算机中,该位置将是 C:WindowsSystem32WindowsPowerShellv1.0powershell.exe
.将整个路径复制到剪贴板中.
1.Find the exact location of powershell.exe
.In mine and I believe in most computers the location would be C:WindowsSystem32WindowsPowerShellv1.0powershell.exe
.Copy the whole path into your clipboard.
2.在您的 IDE 中打开 File=>Setting=>Tools=>Terminal,并将路径粘贴到Shell path"空白处.
2.In your IDE open File=>Setting=>Tools=>Terminal, and paste the path into "Shell path" blank.
3.重启IDE一切正常.
3.Restart the IDE and everything would be ok.
这篇关于在 PyCharm、PHPStorm 或 RubyMine 等 IntelliJ IDEA IDE 中使用 Powershell 作为终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 PyCharm、PHPStorm 或 RubyMine 等 IntelliJ IDEA IDE 中使


基础教程推荐
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 筛选NumPy数组 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01