Lets say i want to create python virtual environment using python3
Make sure you have already installed python3
you may need to install pip & virtualenv if you dont have it before
sudo easy_install pip
sudo easy_install virtualenv
####################################
mkdir practise3.8.2 && cd practise3.8.2
python3 -m venv ~/practise3.8.2/main
(or) python3 -m venv version-3.8.2
ls -l main
total 8
drwxr-xr-x 13 mshaik staff 416 May 23 10:29 bin
drwxr-xr-x 2 mshaik staff 64 May 23 10:29 include
drwxr-xr-x 3 mshaik staff 96 May 23 10:29 lib
-rw-r–r– 1 mshaik staff 111 May 23 10:29 pyvenv.cfg
ls -l main/bin
total 88
-rw-r–r– 1 mshaik staff 8471 May 23 10:29 Activate.ps1
-rw-r–r– 1 mshaik staff 2212 May 23 10:29 activate
-rw-r–r– 1 mshaik staff 1264 May 23 10:29 activate.csh
-rw-r–r– 1 mshaik staff 2416 May 23 10:29 activate.fish
-rwxr-xr-x 1 mshaik staff 261 May 23 10:29 easy_install
-rwxr-xr-x 1 mshaik staff 261 May 23 10:29 easy_install-3.8
-rwxr-xr-x 1 mshaik staff 243 May 23 10:29 pip
-rwxr-xr-x 1 mshaik staff 243 May 23 10:29 pip3
-rwxr-xr-x 1 mshaik staff 243 May 23 10:29 pip3.8
lrwxr-xr-x 1 mshaik staff 7 May 23 10:29 python -> python3
lrwxr-xr-x 1 mshaik staff 58 May 23 10:29 python3 -> /Applications/Xcode.app/Contents/Developer/usr/bin/python3
cd main/bin
source activate
python
Python 3.8.2 (default, Oct 2 2020, 10:45:42)
[Clang 12.0.0 (clang-1200.0.32.27)] on darwin
Adding a project in pycharm using this new virtual environment







if you would like to install any libraries and packages use terminal in pycharm and activate source and use pip to install

installing libraries using pip
pwd
/Users/mshaik/practise3.8.2/main/bin
place where my libraries will be available
ls -l ../lib/python3.8/site-packages
total 8
drwxr-xr-x 3 mshaik staff 96 May 23 10:29 pycache
-rw-r–r– 1 mshaik staff 126 May 23 10:29 easy_install.py
drwxr-xr-x 7 mshaik staff 224 May 23 10:29 pip
drwxr-xr-x 9 mshaik staff 288 May 23 10:29 pip-19.2.3.dist-info
drwxr-xr-x 7 mshaik staff 224 May 23 10:29 pkg_resources
drwxr-xr-x 42 mshaik staff 1344 May 23 10:29 setuptools
drwxr-xr-x 11 mshaik staff 352 May 23 10:29 setuptools-41.2.0.dist-info
upgrade pip verison
pip install –upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/cd/82/04e9aaf603fdbaecb4323b9e723f13c92c245f6ab2902195c53987848c78/pip-21.1.2-py3-none-any.whl (1.5MB)
|████████████████████████████████| 1.6MB 1.9MB/s
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-21.1.2
pip install python-ldap
Collecting python-ldap
Downloading python-ldap-3.3.1.tar.gz (379 kB)
|████████████████████████████████| 379 kB 2.9 MB/s
Collecting pyasn1>=0.3.7
Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Collecting pyasn1_modules>=0.1.5
Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
|████████████████████████████████| 155 kB 6.7 MB/s
Using legacy ‘setup.py install’ for python-ldap, since package ‘wheel’ is not installed.
Installing collected packages: pyasn1, pyasn1-modules, python-ldap
Running setup.py install for python-ldap … done
Successfully installed pyasn1-0.4.8 pyasn1-modules-0.2.8 python-ldap-3.3.1
ls -l ../lib/python3.8/site-packages
total 568
drwxr-xr-x 3 mshaik staff 96 May 23 10:29 pycache
-rwxr-xr-x 1 mshaik staff 248392 May 23 11:19 _ldap.cpython-38-darwin.so
-rw-r–r– 1 mshaik staff 126 May 23 10:29 easy_install.py
drwxr-xr-x 21 mshaik staff 672 May 23 11:19 ldap
-rw-r–r– 1 mshaik staff 12525 Jun 29 2020 ldapurl.py
-rw-r–r– 1 mshaik staff 20278 Jun 29 2020 ldif.py
drwxr-xr-x 7 mshaik staff 224 May 23 11:17 pip
drwxr-xr-x 9 mshaik staff 288 May 23 11:17 pip-21.1.2.dist-info
drwxr-xr-x 7 mshaik staff 224 May 23 10:29 pkg_resources
drwxr-xr-x 8 mshaik staff 256 May 23 11:19 pyasn1
drwxr-xr-x 9 mshaik staff 288 May 23 11:19 pyasn1-0.4.8.dist-info
drwxr-xr-x 109 mshaik staff 3488 May 23 11:19 pyasn1_modules
drwxr-xr-x 9 mshaik staff 288 May 23 11:19 pyasn1_modules-0.2.8.dist-info
drwxr-xr-x 9 mshaik staff 288 May 23 11:19 python_ldap-3.3.1-py3.8.egg-info
drwxr-xr-x 42 mshaik staff 1344 May 23 10:29 setuptools
drwxr-xr-x 11 mshaik staff 352 May 23 10:29 setuptools-41.2.0.dist-info
drwxr-xr-x 5 mshaik staff 160 May 23 11:19 slapdtest
