Я установил pyenv с помощью homebrew, но когда я пытаюсь активировать pyenv с помощью команды:
pyenv shell 3.8.3,
я получаю следующее сообщение:
pyenv: shell integration not enabled. Run `pyenv init' for instructions.
Итак, я бегу:
pyenv init
а затем он говорит:
# Load pyenv automatically by appending # the following to ~/.zshrc: eval "$(pyenv init -)
Я не знаю, как это сделать, знает ли кто-нибудь, как это сделать? Я использую mac os High Sierra 10.13.6.
В конечном итоге я хочу использовать Python 3.7.4, поэтому я установил pyenv. Если я наберу
pyenv global 3.7.4
в командную строку я получаю
pyenv: version `3.7.4' not installed
но я установил python 3.7.4. Если я напечатаю
python -V
в командную строку я получаю Python 3.8.3. Как установить python3.7.4, чтобы pyenv его увидел. Также следует отметить, что у меня были проблемы с b4 с bash, когда мне нужно было ввести:
PATH=/Users/myHomepage/opt/anaconda3/bin:$PATH
чтобы активировать мою виртуальную среду ранее.
Я видел учебник о том, как настроить pyenv для нескольких питонов, в котором он говорит, что мы должны добавить настройки в наш профиль bash, чтобы ввести следующие три команды:
$ echo ‘export PYENV_ROOT=“$HOME/.pyenv”’ >> ~/.bash_profile
$ echo 'export PATH=“$PYEN_ROOT/bin:$PATH” >>.bash.profile
$ echo ‘eval “$(pyenv init -)”’ >>~/.bash_profile
но я использую zsh, поэтому ввожу:
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
Я выполнил только две команды под zsh, я не знаю, почему я получаю сообщение об ошибке при перезапуске zsh:
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x 3 myHomepage admin 102 Oct 7 20:04 /usr/local/share/zsh
drwxrwxr-x 4 myHomepage admin 136 Oct 7 20:26 /usr/local/share/zsh/site-functions
[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.
[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh] compaudit | xargs chmod g-w,o-w
[oh-my-zsh] If the above didn't help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.
➜ ~ exec "$SHELL"
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x 3 myHomepage admin 102 Oct 7 20:04 /usr/local/share/zsh
drwxrwxr-x 4 myHomepage admin 136 Oct 7 20:26 /usr/local/share/zsh/site-functions
[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.
[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh] compaudit | xargs chmod g-w,o-w
[oh-my-zsh] If the above didn't help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.
поэтому я набрал:
compaudit | xargs chmod g-w,o-w
но все равно досталось:
There are insecure directories:
поэтому я помещаю это в командную строку:
exec "$SHELL"
затем я установил python 3.7.4 в свой проект папки, похоже, он работает, но я не уверен в сообщении об ошибке. Есть небезопасные каталоги:
‘
“
”
’
- символы Юникода. Синтаксис оболочки требует сбалансированного использования стандартных кавычек'
&"
. - person   schedule 09.10.2020