PyCharm Terminal无法在Raspbian OS上运行

时间:2020-07-11 15:19:28

标签: python pycharm

在安装了Raspbian的Raspberry Pi 4 8​​GB上的PyCharm中,PyCharm出现以下错误:

Cannot open Local Terminal
Failed to start [/bin/bash, --rcfile, /opt/pycharm-community-2019.3.5/plugins/terminal/jediterm-bash.in, -i] in /home/pi/CodingProjects/Julia


See your idea.log (Help | Show Log in File Manager) for the details.

转到idea.log之后,我一直向下滚动到最近的条目,发现一个与我的错误相匹配的错误。

idea.log文件出现此错误:

020-07-11 10:31:52,579 [ 113429]   INFO - erminal.AbstractTerminalRunner - Cannot open Local Terminal 
java.util.concurrent.ExecutionException: Failed to start [/bin/bash, --rcfile, /opt/pycharm-community-2019.3.5/plugins/terminal/jediterm-bash.in, -i] in /home/pi/CodingProjects/Julia
    at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:197)
    at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:47)
    at org.jetbrains.plugins.terminal.AbstractTerminalRunner.lambda$openSessionInDirectory$4(AbstractTerminalRunner.java:214)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: Exec_tty error:Cannot load native pty executor library
    at com.pty4j.unix.UnixPtyProcess.execInPty(UnixPtyProcess.java:272)
    at com.pty4j.unix.UnixPtyProcess.<init>(UnixPtyProcess.java:86)
    at com.pty4j.PtyProcessBuilder.start(PtyProcessBuilder.java:111)
    at com.pty4j.PtyProcess.exec(PtyProcess.java:78)
    at com.pty4j.PtyProcess.exec(PtyProcess.java:49)
    at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:189)
    ... 8 more
Caused by: java.lang.RuntimeException: Cannot load native pty executor library
    at com.pty4j.unix.PtyHelpers.getPtyExecutor(PtyHelpers.java:257)
    at com.pty4j.unix.PtyHelpers.execPty(PtyHelpers.java:430)
    at com.pty4j.unix.UnixPtyProcess.exec(UnixPtyProcess.java:333)
    at com.pty4j.unix.UnixPtyProcess$Reaper.execute(UnixPtyProcess.java:389)
    at com.pty4j.unix.UnixPtyProcess$Reaper.run(UnixPtyProcess.java:395)
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library '/opt/pycharm-community-2019.3.5/lib/pty4j-native/linux/x86/libpty.so':
/opt/pycharm-community-2019.3.5/lib/pty4j-native/linux/x86/libpty.so: cannot open shared object file: No such file or directory
/opt/pycharm-community-2019.3.5/lib/pty4j-native/linux/x86/libpty.so: cannot open shared object file: No such file or directory
Native library (opt/pycharm-community-2019.3.5/lib/pty4j-native/linux/x86/libpty.so) not found in resource path (/opt/pycharm-community-2019.3.5/lib/bootstrap.jar:/opt/pycharm-community-2019.3.5/lib/extensions.jar:/opt/pycharm-community-2019.3.5/lib/util.jar:/opt/pycharm-community-2019.3.5/lib/jdom.jar:/opt/pycharm-community-2019.3.5/lib/log4j.jar:/opt/pycharm-community-2019.3.5/lib/trove4j.jar:/opt/pycharm-community-2019.3.5/lib/jna.jar)
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:302)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455)
    at com.sun.jna.Library$Handler.<init>(Library.java:192)
    at com.sun.jna.Native.loadLibrary(Native.java:646)
    at com.sun.jna.Native.loadLibrary(Native.java:630)
    at com.pty4j.unix.NativePtyExecutor.<init>(NativePtyExecutor.java:14)
    at com.pty4j.unix.PtyHelpers$2.call(PtyHelpers.java:222)
    at com.pty4j.unix.PtyHelpers$2.call(PtyHelpers.java:218)
    at com.pty4j.util.LazyValue.getValue(LazyValue.java:25)
    at com.pty4j.unix.PtyHelpers.getPtyExecutor(PtyHelpers.java:254)
    at com.pty4j.unix.PtyHelpers.<clinit>(PtyHelpers.java:234)
    at com.pty4j.unix.Pty.ptyMasterOpen(Pty.java:140)
    at com.pty4j.unix.Pty.openMaster(Pty.java:176)
    at com.pty4j.unix.Pty.<init>(Pty.java:55)
    at com.pty4j.unix.UnixPtyProcess.<init>(UnixPtyProcess.java:83)
    at com.pty4j.PtyProcessBuilder.start(PtyProcessBuilder.java:111)
    at com.pty4j.PtyProcess.exec(PtyProcess.java:78)
    at com.pty4j.PtyProcess.exec(PtyProcess.java:49)
    at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:189)
    at org.jetbrains.plugins.terminal.LocalTerminalDirectRunner.createProcess(LocalTerminalDirectRunner.java:47)
    at org.jetbrains.plugins.terminal.AbstractTerminalRunner.lambda$openSessionInDirectory$4(AbstractTerminalRunner.java:214)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
    Suppressed: java.lang.UnsatisfiedLinkError: /opt/pycharm-community-2019.3.5/lib/pty4j-native/linux/x86/libpty.so: cannot open shared object file: No such file or directory
        at com.sun.jna.Native.open(Native Method)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
        ... 26 more
    Suppressed: java.lang.UnsatisfiedLinkError: /opt/pycharm-community-2019.3.5/lib/pty4j-native/linux/x86/libpty.so: cannot open shared object file: No such file or directory
        at com.sun.jna.Native.open(Native Method)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
        ... 26 more
    Suppressed: java.io.IOException: Native library (opt/pycharm-community-2019.3.5/lib/pty4j-native/linux/x86/libpty.so) not found in resource path (/opt/pycharm-community-2019.3.5/lib/bootstrap.jar:/opt/pycharm-community-2019.3.5/lib/extensions.jar:/opt/pycharm-community-2019.3.5/lib/util.jar:/opt/pycharm-community-2019.3.5/lib/jdom.jar:/opt/pycharm-community-2019.3.5/lib/log4j.jar:/opt/pycharm-community-2019.3.5/lib/trove4j.jar:/opt/pycharm-community-2019.3.5/lib/jna.jar)
        at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:276)
        ... 26 more

有人知道如何解决此问题吗?预先谢谢你。

2 个答案:

答案 0 :(得分:3)

https://github.com/JetBrains/pty4j/issues/82中发现:

git clone https://github.com/JetBrains/pty4j.git
cd pty4j/native
gcc -fPIC -c *.c
gcc -shared -o libpty.so *.o
cp libpty.so YOUR_PYCHARM_INSTALL_LOCATION/lib/pty4j-native/linux/x86/

答案 1 :(得分:0)

就我而言,由于 linux 版本,hwase0ng 命令无法立即生效。我必须创建一个文件夹 YOUR_PYCHARM_INSTALL_LOCATION/lib/pty4j-native/linux/arm 并将 libpty.so 复制到该文件夹​​中。