在OSX中永久设置PATH环境变量 [英] Setting PATH environmental variables in OSX permanently

查看:186
本文介绍了在OSX中永久设置PATH环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



首先,我尝试过,如何在Linux上永久设置$ PATH?但是我有一条错误消息说不会这样文件和目录,所以我以为可以尝试〜/ .bash_profile 而不是〜/ .profile 但它没有工作。



其次,我发现这个解决方案中的应用程序使用的$ PATH,哪些建议在

中进行更改?


〜/ .MacOSX / environment.plist


再次,我有没有这样的文件和目录错误。



我需要一种方法来设置这些变量,以便每次打开新的终端会话时都不需要再次设置它们。

解决方案

您必须将其添加到 / etc / paths



参考(适用于我):这里


I have read several answers on how to set environmental variables on OSX as permenantly,

First, I tried this, How to permanently set $PATH on Linux? but I had an error message saying no such file and directory, so I thought I could try ~/.bash_profile instead of ~/.profile but it did not work.

Second, I found this solution How to set the $PATH as used by applications in os x , which advices to make changes in

~/.MacOSX/environment.plist

but again I had no such file and directory error.

I need a way to set these variables such that it won't require to set them again and again each time I open a new terminal session.

解决方案

You have to add it to /etc/paths.

Reference (which works for me) : Here

这篇关于在OSX中永久设置PATH环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆