首页 > 编程语言 >Vitualenvwrapper: 管理 python的 虚拟环境

Vitualenvwrapper: 管理 python的 虚拟环境

时间:2023-02-09 10:24:09浏览次数:49  
标签:virtualenv python Vitualenvwrapper 3D05SQ3 -- virtualenvwrapper 虚拟环境 user

 

 

 

 

 

 

 

 

linux: install  Vitualenvwrapper

[user]-3D05SQ3:~/python/managing-python-packages-virtual-environments/flask/venv$ python3 -m pip install virtualenvWrapper
Defaulting to user installation because normal site-packages is not writeable
Collecting virtualenvWrapper
  Downloading virtualenvwrapper-4.8.4.tar.gz (334 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 334.9/334.9 kB 1.4 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting stevedore
  Downloading stevedore-4.1.1-py3-none-any.whl (50 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.0/50.0 kB 6.6 MB/s eta 0:00:00
Collecting virtualenv
  Using cached virtualenv-20.19.0-py3-none-any.whl (8.7 MB)
Collecting virtualenv-clone
  Downloading virtualenv_clone-0.5.7-py3-none-any.whl (6.6 kB)
Collecting pbr!=2.1.0,>=2.0.0
  Using cached pbr-5.11.1-py2.py3-none-any.whl (112 kB)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))': /simple/filelock/
Collecting filelock<4,>=3.4.1
  Using cached filelock-3.9.0-py3-none-any.whl (9.7 kB)
Collecting platformdirs<4,>=2.4
  Using cached platformdirs-3.0.0-py3-none-any.whl (14 kB)
Collecting distlib<1,>=0.3.6
  Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Building wheels for collected packages: virtualenvWrapper
  Building wheel for virtualenvWrapper (setup.py) ... done
  Created wheel for virtualenvWrapper: filename=virtualenvwrapper-4.8.4-py2.py3-none-any.whl size=24833 sha256=913d3c7fc45e3114d1e4c8fe9d419f649cd4c33c439fd9525e1e3d141b2bb5c3
  Stored in directory: /home/panxi/.cache/pip/wheels/47/15/3d/7a26eaf92e79f80a3df3ac5f8e0f0f5b7efdf24d313c594a44
Successfully built virtualenvWrapper
Installing collected packages: distlib, virtualenv-clone, platformdirs, pbr, filelock, virtualenv, stevedore, virtualenvWrapper
Successfully installed distlib-0.3.6 filelock-3.9.0 pbr-5.11.1 platformdirs-3.0.0 stevedore-4.1.1 virtualenv-20.19.0 virtualenv-clone-0.5.7 virtualenvWrapper-4.8.4
[user]-3D05SQ3:~/python/managing-python-packages-virtual-environments/flask/venv$ cd ../..
[user]-3D05SQ3:~/python/managing-python-packages-virtual-environments$ cd ..
[user]-3D05SQ3:~/python$ python3 -m pip show virtualenvwrapper
Name: virtualenvwrapper
Version: 4.8.4
Summary: Enhancements to virtualenv
Home-page: https://virtualenvwrapper.readthedocs.io/
Author: Doug Hellmann
Author-email: [email protected]
License: MIT
Location: /home/panxi/.local/lib/python3.8/site-packages
Requires: stevedore, virtualenv, virtualenv-clone
Required-by:
[user]-3D05SQ3:~/python$ # virtualenvwrapper depends on virtualenv
[user]-3D05SQ3:~/python$ # use the right virtualenv to create virtual enviornments
[user]-3D05SQ3:~/python$ # instead of the newer built-in venv module
[user]-3D05SQ3:~/python$ # configuration =>make sure it loaded when log in
[user]-3D05SQ3:~/python$ which virtualenvwrapper .sh
[user]-3D05SQ3:~/python$ which virtualenvwrapper.sh
/home/panxi/.local/bin/virtualenvwrapper.sh
[user]-3D05SQ3:~/python$ which --help
Illegal option --
Usage: /usr/bin/which [-a] args
[user]-3D05SQ3:~/python$ which -h
Illegal option -h
Usage: /usr/bin/which [-a] args
[user]-3D05SQ3:~/python$ # get the location of virtualenvwrapper.sh
[user]-3D05SQ3:~/python$ nano /home/panxi/.local/bin/virtualenvwrapper.sh
[user]-3D05SQ3:~/python$ nano --help
Usage: nano [OPTIONS] [[+LINE[,COLUMN]] FILE]...

To place the cursor on a specific line of a file, put the line number with
a '+' before the filename.  The column number can be added after a comma.
When a filename is '-', nano reads data from standard input.

 Option         Long option             Meaning
 -A             --smarthome             Enable smart home key
 -B             --backup                Save backups of existing files
 -C <dir>       --backupdir=<dir>       Directory for saving unique backup files
 -D             --boldtext              Use bold instead of reverse video text
 -E             --tabstospaces          Convert typed tabs to spaces
 -F             --multibuffer           Read a file into a new buffer by default
 -G             --locking               Use (vim-style) lock files
 -H             --historylog            Log & read search/replace string history
 -I             --ignorercfiles         Don't look at nanorc files
 -J <number>    --guidestripe=<number>  Show a guiding bar at this column
 -K             --rawsequences          Fix numeric keypad key confusion problem
 -L             --nonewlines            Don't add an automatic newline
 -M             --trimblanks            Trim tail spaces when hard-wrapping
 -N             --noconvert             Don't convert files from DOS/Mac format
 -P             --positionlog           Log & read location of cursor position
 -Q <regex>     --quotestr=<regex>      Regular expression to match quoting
 -R             --restricted            Restrict access to the filesystem
 -T <#cols>     --tabsize=<#cols>       Set width of a tab to #cols columns
 -U             --quickblank            Wipe status bar upon next keystroke
 -V             --version               Print version information and exit
 -W             --wordbounds            Detect word boundaries more accurately
 -X <str>       --wordchars=<str>       Which other characters are word parts
 -Y <name>      --syntax=<name>         Syntax definition to use for coloring
 -Z             --zap                   Let Bsp and Del erase a marked region
 -a             --atblanks              When soft-wrapping, do it at whitespace
 -b             --breaklonglines        Automatically hard-wrap overlong lines
 -c             --constantshow          Constantly show cursor position
 -d             --rebinddelete          Fix Backspace/Delete confusion problem
 -e             --emptyline             Keep the line below the title bar empty
 -f <file>      --rcfile=<file>         Use only this file for configuring nano
 -g             --showcursor            Show cursor in file browser & help text
 -h             --help                  Show this help text and exit
 -i             --autoindent            Automatically indent new lines
 -j             --jumpyscrolling        Scroll per half-screen, not per line
 -k             --cutfromcursor         Cut from cursor to end of line
 -l             --linenumbers           Show line numbers in front of the text
 -m             --mouse                 Enable the use of the mouse
 -n             --noread                Do not read the file (only write it)
 -o <dir>       --operatingdir=<dir>    Set operating directory
 -p             --preserve              Preserve XON (^Q) and XOFF (^S) keys
 -r <#cols>     --fill=<#cols>          Set width for hard-wrap and justify
 -s <prog>      --speller=<prog>        Enable alternate speller
 -t             --tempfile              Auto save on exit, don't prompt
 -u             --unix                  Save a file by default in Unix format
 -v             --view                  View mode (read-only)
 -w             --nowrap                Don't hard-wrap long lines [default]
 -x             --nohelp                Don't show the two help lines
 -y             --afterends             Make Ctrl+Right stop at word ends
 -z             --suspend               Enable suspension
 -$             --softwrap              Enable soft line wrapping
[user]-3D05SQ3:~/python$ nano .profile
[user]-3D05SQ3:~/python$ cat .profile
source "/home/panxi/.local/bin/virtualenvwrapper.sh"
[user]-3D05SQ3:~/python$ #.profile is written by default by your shell whenever you log in
[user]-3D05SQ3:~/python$ # you may not have .profile in your home directory => create a new file with that name
[user]-3D05SQ3:~/python$ # source command + location : the shell to read in the virtualenvwrapper code and make its commands available to us
[user]-3D05SQ3:~/python$ # nano command - save file: ctrl +x
[user]-3D05SQ3:~/python$ #exit the shell and log in again
[user]-3D05SQ3:~/python$ logout

# log in again

  

 

 

 

 

windows: install  Vitualenvwrapper

PS C:\Users\[user]> python3 -V
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
PS C:\Users\[user]> py
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>> ^Z

PS C:\Users\[user]> py -m pip install virtualenvwrapper-win
Defaulting to user installation because normal site-packages is not writeable
Collecting virtualenvwrapper-win
  Downloading virtualenvwrapper_win-1.2.7-py3-none-any.whl (18 kB)
Collecting virtualenv
  Downloading virtualenv-20.19.0-py3-none-any.whl (8.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.7/8.7 MB 7.0 MB/s eta 0:00:00
Collecting distlib<1,>=0.3.6
  Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Collecting platformdirs<4,>=2.4
  Downloading platformdirs-3.0.0-py3-none-any.whl (14 kB)
Collecting filelock<4,>=3.4.1
  Downloading filelock-3.9.0-py3-none-any.whl (9.7 kB)
Installing collected packages: distlib, platformdirs, filelock, virtualenv, virtualenvwrapper-win
  WARNING: The script virtualenv.exe is installed in 'C:\Users\[user]\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed distlib-0.3.6 filelock-3.9.0 platformdirs-3.0.0 virtualenv-20.19.0 virtualenvwrapper-win-1.2.7

[notice] A new release of pip available: 22.3.1 -> 23.0
[notice] To update, run: python.exe -m pip install --upgrade pip
PS C:\Users\[user]> py -m pip show virtualenwrapper-win
WARNING: Package(s) not found: virtualenwrapper-win
PS C:\Users\[user]> py -m pip show virtualenvwrapper-win
Name: virtualenvwrapper-win
Version: 1.2.7
Summary: Port of Doug Hellmann's virtualenvwrapper to Windows batch scripts
Home-page: https://github.com/davidmarble/virtualenvwrapper-win/
Author: David Marble
Author-email: [email protected]
License: BSD 3-clause
Location: c:\users\[user]\appdata\roaming\python\python38\site-packages
Requires: virtualenv
Required-by:
PS C:\Users\[user]>

  

 

标签:virtualenv,python,Vitualenvwrapper,3D05SQ3,--,virtualenvwrapper,虚拟环境,user
From: https://www.cnblogs.com/panpanwelcome/p/17104304.html

相关文章

  • 1、python_批量检测端口号
    #!/usr/bin/envpython#coding:utf-8#Author:zikangimportsocketlist_str='''172.31.7.1038080172.31.7.1046379172.31.7.1053306'''OK_list=[]Timeo......
  • 第04天-python函数与高阶函数
    1、函数和传实参1.1、Python函数1.1.1、函数的三分类数学定义y=f(x),y是x的函数,x是自变量。y=f(x0,x1,...,xn)Python函数由若干语句组成的语句块、函数名称、参......
  • 第02天-python线性数据结构
    1、数值处理1.1、内建常用数据类型1.1.1、分类数值型int、float、complex、bool序列sequence字符串str、字节序列bytes、bytearray列表list、元组t......
  • 第03天-python字节序列字典
    1、字节序列和切片1.1、字节序列Python3引入两个新的类型bytes、bytearray。bytes不可变字节序列;bytearray是可变字节数组。字节的世界里面没有编码1.2、编码与解......
  • Python,形参,实参,值传递,地址传递
    1.值传递在实参向形参传递的过程中,传递的只是实参的值,而在函数体操作的时候,实际操作的并不是实参而是形参,所以,值传递不改变原变量值。2.地址传递在实参向形参传递的过程中......
  • Python mock
    官方链接:https://docs.python.org/zh-cn/3/library/unittest.mock-examples.htmlMock备注:常用的有两个mock类:Mock和MagicMock,在多数示例中,Mock与MagicMock两个类......
  • 【视频】风险价值VaR原理与Python蒙特卡罗Monte Carlo模拟计算投资组合实例|附代码数
    原文链接:http://tecdat.cn/?p=22862 最近我们被客户要求撰写关于风险价值VaR的研究报告,包括一些图形和统计输出。风险价值(VaR)是一种统计数据,用于量化公司、投资组......
  • python学习——【第四弹】
    前言上一篇文章​​python学习——【第一弹】​​中,我们了解了python当中的流程控制语句,这篇文章我们接着学习python中的序列。这篇文章先给大家介绍不可变序列字符串和可......
  • 1行Python代码,对话ChatGPT,网友:太方便了!
    大家好,这里是程序员晚枫。最近ChatGPT火爆全球,哪怕你不是程序员,应该也听过他的大名了。今天我们就来一起体验一下~1行Python代码就够了!上代码导入poai这个库后,只需要1......
  • centos7安装python3.X(与Python2.X共存)
    先卸载自带的python3centos7自带python2.7和python3.6卸载自带的python3.6,重新安装python3.7卸载python3.6#卸载python3rpm-qa|greppython3|xargsrpm-ev--allma......