【问题标题】:When opening Terminal posts export 'not a valid identifier' for Python source activate打开终端帖子时,为 Python 源激活导出“不是有效标识符”
【发布时间】:2014-07-03 10:43:33
【问题描述】:

我正在运行 Mac OS X v10.9.2。当我登录到我的终端时,我立即受到以下信息的欢迎:

Last login: Wed May 14 22:45:00 on ttys007
-bash: export: `/Users/NabilKaz/Library/Enthought/Canopy_64bit/User/bin/activate': not a valid identifier

我使用 Enthought Canopy,我猜它正在激活 Python 虚拟环境?

这是我的 .bash_profile 的内容:

export PATH="/usr/local/mysql/bin:$PATH"L_ENV_DISABLE_PROMPT=1 source /Users/NabilKaz/Library/Enthought/Canopy_64bit/User/bin/activate


[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

# Added by Canopy installer on 2014-02-19
# VIRTUAL_ENV_DISABLE_PROMPT can be set to '' to make bashprompt show that Canopy is active, otherwise 1
VIRTUAL_ENV_DISABLE_PROMPT=1 source /Users/NabilKaz/Library/Enthought/Canopy_64bit/User/bin/activate

【问题讨论】:

  • 在导出行的L_ENV_DISABLE_PROMPT=1前加一个空格。

标签: python bash terminal .bash-profile


【解决方案1】:

这一行:

export PATH="/usr/local/mysql/bin:$PATH"L_ENV_DISABLE_PROMPT=1 source /Users/NabilKaz/Library/Enthought/Canopy_64bit/User/bin/activate

应该是

export PATH="/usr/local/mysql/bin:$PATH"
L_ENV_DISABLE_PROMPT=1 source /Users/NabilKaz/Library/Enthought/Canopy_64bit/User/bin/activate

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-28
    • 2016-04-21
    • 2013-02-28
    • 2016-11-18
    • 2015-01-22
    • 2020-11-06
    • 1970-01-01
    相关资源
    最近更新 更多