【发布时间】:2021-07-08 06:31:05
【问题描述】:
我试图在我的 macOS 10.14.6 上设置一些 python 请求的环境变量,但是当我在/etc/ 查找我的 bashrc 文件时,我什么也做不了(nano ~/.bashrc),因为我只有权限读取文件。让我感到疑惑的是,这个文件被命名为 bashrc 而不是 .bashrc,这与我的 bash_profile 相同。
希望你能帮助我,我一直在寻找答案,但没有找到适合我的答案。
【问题讨论】:
-
你试过
sudo nano ~/.bashrc而不是nano ~/.bashrc吗? -
另外,请确保您的终端使用的是
bash。 MacOS 现在使用zshrc作为默认 shell。您可以在交互式终端会话中使用echo $0检查您当前的 shell。 如果您使用的是zsh,请根据需要修改zprofile文件。如果你想改变你的shell到bash,使用chsh -s bash <username>
标签: python-3.x bash macos pip