简体   繁体   English

pyenv:没有这样的命令“virtualenv”

[英]pyenv: no such command `virtualenv'

I'm following a tutorial on setting up torch on ubuntu 20.04 one line requires to setup pyenv which is like virtualenv for python so I can have multiple versions of python running.我正在关注关于在 ubuntu 20.04 上设置 Torch 的教程,一行需要设置pyenv ,这就像 python 的 virtualenv,所以我可以运行多个版本的 python。 A bit unnecessary but it's a learning process and a good chance to learn of another new tool I might use another day.有点不必要,但这是一个学习过程,也是学习另一种我可能改天使用的新工具的好机会。

So this command after successfully setting up pyenv fails所以成功设置pyenv后这个命令失败

sam@sam:~/torch$ pyenv virtualenv 3.8.2 torch
pyenv: no such command `virtualenv'

so to cover my basics I already have virtualenv installed as shown here所以为了涵盖我的基础知识,我已经安装了 virtualenv,如下所示

sam@sam:~/torch$ virtualenv
usage: virtualenv [--version] [--with-traceback] [-v | -q] [--app-data APP_DATA] [--clear-app-data] [--discovery {builtin}] [-p py] [--creator {builtin,cpython3-posix,venv}] [--seeder {app-data,pip}] [--no-seed]
                [--activators comma_sep_list] [--clear] [--system-site-packages] [--symlinks | --copies] [--download | --no-download] [--extra-search-dir d [d ...]] [--progress version] [--retrying version] [--urllib3 version]
                [--pep517 version] [--colorama version] [--CacheControl version] [--certifi version] [--requests version] [--contextlib2 version] [--appdirs version] [--chardet version] [--pytoml version] [--html5lib version]
                [--lockfile version] [--six version] [--webencodings version] [--pyparsing version] [--setuptools version] [--packaging version] [--wheel version] [--ipaddr version] [--idna version] [--pip version] [--distro version]
                [--pkg_resources version] [--distlib version] [--msgpack version] [--no-progress] [--no-retrying] [--no-urllib3] [--no-pep517] [--no-colorama] [--no-CacheControl] [--no-certifi] [--no-requests] [--no-contextlib2]
                [--no-appdirs] [--no-chardet] [--no-pytoml] [--no-html5lib] [--no-lockfile] [--no-six] [--no-webencodings] [--no-pyparsing] [--no-setuptools] [--no-packaging] [--no-wheel] [--no-ipaddr] [--no-idna] [--no-pip] [--no-distro]
                [--no-pkg_resources] [--no-distlib] [--no-msgpack] [--symlink-app-data] [--prompt prompt] [-h]
                dest
virtualenv: error: the following arguments are required: dest

and pyenv is installed as shown here并安装了 pyenv,如下所示

sam@sam:~/torch$ pyenv
pyenv 1.2.19-1-gece59ca8
Usage: pyenv <command> [<args>]

Some useful pyenv commands are:
commands    List all available pyenv commands
exec        Run an executable with the selected Python version
global      Set or show the global Python version(s)
help        Display help for a command
hooks       List hook scripts for a given pyenv command
init        Configure the shell environment for pyenv
install     Install a Python version using python-build
local       Set or show the local application-specific Python version(s)
prefix      Display prefix for a Python version
rehash      Rehash pyenv shims (run this after installing executables)
root        Display the root directory where versions and shims are kept
shell       Set or show the shell-specific Python version
shims       List existing pyenv shims
uninstall   Uninstall a specific Python version
--version   Display the version of pyenv
version     Show the current Python version(s) and its origin
version-file   Detect the file that sets the current pyenv version
version-name   Show the current Python version
version-origin   Explain how the current Python version is set
versions    List all Python versions available to pyenv
whence      List all Python versions that contain the given executable
which       Display the full path to an executable

See `pyenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/pyenv/pyenv#readme

This was discussed in the thread under your comment but you need pyenv-virtualenv.这在您评论下的线程中进行了讨论,但您需要 pyenv-virtualenv。

How to download: https://github.com/pyenv/pyenv-virtualenv下载方式: https://github.com/pyenv/pyenv-virtualenv

Easy way is via homebrew on mac brew install pyenv-virtualenv简单的方法是通过 mac 上的自制软件brew install pyenv-virtualenv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM