最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[记录]CentOS中安装和使用virtualenvwrapper

CentOS crifan 3487浏览 0评论

折腾:

[记录]CentOS中安装和使用virtualenv

之后,需要再去安装virtualenvwrapper

参考:

virtualenvwrapper 4.7.1.dev15 — virtualenvwrapper 4.7.1.dev15 documentation

http://virtualenvwrapper.readthedocs.io/en/latest/

 jiandaoweixin pip install virtualenvwarpper
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting virtualenvwarpper
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Could not find a version that satisfies the requirement virtualenvwarpper (from versions: )
No matching distribution found for virtualenvwarpper

在升级python之前,先要去搞清楚:

[记录]CentOS 6中Python从2.6升级到2.7

重新去安装:

 ~ pip install virtualenvwrapper
Collecting virtualenvwrapper
  Downloading virtualenvwrapper-4.7.1-py2.py3-none-any.whl
Collecting stevedore (from virtualenvwrapper)
  Downloading stevedore-1.17.0-py2.py3-none-any.whl
Collecting virtualenv-clone (from virtualenvwrapper)
  Downloading virtualenv-clone-0.2.6.tar.gz
Collecting virtualenv (from virtualenvwrapper)
  Using cached virtualenv-15.0.3-py2.py3-none-any.whl
Collecting pbr>=1.6 (from stevedore->virtualenvwrapper)
  Downloading pbr-1.10.0-py2.py3-none-any.whl (96kB)
    100% || 102kB 26kB/s 
Collecting six>=1.9.0 (from stevedore->virtualenvwrapper)
  Downloading six-1.10.0-py2.py3-none-any.whl
Building wheels for collected packages: virtualenv-clone
  Running setup.py bdist_wheel for virtualenv-clone … done
  Stored in directory: /root/.cache/pip/wheels/24/51/ef/93120d304d240b4b6c2066454250a1626e04f73d34417b956d
Successfully built virtualenv-clone
Installing collected packages: pbr, six, stevedore, virtualenv-clone, virtualenv, virtualenvwrapper
Successfully installed pbr-1.10.0 six-1.10.0 stevedore-1.17.0 virtualenv-15.0.3 virtualenv-clone-0.2.6 virtualenvwrapper-4.7.1

就没有警告了。

之前的虚拟环境被删除了。

现在重现去用virtualenvwrapper创建:

 SIPEvents ll
total 0
 SIPEvents pwd
/root/SIPEvents
 SIPEvents export WORKON_HOME=~/Envs
 SIPEvents mkdir -p $WORKON_HOME
 SIPEvents source /usr/local/bin/virtualenvwrapper.sh
virtualenvwrapper.user_scripts creating /root/Envs/premkproject
virtualenvwrapper.user_scripts creating /root/Envs/postmkproject
virtualenvwrapper.user_scripts creating /root/Envs/initialize
virtualenvwrapper.user_scripts creating /root/Envs/premkvirtualenv
virtualenvwrapper.user_scripts creating /root/Envs/postmkvirtualenv
virtualenvwrapper.user_scripts creating /root/Envs/prermvirtualenv
virtualenvwrapper.user_scripts creating /root/Envs/postrmvirtualenv
virtualenvwrapper.user_scripts creating /root/Envs/predeactivate
virtualenvwrapper.user_scripts creating /root/Envs/postdeactivate
virtualenvwrapper.user_scripts creating /root/Envs/preactivate
virtualenvwrapper.user_scripts creating /root/Envs/postactivate
virtualenvwrapper.user_scripts creating /root/Envs/get_env_details
 SIPEvents mkvirtualenv SIPEvents
New python executable in /root/Envs/SIPEvents/bin/python
Installing setuptools, pip, wheel…done.
virtualenvwrapper.user_scripts creating /root/Envs/SIPEvents/bin/predeactivate
virtualenvwrapper.user_scripts creating /root/Envs/SIPEvents/bin/postdeactivate
virtualenvwrapper.user_scripts creating /root/Envs/SIPEvents/bin/preactivate
virtualenvwrapper.user_scripts creating /root/Envs/SIPEvents/bin/postactivate
virtualenvwrapper.user_scripts creating /root/Envs/SIPEvents/bin/get_env_details
(SIPEvents)  SIPEvents
(SIPEvents)  SIPEvents ll
total 0
(SIPEvents)  SIPEvents pwd
/root/SIPEvents
(SIPEvents)  SIPEvents ls -l
total 0
(SIPEvents)  SIPEvents ls $WORKON_HOME
get_env_details  postactivate    postmkproject     postrmvirtualenv  predeactivate  premkvirtualenv  SIPEvents
initialize       postdeactivate  postmkvirtualenv  preactivate       premkproject   prermvirtualenv
(SIPEvents)  SIPEvents ll $WORKON_HOME   
total 52K
-rwxr-xr-x 1 root root  134 Aug 15 12:04 get_env_details
-rw-r–r– 1 root root   95 Aug 15 12:04 initialize
-rw-r–r– 1 root root   72 Aug 15 12:04 postactivate
-rw-r–r– 1 root root   74 Aug 15 12:04 postdeactivate
-rwxr-xr-x 1 root root   65 Aug 15 12:04 postmkproject
-rw-r–r– 1 root root   72 Aug 15 12:04 postmkvirtualenv
-rwxr-xr-x 1 root root  109 Aug 15 12:04 postrmvirtualenv
-rwxr-xr-x 1 root root   98 Aug 15 12:04 preactivate
-rw-r–r– 1 root root   75 Aug 15 12:04 predeactivate
-rwxr-xr-x 1 root root   90 Aug 15 12:04 premkproject
-rwxr-xr-x 1 root root  129 Aug 15 12:04 premkvirtualenv
-rwxr-xr-x 1 root root  110 Aug 15 12:04 prermvirtualenv
drwxr-xr-x 5 root root 4.0K Aug 15 12:05 SIPEvents

后来断网了

然后再去弄一遍:

 SIPEvents mkvirtualenv SIPEvents
zsh: command not found: mkvirtualenv
 SIPEvents ls $WORKON_HOME
 SIPEvents lsls ~/Envs/ -l
total 52
-rwxr-xr-x 1 root root  134 Aug 15 12:04 get_env_details
-rw-r–r– 1 root root   95 Aug 15 12:04 initialize
-rw-r–r– 1 root root   72 Aug 15 12:04 postactivate
-rw-r–r– 1 root root   74 Aug 15 12:04 postdeactivate
-rwxr-xr-x 1 root root   65 Aug 15 12:04 postmkproject
-rw-r–r– 1 root root   72 Aug 15 12:04 postmkvirtualenv
-rwxr-xr-x 1 root root  109 Aug 15 12:04 postrmvirtualenv
-rwxr-xr-x 1 root root   98 Aug 15 12:04 preactivate
-rw-r–r– 1 root root   75 Aug 15 12:04 predeactivate
-rwxr-xr-x 1 root root   90 Aug 15 12:04 premkproject
-rwxr-xr-x 1 root root  129 Aug 15 12:04 premkvirtualenv
-rwxr-xr-x 1 root root  110 Aug 15 12:04 prermvirtualenv
drwxr-xr-x 5 root root 4096 Aug 15 12:05 SIPEvents
 SIPEvents export WORKON_HOME=~/Envs
 SIPEvents mkdir -p $WORKON_HOME
 SIPEvents source /usr/local/bin/virtualenvwrapper.sh
 SIPEvents mkvirtualenv SIPEvents
New python executable in /root/Envs/SIPEvents/bin/python
Installing setuptools, pip, wheel…done.
(SIPEvents)  SIPEvents ls $WORKON_HOME
get_env_details  postactivate    postmkproject     postrmvirtualenv  predeactivate  premkvirtualenv  SIPEvents
initialize       postdeactivate  postmkvirtualenv  preactivate       premkproject   prermvirtualenv
(SIPEvents)  SIPEvents ls $WORKON_HOME -l
total 52
-rwxr-xr-x 1 root root  134 Aug 15 12:04 get_env_details
-rw-r–r– 1 root root   95 Aug 15 12:04 initialize
-rw-r–r– 1 root root   72 Aug 15 12:04 postactivate
-rw-r–r– 1 root root   74 Aug 15 12:04 postdeactivate
-rwxr-xr-x 1 root root   65 Aug 15 12:04 postmkproject
-rw-r–r– 1 root root   72 Aug 15 12:04 postmkvirtualenv
-rwxr-xr-x 1 root root  109 Aug 15 12:04 postrmvirtualenv
-rwxr-xr-x 1 root root   98 Aug 15 12:04 preactivate
-rw-r–r– 1 root root   75 Aug 15 12:04 predeactivate
-rwxr-xr-x 1 root root   90 Aug 15 12:04 premkproject
-rwxr-xr-x 1 root root  129 Aug 15 12:04 premkvirtualenv
-rwxr-xr-x 1 root root  110 Aug 15 12:04 prermvirtualenv
drwxr-xr-x 5 root root 4096 Aug 15 12:05 SIPEvents

至此,算是环境好了。

转载请注明:在路上 » [记录]CentOS中安装和使用virtualenvwrapper

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.174 seconds, using 22.13MB memory