简体   繁体   中英

What can I expect to change about how I write python on my Mac after I install conda?

Background

Currently, I have Python 2.7.17 and Python 3.8.1 installed on my Mac (v 10.14.6 ). Both Python versions were downloaded directly from Python.org using a "macOS 64-bit installer".pkg file, in late 2019. Both were installed here:

python2: /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
python3: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3

Currently, I use only pip (either pip2 or pip3 , depending) to install python packages, which are saved here:

python2: /Library/Frameworks/Python.framework/Versions/XX/lib/python2.7/site-packages
python3: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages

I am about to begin an online course which requires that I install miniconda in order to install the packages that I need for the course. But after having a very bad experience having Anaconda installed on my machine years ago, and it taking me months to remove it and re-create a clean Python install, I am nervous. I don't want my machine to become a mess again, rife with error messages that it can't find this or that python version or this or that python library.

Question(s)

  • Assuming there will now be multiple installations of Python on my machine (in addition to the versions that I already have, since I believe yet another version of python is installed along with conda), and there will be new places where python packages will be saved, what can I expect to change about how I write python after I install miniconda?
  • Is there anything I will need to do differently from what I am doing now when I write python code?
  • How can I ensure that everything remains working and compatible and I avoid the fate I suffered many years ago?

Happy to edit/clarify this question per user suggestions. Thanks!

Use conda environments and install Python into those environments. This ignores, by design, the versions of Python that are installed at the system level. Also, what's installed into environments (other than the one you're in) is ignored. As somebody who uses conda for all Python development, I don't even know what I have installed in /usr/local/bin/ or other places. Everything is in /path/to/miniconda3/envs/env_name_n . You don't have to uninstall other versions of Python you have elsewhere; the point of environments is to keep everything isolated.

What can I expect to change about how I write python after I install miniconda?

Is there anything I will need to do differently from what I am doing now when I write python code?

Use conda environments and use conda as your package manager. For almost every major project, it nearly a drop-in replacement for pip . Outside of managing dependencies, not much changes.

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