簡體   English   中英

我可以同時使用 Python2 和 Python3 在 PyCharm 中調試嗎

[英]Can I use both Python2 and Python3 to debug in PyCharm

我已經在我的 windows 上安裝了 Python 3,但最近我需要在一個項目中使用 Python 2。 我在我的anaconda中新建了一個環境,但是在PyCharm中我想調試Python 2代碼時,出現了問題:

(連接到 Python 調試器失敗 非套接字上的套接字操作:配置阻塞)

I can only debug Python 3 code in pycharm in another environment, there's no problem, because Python 3 is in my windows path with a name Python (am I right?), and I add Python 2 to my windows path too, but I renamed它是 Python 2 而不是 python 以避免相同的路徑名。 這就是為什么 pycharm 無法識別 Python 2 並調試我的 Python 2 代碼的問題嗎? 如果是,我該如何解決它以使 pycharm 可以同時調試 Python 2 和 Python 3。或者如果不是,那是什么問題? 感謝你們!!

I am not a Pycharm expert, but i would do the following, uninstall all Python installations, Install first Python 2.x, create a virtual environment for my project with Python 2.X and then install Python 3.X and create a new virtual環境,根據我的經驗,你可以有兩個不同的虛擬環境,不同的 Python 版本

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM