virtualenv virtualenvwrapper virtualenv: error: unrecognized arguments: --no-site-packages
virtualenv virtualenvwrapper virtualenv: error: unrecognized arguments: --no-site-packages
我正在尝试将 python 从 3.6 升级到 3.8。我成功地使用 virtualenv/wrapper 成功了(虽然只有一个环境,没有花里胡哨的东西),但升级并不顺利。我删除了所有内容并尝试重新开始。我正在尝试使用 mkvirtualenv test
创建一个新环境,但现在出现错误:
virtualenv: error: unrecognized arguments: --no-site-packages
在它给出一个关于如何调用 virtualenv
的人(真正)建议之后,这让我相信 virtualenvwrapper
正在工作,但我错过了一些东西。
这是我的详细信息:
终端(osx - 10.13.6 (17G65))
today@5 ~/dev/MST/server(master)$ which python
/usr/bin/python
today@5 ~/dev/MST/server(master)$ which python3
/usr/local/bin/python3
today@5 ~/dev/MST/server(master)$ which pip
/usr/local/bin/pip
today@5 ~/dev/MST/server(master)$ which pip3
today@5 ~/dev/MST/server(master)$ pip -V
-bash: /usr/local/bin/pip: /usr/local/opt/python/bin/python3.6: bad interpreter: No such file or directory
today@5 ~/dev/MST/server(master)$ pip3 -V
pip 20.0.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
today@5 ~/dev/MST/server(master)$ pip3 install virtualenv virtualenvwrapper
Requirement already satisfied: virtualenv in /usr/local/lib/python3.8/site-packages (20.0.13)
Requirement already satisfied: virtualenvwrapper in /usr/local/lib/python3.8/site-packages (4.8.4)
Requirement already satisfied: filelock<4,>=3.0.0 in /usr/local/lib/python3.8/site-packages (from virtualenv) (3.0.12)
Requirement already satisfied: appdirs<2,>=1.4.3 in /usr/local/lib/python3.8/site-packages (from virtualenv) (1.4.3)
Requirement already satisfied: six<2,>=1.9.0 in /usr/local/lib/python3.8/site-packages (from virtualenv) (1.14.0)
Requirement already satisfied: distlib<1,>=0.3.0 in /usr/local/lib/python3.8/site-packages (from virtualenv) (0.3.0)
Requirement already satisfied: stevedore in /usr/local/lib/python3.8/site-packages (from virtualenvwrapper) (1.32.0)
Requirement already satisfied: virtualenv-clone in /usr/local/lib/python3.8/site-packages (from virtualenvwrapper) (0.5.3)
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /usr/local/lib/python3.8/site-packages (from stevedore->virtualenvwrapper) (5.4.4)
today@5 ~/dev/MST/server(master)$ which virtualenv
/usr/local/bin/virtualenv
today@5 ~/dev/MST/server(master)$ which virtualenvwrapper
today@5 ~/dev/MST/server(master)$
today@5 ~/dev/MST/server(master)$ workon
today@5 ~/dev/MST/server(master)$
today@5 ~/dev/MST/server(master)$ mkvirtualenv test
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 ...]] [--pip version] [--setuptools version] [--wheel version] [--no-pip]
[--no-setuptools] [--no-wheel] [--symlink-app-data] [--prompt prompt] [-h]
dest
virtualenv: error: unrecognized arguments: --no-site-packages
~/.bash_profile
#…
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
source /usr/local/bin/virtualenvwrapper.sh
#…
注意-
- 尝试安装 virtualenvwrapper 它说版本 4.8.4,但在线文档说它在 5.x
--no-site-packages
是 virtualenv
的默认值(已经有 5 年了?)您可以从 .bashrc
中删除 export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
virtualenv>=20
中显示此选项已删除
我正在尝试将 python 从 3.6 升级到 3.8。我成功地使用 virtualenv/wrapper 成功了(虽然只有一个环境,没有花里胡哨的东西),但升级并不顺利。我删除了所有内容并尝试重新开始。我正在尝试使用 mkvirtualenv test
创建一个新环境,但现在出现错误:
virtualenv: error: unrecognized arguments: --no-site-packages
在它给出一个关于如何调用 virtualenv
的人(真正)建议之后,这让我相信 virtualenvwrapper
正在工作,但我错过了一些东西。
这是我的详细信息:
终端(osx - 10.13.6 (17G65))
today@5 ~/dev/MST/server(master)$ which python
/usr/bin/python
today@5 ~/dev/MST/server(master)$ which python3
/usr/local/bin/python3
today@5 ~/dev/MST/server(master)$ which pip
/usr/local/bin/pip
today@5 ~/dev/MST/server(master)$ which pip3
today@5 ~/dev/MST/server(master)$ pip -V
-bash: /usr/local/bin/pip: /usr/local/opt/python/bin/python3.6: bad interpreter: No such file or directory
today@5 ~/dev/MST/server(master)$ pip3 -V
pip 20.0.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
today@5 ~/dev/MST/server(master)$ pip3 install virtualenv virtualenvwrapper
Requirement already satisfied: virtualenv in /usr/local/lib/python3.8/site-packages (20.0.13)
Requirement already satisfied: virtualenvwrapper in /usr/local/lib/python3.8/site-packages (4.8.4)
Requirement already satisfied: filelock<4,>=3.0.0 in /usr/local/lib/python3.8/site-packages (from virtualenv) (3.0.12)
Requirement already satisfied: appdirs<2,>=1.4.3 in /usr/local/lib/python3.8/site-packages (from virtualenv) (1.4.3)
Requirement already satisfied: six<2,>=1.9.0 in /usr/local/lib/python3.8/site-packages (from virtualenv) (1.14.0)
Requirement already satisfied: distlib<1,>=0.3.0 in /usr/local/lib/python3.8/site-packages (from virtualenv) (0.3.0)
Requirement already satisfied: stevedore in /usr/local/lib/python3.8/site-packages (from virtualenvwrapper) (1.32.0)
Requirement already satisfied: virtualenv-clone in /usr/local/lib/python3.8/site-packages (from virtualenvwrapper) (0.5.3)
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /usr/local/lib/python3.8/site-packages (from stevedore->virtualenvwrapper) (5.4.4)
today@5 ~/dev/MST/server(master)$ which virtualenv
/usr/local/bin/virtualenv
today@5 ~/dev/MST/server(master)$ which virtualenvwrapper
today@5 ~/dev/MST/server(master)$
today@5 ~/dev/MST/server(master)$ workon
today@5 ~/dev/MST/server(master)$
today@5 ~/dev/MST/server(master)$ mkvirtualenv test
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 ...]] [--pip version] [--setuptools version] [--wheel version] [--no-pip]
[--no-setuptools] [--no-wheel] [--symlink-app-data] [--prompt prompt] [-h]
dest
virtualenv: error: unrecognized arguments: --no-site-packages
~/.bash_profile
#…
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
source /usr/local/bin/virtualenvwrapper.sh
#…
注意-
- 尝试安装 virtualenvwrapper 它说版本 4.8.4,但在线文档说它在 5.x
--no-site-packages
是 virtualenv
的默认值(已经有 5 年了?)您可以从 .bashrc
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
virtualenv>=20
中显示此选项已删除