如何设置路径,以便您可以通过终端呼叫"julia"? [英] How to set up your path so you can call 'julia' via the Terminal?

查看:142
本文介绍了如何设置路径,以便您可以通过终端呼叫"julia"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这更多是关于如何正确设置路径的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

如何正确设置?

推荐答案

  1. 转到主目录并找到文件.bash_profile(请注意开头的.:这是一个隐藏文件.您可以执行ls -a来查看是否存在该文件,或者只是尝试使用编辑器将其打开.)

  1. Change to your home directory and find the file .bash_profile (note the . at the start: this is a hidden file. You can do ls -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).

在以下位置添加以下行:

Add the following line somewhere:

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"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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