简体   繁体   中英

Can I use both Python2 and Python3 to debug in PyCharm

I'v already installed Python 3 on my windows, but recently I needed to use Python 2 for a project. I created a new environment in my anaconda, but in PyCharm I when wanted to debug the Python 2 code, a problem occured:

(Connection to Python debugger failed Socket operation on nonsocket: configure Blocking)

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 it Python 2 not python to avoid the same path names. Is this the problem why pycharm can't recognize Python 2 and to debug my Python 2 code? If it is, how can I solve it to make pycharm can debug both Python 2 and Python 3. Or If it isn't, what's the problem? Thank you guys!!

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 environment, from my experience you can have two different virtual environment with different Python version

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM