pyenv global 3.6.4rc1无效

时间:2018-01-27 14:25:27

标签: python pyenv

我正在使用zsh。这是我的.zshenv

cat ~/.zshenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"

这是我的路径:

echo $PATH
/Users/myuser/Downloads/google-cloud-sdk/bin:/Users/myuser/.pyenv/shims:/Users/myuser/.pyenv/bin:/Users/myuser/.rvm/gems/ruby-2.4.1/bin:/Users/myuser/.rvm/gems/ruby-2.4.1@global/bin:/Users/myuser/.rvm/rubies/ruby-2.4.1/bin:/Users/myuser/Downloads/google-cloud-sdk/bin:/Users/myuser/.nvm/versions/node/v8.4.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myuser/.pyenv/bin:/Users/myuser/.rvm/bin

现在尝试将python版本更改为3.6.4rc1,它在2.7中说明如下:

➜  ~ pyenv versions
  system
* 3.6.4rc1 (set by /Users/myuser/.pyenv/version)
➜  ~ pyenv global 3.6.4rc1
➜  ~ python --version
Python 2.7.10 # Why doesn't it change to 3.6.4rc1?

但是我需要提供源.zshenv然后它可以工作:

➜  ~ source ~/.zshenv
➜  ~ pyenv global 3.6.4rc1
➜  ~ python --version
Python 3.6.4rc1

我该怎么做才能使命令“正常运行”。 (注意我在Mac上)。

1 个答案:

答案 0 :(得分:0)

AHA!已解决方案已将<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedOrigin>http://localhost:9500</AllowedOrigin> <AllowedOrigin>https://localhost:9500</AllowedOrigin> <AllowedOrigin>http://www.example.com</AllowedOrigin> <AllowedOrigin>https://www.example.com</AllowedOrigin> <AllowedOrigin>http://lvh.me:9500</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <ExposeHeader>ETag</ExposeHeader> <AllowedHeader>*</AllowedHeader> <AllowedHeader>Content-Type</AllowedHeader> <AllowedHeader>Authorization</AllowedHeader> </CORSRule> </CORSConfiguration> 添加到/source Users/myuser/.zshenv,现在它正在运作。显然.zshenv没有加载到新的zsh终端上。我想知道这是否是zsh的标准或我的机器上有问题。