Pyenv no such command virtualenv-init

星期五, 10月 23, 2015

pyenv: no such command `virtualenv-init'

最近開 terminal 時,都會看到這樣的錯:

pyenv: no such command `virtualenv-init'

今 天終於想要解決這問題了,找了一下,源頭是在 oh-my-zsh 的 virtualenv plugin 裡,裏面用了 eval "$(pyenv virtualenv-init - zsh)" ,循線追到 pyenv,發現是 pyenv 沒有 pyenv-virtualenv plugin 的關係。
依照 yyuu/pyenv-virtualenv 上的說明,執行以下指令,就解決問題了。
git clone //github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
最後,順道更新 pyenv :cd ~/.pyenv && git pull --rebase origin master

張貼者(Poster): elleryq

標籤(Label): pyenv, Python

沒有留言:

張貼留言

較新的文章 較舊的文章 首頁

訂閱: 張貼留言 (Atom)

pyenv: no such command `virtualenv'

There is a venv module available for CPython 3.3 and newer. It provides an executable module venv which is the successor of virtualenv and distributed by default. pyenv-virtualenv uses python -m venv if it is available and the virtualenv command is not available.

returns) pyenv: no such command `sh-activate' The environment variable above seems work well. If you continue to have issues, raise an issue on pyenv-virtualenv.

pyenv-virtualenv windows

Lets call it HelloWold. All we do in a command prompt is enter ‘mkvirtualenv HelloWold’. This will create a folder with python.exe, pip, and setuptools all ready to go in its own little environment. It will also activate the Virtual Environment which is indicated with the (HelloWold) on the left side of the prompt.

virtualenvwrapper-win This is a port of Doug Hellmann’s virtualenvwrapper to Windows batch scripts. The idea behind virtualenvwrapper is to ease usage of Ian Bicking’s virtualenv, a tool for creating isolated Python virtual environments, each with their own libraries and site-packages.

If you are using Python 3.3 or newer, the venv module is the preferred way to create and manage virtual environments. venv is included in the Python standard library and requires no additional installation. If you are using venv, you may skip this section. virtualenv is used to manage Python packages for different projects.

pyenv on ubuntu

Installing multiple versions of Python on an Ubuntu system is simple and straightforward. Having access to a tool that centralizes both the management of the Python version and the discreet environments, each of those versions has is something that saves time and makes the development process that much easier.

Installing pyenv is rather straight forward, one simply has to run the command below curl -L //raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash And when you tried to install a python version, you will probably see the follow error or something similar.

If you are using Pyenv, you must build python with tk support. Else, you need to run sudo apt-get install python3-tk or sudo apt-get install python-tk. If you are WSL2, you need to run export DISPLAY=`grep -oP "(?<=nameserver).+" /etc/resolv.conf`:0.0 (getting the IP of Windows Host/X Server from /etc/resolv.conf).

Pyenv is a simple, powerful and cross-platform tool for managing multiple Python versions on Linux systems, that used for. Switching the global Python version on a per-user basis. setting the local Python version on per-project basis. Managing of virtual environments created by anaconda or virtualenv.

This tutorial describes two ways of installing Python 3.7 on Ubuntu 18.04: By using the standard apt tool from the deadsnakes PPA, and by building from the source code. The same steps apply for Ubuntu 16.04 and any Ubuntu-based distribution, including Kubuntu, Linux Mint, and Elementary OS.

You Might Like:

  • roboto icons
  • How to reverse a string
  • ErrorDocument
  • jersey security
  • react native scroll up or down
  • python dictionary with duplicate keys
  • Node URL encode
  • error in no ngmodule metadata found for admin module
  • How to convert datetime to readable string in Python
  • Servlet Web Page Redirection

Questions : pyenv: no such command `virtualenv

2022-10-15T05:35:46+00:00 2022-10-15T05:35:46+00:00

864

I'm following a tutorial on setting up torch anycodings_python on ubuntu 20.04 one line requires to setup anycodings_python pyenv which is like virtualenv for python so anycodings_python I can have multiple versions of python anycodings_python running. A bit unnecessary but it's a anycodings_python learning process and a good chance to learn anycodings_python of another new tool I might use another day.

So this command after successfully setting anycodings_python up pyenv fails

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

so to cover my basics I already have anycodings_python virtualenv installed as shown here

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

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: //github.com/pyenv/pyenv#readme

Total Answers 1

27

Answers 1 : of pyenv: no such command `virtualenv

This was discussed in the thread under anycodings_python your comment but you need anycodings_python pyenv-virtualenv.

How to download: anycodings_python //github.com/pyenv/pyenv-virtualenv

Easy way is via homebrew on mac brew anycodings_python install pyenv-virtualenv

0

2022-10-15T05:35:46+00:00 2022-10-15T05:35:46+00:00Answer Link

mRahman

How do I activate Pyenv environment?

Normally, you should activate your environments by running the following:.
$ pyenv local myproject. ... .
$ pyenv which python /home/realpython/.pyenv/versions/myproject/bin/python. ... .
$ pyenv which pip /home/realpython/.pyenv/versions/myproject/bin/pip. ... .
$ pyenv activate <environment_name> $ pyenv deactivate..

How do I activate Pyenv shell?

Installing as a pyenv plugin.
(OPTIONAL) Add pyenv virtualenv-init to your shell to enable auto-activation of virtualenvs. This is entirely optional but pretty useful. See "Activate virtualenv" below. $ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc. ... .
Restart your shell to enable pyenv-virtualenv. $ exec "$SHELL".

How do you create a virtual environment in Python using Pyenv?

pyenv-virtualenv.
brew install pyenv-virtualenv..
cd Python/Learning/Python_Playgrounds..
pyenv local 3.9.1..
pyenv virtualenv 3.9.1 venv_python_playground..
pyenv local venv_python_playground..
pyenv activate venv_python_playground. pyenv deactivate..
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc..

How do I know if Pyenv is installed?

To verify pyenv installation, just type pyenv doctor . By default, checking development tools to build CPython.

Related Posts

Toplist

Latest post

TAGs