Should I install Anaconda (or miniconda) Python?

Tao Zhang tao.zhang at colorado.edu
Sat Apr 29 16:27:24 UTC 2023


Hi Balthasar & all,

   After I installed Anaconda python, previous command "python3" and 
abbreviation does not work anymore (see 1)
   I use .cshrc (see 2) file. I find that .bash_profile is changed (see 3).

  I use "conda deactivate" to exit the Anaconda python, it does not work 
(see 4)

  How can I return to previous state in which .cshrc and associated 
command can work if I do not uninstall the Anaconda python?

  Thanks
  Tao


1) [MacBook-Pro:~] tzhang% python3
python3: Command not found.


2) my .cshrc file
"setenv PATH /usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH"

3)  .bash_profile  after installing Anaconda python
-------------
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/tzhang/anaconda3/bin/conda' 'shell.bash' 'hook' 
2> /dev/null)"
if [ $? -eq 0 ]; then
     eval "$__conda_setup"
else
     if [ -f "/Users/tzhang/anaconda3/etc/profile.d/conda.sh" ]; then
         . "/Users/tzhang/anaconda3/etc/profile.d/conda.sh"
     else
         export PATH="/Users/tzhang/anaconda3/bin:$PATH"
     fi
fi
unset __conda_setup
# <<< conda initialize <<<
-------

4)
[MacBook-Pro:~] tzhang% conda deactivate
[MacBook-Pro:~] tzhang% python3
python3: Command not found.



On 4/28/23 6:57 PM, Balthasar Indermuehle wrote:
> The same, so long as your anaconda environment is activated. Type 
> conda activate <env name> to activate
>
> On Sat, 29 Apr 2023 at 10:49, Tao Zhang <tao.zhang at colorado.edu> wrote:
>
>     Hi Balthasar,
>
>       Thanks for your helpful info.
>
>       For now, I am using  "python3 filename.py" to run python code in
>     Mac terminal.
>       I am asking what's the new command to run python code with
>     Anaconda in the terminal?
>       Thanks
>       Tao
>
>
>     On 4/28/23 6:30 PM, Balthasar Indermuehle wrote:
>>     Anaconda/miniconda install themselves into a completely separate
>>     directory.
>>
>>     On installing, it'll offer to add itself to the startup scripts
>>     so when you open a terminal, it will automatically load the
>>     anaconda/miniconda environment. type "conda deactivate" to exit
>>     from that if you want to use your other local python install.
>>
>>     I personally found myself moving towards anaconda immediately
>>     after installing it for the first time. Removes a huge headache
>>     of package compatibility issues. Just create a new environment if
>>     you need to use a package that doesn't play nice with others.
>>
>>
>>     On Sat, 29 Apr 2023 at 10:13, Tao Zhang <tao.zhang at colorado.edu>
>>     wrote:
>>
>>         Hi, all
>>
>>            I want to attend a python workshop which requires the
>>         installation of
>>         Anaconda Python, see the info. below.
>>
>>            Since I have already installed python in my Macbook pro
>>         through
>>         Macport (see info. below),
>>
>>            I am asking if I still need to install Anaconda Python?
>>
>>            Does this Anaconda Python conflict with the installed
>>         Macport python?
>>
>>           Thanks
>>
>>           Tao
>>
>>           /Users/tzhang> which python3
>>         /opt/local/bin/python3
>>         /Users/tzhang> python3
>>         Python 3.9.1 (default, Dec  8 2020, 11:52:28)
>>         [Clang 10.0.1 (clang-1001.0.46.4)] on darwin
>>         Type "help", "copyright", "credits" or "license" for more
>>         information.
>>          >>>
>>
>>         -----------------------------
>>
>>         commands.
>>         9:00 - 10:00
>>         Office hours by appointment: Python/Anaconda Troubleshooting
>>         and Assistance
>>         10:00 - 10:05 (5 min)
>>         Welcome and opening remarks
>>         Topic
>>         Application/Package(s)
>>         10:05 - 10:45
>>         (40 mins)
>>         Topic 1: Getting Started with Python and Jupyter Notebooks
>>         Jupyter Notebook
>>         NumPy
>>         Pandas
>>
>>         Notes:
>>         • This tutorial is hands on, you will need to have Anaconda (or
>>         miniconda) Python installed on your computer prior to the
>>         workshop
>>
>>         Install Python via Anaconda
>>         Install the latest version of Anaconda on your local machine
>>         for this
>>         tutorial.
>>         Need help installing Anaconda? Video tutorial on YouTube.
>>         Note: some of
>>         the packages in the video might not apply to this workshop.
>>         Use the list
>>         below.
>>         Additional packages: Install the following extra package for
>>         Python by
>>         going to Start  Anaconda3  Anaconda Prompt (PC Users) or
>>         the terminal
>>         (Mac/Linux users) and type:
>>         conda install -c conda-forge cartopy
>>         conda install -c conda-forge h5netcdf
>>         conda install -c conda-forge xarray
>>         conda install -c conda-forge s3fs
>>
>>         Check if the install is successful
>>         Launch Jupyter Notebooks from the Anaconda Navigator
>>         • PC Users: Go to Start  Anaconda3  Jupyter Notebook
>>         • Mac/Linux Users: Type Jupyter notebook into the terminal
>>
>>         ---------------
>>
>
> -- 
>
> Dr Balthasar Indermühle
> Inside Systems Pty Ltd
> 5007/101 Bathurst Street
> Sydney NSW 2000, Australia
> t: +61 (0)405 988 500
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20230429/d98e4517/attachment.htm>


More information about the macports-users mailing list