Pyenv: How to 'rebuild' virtualenvs after rebuilding python

孤人 提交于 2021-02-10 13:29:10

问题


I rebuilt python 3.7 to get pyinstaller to work on Mac, and it seems to have deleted all my virtualenvs using 3.7.0.

The .python-version files still exist, and they point at the location I would expect. But when I run 'pyenv virtualenvs' there's no python3 environments at all, and in the project directory, the python command doesn't work at all.

3.7.0/envs/some-scripts```


```$ ls ~/.pyenv/versions/3.7.0/envs/some-scripts/bin/
activate        chardetect      macho_find      netaddr         pydoc           pyi-makespec        python3
activate.csh        easy_install        macho_standalone    pip         pyi-archive_viewer  pyi-set_version
activate.fish       easy_install-3.7    mako-render     pip3            pyi-bindepend       pyinstaller
alembic         macho_dump      natsort         pip3.7          pyi-grab_version    python```


```$ pyenv virtualenvs
  2.7.10/envs/some-scripts-2 (created from /Users/mememe/.pyenv/versions/2.7.10)
  2.7.10/envs/gdrive (created from /Users/mememe/.pyenv/versions/2.7.10)
  arista-scripts-2 (created from /Users/mememe/.pyenv/versions/2.7.10)
  gdrive (created from /Users/mememe/.pyenv/versions/2.7.10)```

See? no 3, and no asterisk, despite being in the project directory.

回答1:


I don't know how did you rebuild pyenv, though for me running:

$ pyenv install $(previously installed python name to update)

than

$ pyenv rehash

Rebuild python and updated shims just fine.



来源:https://stackoverflow.com/questions/56994638/pyenv-how-to-rebuild-virtualenvs-after-rebuilding-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!