问题
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