I always used Anaconda on Windows so far and could set up an environment while choosing which exact Python to use. E.g. conda create -n myEnvName python=3.7
Now, I want to familiarize with Ubuntu 18.04 LTS and use basic Python environments.
So I followed these steps:
- Created folder in my
home = ~/.venvPython
- (a) I think I already had a 2.7 and 3.6 by default on the OS.
- (b) I do not remember for sure, I think I had to do this
sudo apt-get install python3-venv
.
- Created environment this way after CD'ing to .venvPython folder ran this:
python3 -m venv venv1BigDataPgm2
source ~/.venvPython/venv1BigDataPgm2/bin/activate
- Command
python --version
says:Python 3.6.9
Running whereis Python
shows this:
rohit@rohitUb18043LTS:~$ whereis python
python: /usr/bin/python3.6 /usr/bin/python3.6-config /usr/bin/python2.7-config /usr/bin/python3.6m-config /usr/bin/python /usr/bin/python3.6m /usr/bin/python2.7 /usr/lib/python3.8 /usr/lib/python3.7 /usr/lib/python3.6 /usr/lib/python2.7 /etc/python3.6 /etc/python /etc/python2.7 /usr/local/lib/python3.6 /usr/local/lib/python2.7 /usr/include/python3.6 /usr/include/python3.6m /usr/include/python2.7 /usr/share/python /usr/share/man/man1/python.1.gz
My doubts: Can I specify a Python version directly while creating the environment like with conda? How do I change this to some other interpreter instead of the 3.6.9? Do I have to manually install a different Python first, then point it somehow?
Please guide me. Thank you. Rohit