python 虛擬環境virtualenv的安裝和使用__python

來源:互聯網
上載者:User

使用pip install virtualenv安裝虛擬環境,安裝好以後,

執行virtualenv django_test來建立虛擬環境,如果建立時出現ascii下面這種錯誤

G:\>virtualenv test
New python executable in test\Scripts\python.exe
Installing setuptools, pip, wheel...
  Complete output from command G:\test\Scripts\python.exe -c "import sys, pip; s
ys...d\"] + sys.argv[1:]))" setuptools pip wheel:
  Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
  The repository located at None is not a trusted or secure host and is being ig
nored. If this repository is available via HTTPS it is recommended to use HTTPS
instead, otherwise you may silence this warning and allow it anyways with '--tru
sted-host None'.
  The repository located at None is not a trusted or secure host and is being ig
nored. If this repository is available via HTTPS it is recommended to use HTTPS
instead, otherwise you may silence this warning and allow it anyways with '--tru
sted-host None'.
  The repository located at None is not a trusted or secure host and is being ig
nored. If this repository is available via HTTPS it is recommended to use HTTPS
instead, otherwise you may silence this warning and allow it anyways with '--tru
sted-host None'.
  The repository located at None is not a trusted or secure host and is being ig
nored. If this repository is available via HTTPS it is recommended to use HTTPS
instead, otherwise you may silence this warning and allow it anyways with '--tru
sted-host None'.
  The repository located at None is not a trusted or secure host and is being ig
nored. If this repository is available via HTTPS it is recommended to use HTTPS
instead, otherwise you may silence this warning and allow it anyways with '--tru
sted-host None'.
  The repository located at None is not a trusted or secure host and is being ig
nored. If this repository is available via HTTPS it is recommended to use HTTPS
instead, otherwise you may silence this warning and allow it anyways with '--tru
sted-host None'.
  Could not find a version that satisfies the requirement setuptools (from versi
ons: )
No matching distribution found for setuptools
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "D:\program files\Python27\Scripts\virtualenv-script.py", line 9, in <mod
ule>
    load_entry_point('virtualenv==13.1.0', 'console_scripts', 'virtualenv')()
  File "D:\Program Files\Python27\lib\site-packages\virtualenv-13.1.0-py2.7.egg\
virtualenv.py", line 832, in main
    symlink=options.symlink)
  File "D:\Program Files\Python27\lib\site-packages\virtualenv-13.1.0-py2.7.egg\
virtualenv.py", line 1004, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
  File "D:\Program Files\Python27\lib\site-packages\virtualenv-13.1.0-py2.7.egg\
virtualenv.py", line 969, in install_wheel
    'PIP_NO_INDEX': '1'
  File "D:\Program Files\Python27\lib\site-packages\virtualenv-13.1.0-py2.7.egg\
virtualenv.py", line 910, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command G:\test\Scripts\python.exe -c "import sys, pip; sys...d\"] + sy
s.argv[1:]))" setuptools pip wheel failed with error code 1

使用下面的語句來建立

virtualenv test --no-setuptools --no-pip --no-wheel

建立成功後

使用test\Scripts\activate來進入虛擬環境

注意:test是當前建立的虛擬環境的地址

前面會出現(test)以及對應的目錄


建立完畢

使用exit來退出即可

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.