简体   繁体   中英

Creating a Virtualenv using Python

--EDIT-- Using Ubuntu 22.04

I have recently installed Python 3.10, and I have different folders. Is this normal or did I mess up the installation?

virtualenv venv

created virtual environment CPython3.10.4.final.0-64 in 74ms
  creator CPython3Posix(dest=/home/aravinth/Bureau/aa/venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/aravinth/.local/share/virtualenv)
    added seed packages: pip==22.1.2, setuptools==62.3.4, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
ls venv
lib  local  pyvenv.cfg

I get this new local directory, now to activate the Venv I need to type:

source venv/local/bin/activate

Instead of typing:

source venv/bin/activate

from: https://python.land/virtual-environments/virtualenv

Python 3.4 and above If you are running Python 3.4+, you can use the venv module baked into Python: $ python -m venv [directory] This command creates a venv in the specified directory and copies pip into it as well. If you're unsure what to call the directory: venv is a commonly seen option; it doesn't leave anyone guessing what it is. A little further in this article, we'll take a close look at the directory that was just created. But let's first look at how to activate this virtual environment.

What's inside a venv?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM