https://pipenv-fork.readthedocs.io/en/latest/希望这会有所帮助.Background:I have been learning Python (on MacOS) for about three months now, so please go easy on me. I began by installing Python 3.7 through Anaconda and predominantly used Jupyter Notebook to write code. As I learnt more, I found out about different text editors and IDEs, and tried out different programs: IDLE, Sublime and PyCharm.As I progressed I also learned about package management systems, such as pip and conda, and other such wonderful things that helped me achieve the things I wanted.The Problem:Problems surfaced after I installed PyCharm and Python 3.9.My computer now has four or five different versions of Python installed (2.7, 3.7, 3.8, 3.9) - some which I seem to have downloaded multiple times - and now nothing works anymore! The modules I have installed using pip don't load properly anymore, my gorgeous programs (some of which are over 600 lines long) don't run anymore - I can't even run a simple print('hello world') anymore.My files are a mess. I have probably over a 500mb of Python related junk that I don't use. I have tampered with PATHs and bins in the console, and I don't even know how to begin to sorting this out.What I Want / How You Can Help Me:An ideal solution for me would be to just have PyCharm and Jupyter Notebook installed and for them to both be able to import the modules I have installed. I would also like to remove older versions of Python and just have both Jupyter Notebook and PyCharm use 3.9 as their interpreter. Additionally, I would like to safely delete all the junk files that I have collected over the last few months, though I understand that you might not be able to help me with that.In short: I just want everything to work again!I spent weeks writing a program that was basically finished and now doesn't even make it passed the second line without throwing out an error.Do you have any advice / potential solutions? I am open to anything, including backing up my files and reseting my whole mac (though I'd like to reserve this as plan C).Please, correct me if I have said anything wrong in my question - I am still getting to grips with the lingo, and I feel as if I am asking for help on a problem I can't express properly - and please write your solution as plainly as possible, explaining anything you feel a beginner may not understand.Thanks in advance. 解决方案 I have solved my own problem but it took quite a bit of investigation, and will outline what I did:Reset my Mac (this was not necessary but I wanted to do it anyway)Install home-brewInstall pyenvInstall pipenvFor anyone experiencing the same problems, you should look definitely into pyenv and pipenv as a way of managing your Python versions and modules.I won't go into too much detail, as plenty of other already have, but will post some links to some good articles that helped me:https://opensource.com/article/19/5/python-3-default-machttps://realpython.com/intro-to-pyenv/https://pipenv-fork.readthedocs.io/en/latest/Hope this helps. 这篇关于如何配置Python并组织我的解释器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-07 03:07