gpt4 book ai didi

python - .bashrc 保存用于导出

转载 作者:行者123 更新时间:2023-12-02 03:50:36 27 4
gpt4 key购买 nike

我已经安装了 anaconda 但还没有添加到 bashrc 中。

在终端中输入:

export PATH="/home/my_pc/anaconda3/bin:$PATH"

然后是python都运行良好。

Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

但是当我关闭终端时,一切都会恢复到旧配置:

my_pc@y_pc:~$ conda
conda: command not found
my_pc@my_pc:~$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

如何保存新的导出路径配置?

最佳答案

这应该适合你:

# Permanent change that requires logging out
echo 'export PATH="/home/my_pc/anaconda3/bin:$PATH"' >> ~/.bash_profile

或者,如果您愿意的话:

# ~/.bashrc is sourced every time you launch a new terminal, so no need for logging out
echo 'export PATH="/home/my_pc/anaconda3/bin:$PATH"' >> ~/.bashrc

关于python - .bashrc 保存用于导出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45596833/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com