日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:python如何建立venv虛擬環(huán)境

     創(chuàng)建虛擬環(huán)境

在當前目錄創(chuàng)建虛擬環(huán)境:

創(chuàng)新互聯(lián)公司是一家專注于成都做網(wǎng)站、網(wǎng)站制作與策劃設計,沁陽網(wǎng)站建設哪家好?創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設10年,網(wǎng)設計領域的專業(yè)建站公司;建站業(yè)務涵蓋:沁陽等地區(qū)。沁陽做網(wǎng)站價格咨詢:13518219792

$ python -m venv .1

下面是”venv”的詳細使用參數(shù):

usage: venv [-h] [--system-site-packages] [--symlinks] [--clear]
            [--upgrade] [--without-pip] ENV_DIR [ENV_DIR ...]

Creates virtual Python environments in one or more target directories.

positional arguments:
  ENV_DIR             A directory to create the environment in.

optional arguments:
  -h, --help             show this help message and exit
  --system-site-packages Give access to the global site-packages dir to the                         
  virtual environment.
  --symlinks             Try to use symlinks rather than copies, when symlinks
                         are not the default for the platform.
  --copies               Try to use copies rather than symlinks, even when
                         symlinks are the default for the platform.
  --clear                Delete the environment directory if it already exists.                        
                         If not specified and the directory exists, an error is
                         raised.
  --upgrade              Upgrade the environment directory to use this version                        
                         of Python, assuming Python has been upgraded in-place.
  --without-pip          Skips installing or upgrading pip in the virtual
                         environment (pip is bootstrapped by default)

激活虛擬環(huán)境

在Posix標準平臺下:

$ source /bin/activate

在Windows cmd下:

C:> /Scripts/activate.bat

在Windows PowerShell下:

PS C:> /Scripts/Activate.ps1

測試虛擬環(huán)境

激活虛擬環(huán)境后,在命令行會提示當前虛擬環(huán)境的名稱,就表示激活成功了。

在當前虛擬環(huán)境中安裝numpy:

$ pip install numpy

當前安裝的numpy包與系統(tǒng)中的不會沖突,下面進行測試:

$ python
>>> import numpy
>>> print(numpy)

如果輸出了numpy的包路徑就表示一切正常。

官方文檔參考

https://docs.python.org/3/library/venv.html


    更多Python文章,請關(guān)注 Python自學網(wǎng)。


當前文章:創(chuàng)新互聯(lián)Python教程:python如何建立venv虛擬環(huán)境
文章URL:http://www.5511xx.com/article/copeipo.html