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