问题描述
这更像是一个关于如何正确设置路径的 n00b Unix 问题.这也不是 julia
特有的问题,而是一般来说如何正确设置路径(我怀疑).
This is more of a n00b Unix question regarding how to set up paths correctly. It is also not a question that is specific to julia
, but rather how to set up paths correctly in general (I suspect).
目前,我可以通过终端启动 julia
的唯一方法是使用以下命令:
At the moment, the only way I can start julia
via the Terminal is by using the command:
$ exec '/Applications/Julia-0.4.0.app/Contents/Resources/julia/bin/julia'
而不是$ julia
如何正确设置?
推荐答案
切换到你的主目录并找到文件
.bash_profile
(注意.
开头:这是一个隐藏文件.你可以做ls -a
看看它是否在那里,或者只是尝试用编辑器打开它.)
Change to your home directory and find the file
.bash_profile
(note the.
at the start: this is a hidden file. You can dols -a
to see if it is there, or just try to open it with an editor.)
如果 .bash_profile
文件尚不存在(例如,使用您喜欢的文本编辑器),请创建它.
Create the .bash_profile
file if it doesn't already exist (e.g. using your favourite text editor).
在某处添加以下行:
alias julia="/Applications/Julia-0.4.1.app/Contents/Resources/julia/bin/julia"
打开一个新的终端窗口,尽情享受吧!
Open a new terminal window and enjoy!
(注意0.4.1是当前最新的稳定版本,我这里用的是这个.)
(Note that 0.4.1 is the current latest stable version, which is what I have used here.)
这篇关于如何设置您的路径,以便您可以通过终端呼叫“julia"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!