简体   繁体   English

在远程 python 3 解释器周围使用包装器时,如何在 Pycharm 中禁用 python 2.7 代码兼容性错误消息?

[英]How can I disable python 2.7 code compatibility error message in Pycharm when using wrapper around remote python 3 interpreter?

I want to avoid these kind of messages popping up, as I am not even using python 2.7.我想避免弹出此类消息,因为我什至没有使用 python 2.7。 Note that the code runs fine.请注意,代码运行良好。

I have tried the following things:我尝试了以下事情:

I am using a.sh wrapper around the python executable on the server as I want Pycharm to first source my ~/.bash_profile before using the interpreter (similar to this advice ).我在服务器上的 python 可执行文件周围使用 a.sh 包装器,因为我希望 Pycharm 在使用解释器之前首先获取我的 ~/.bash_profile (类似于此建议)。 I think that this might be the reason PyCharm doesn't recognize it as being python 3: if I point directly to the remote interpreter, the code compatibility issue dissappears.我认为这可能是 PyCharm 无法将其识别为 python 的原因 3:如果我直接指向远程解释器,代码兼容性问题就会消失。

Is there any way to keep the benefits of the wrapper and getting rid of these error messages?有什么方法可以保留包装器的好处并消除这些错误消息?

You're right, PyCharm is unable to determine Python version and uses 2.7 as a fallback.没错,PyCharm 无法确定 Python 版本,并使用 2.7 作为后备。

Since 2019.3 the latest Python is used by default (3.8 at the moment), please try the EAP build.由于2019.3默认使用最新的Python(目前为3.8),请尝试EAP构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Pycharm 无法远程运行 python 解释器错误 - Pycharm Can't run remote python interpreter error Pycharm 运行“测试”时出错:无法运行远程 python 解释器:{0} - Pycharm Error running 'test': can't run remote python interpreter: {0} Pycharm无法将解释器从python 2.7更改为3.4 - Pycharm can't change interpreter from python 2.7 to 3.4 无法将Jetbrains Pycharm python解释器从3.6更改为2.7 - Can't Change Jetbrains Pycharm python interpreter from 3.6 to 2.7 在Pycharm中配置远程Python解释器 - Configuring Remote Python Interpreter in Pycharm PyCharm 远程调试使用远程容器 Python 解释器 - PyCharm remote debug using remote container Python interpreter 如何在使用 PyCharm 的远程计算机上调试从 Python 调用的 C++ 代码? - How can I debug C++ code called from Python on a remote machines using PyCharm? 为什么在 Windows 机器上使用 PyCharm 时不能使用基于 Linux 的 Python 解释器? - Why can't I use a Linux-based Python interpreter when using PyCharm on a Windows machine? 如何使用Docker Python解释器在PyCharm中的调试中执行测试? - How can I execute my tests in Debug in PyCharm using a Docker Python Interpreter? 如何解决Python 2.7中以下代码的语法错误? - How can I solve syntax error for the following code in Python 2.7?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM