virtual environment is not activating in centOS - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: virtual environment is not activating in centOS (/thread-22988.html) |
virtual environment is not activating in centOS - Anu - Dec-06-2019 I am trying to install django in CentOS 7 cloud server. For that I have installed Virtual environment by using python -m venv env . And environment installed successfully, but it is not activating when I used the shell command source env/bin/activate . The name of the current virtual environment is NOT appear on the left of the prompt. So I understand virtual environment is not active. I am still unsuccessful. In CentOS do I need to use specific Shell(eg:$BASH) ?
RE: virtual environment is not activating in centOS - ibreeden - Dec-08-2019 Which shell are you using? csh? I am no sure how it is in CentOS but in my Ubuntu I have under env/bin: If you are using csh you should use activate.csh.
RE: virtual environment is not activating in centOS - Anu - Dec-09-2019 I am using bash.
RE: virtual environment is not activating in centOS - snippsat - Dec-09-2019 If you do this what happens,and give it a more unique name eg my_env .# Python need to be a newer version for "venv" to work tom@tom-VirtualBox:~$ python -V Python 3.7.3 # I have use pyenv here to install Python tom@tom-VirtualBox:~$ which python /home/tom/.pyenv/shims/python # Make tom@tom-VirtualBox:~$ python -m venv my_env # cd in tom@tom-VirtualBox:~$ cd my_env # Activate tom@tom-VirtualBox:~/my_env$ source bin/activate # Now active see (my_env) # Python executable point now to "my_env" folder (my_env) tom@tom-VirtualBox:~/my_env$ which python /home/tom/my_env/bin/python # Test pip (my_env) tom@tom-VirtualBox:~/my_env$ pip -V pip 19.0.3 from /home/tom/my_env/lib/python3.7/site-packages/pip (python 3.7) RE: virtual environment is not activating in centOS - Anu - Dec-10-2019 I removed my env folder then I created my_env as you have said.MY console is given below But still my virtual environment is not active. Left of the prompt is still same . Is it correct to choose the directory /home/LPython/
RE: virtual environment is not activating in centOS - Anu - Dec-16-2019 This problem is solved. Actually I was not using BASH shell, even if the echo $SHELL outputs bin/bash. Because of this output, I thought i was using using BASH shell. Then I login through SSH. If you are using Windows must login through PUTTY. Then I could activate my virtual environment through source my_env/bin/activate Thank you for all the support. |