0

I'm confused with the python version I'm using (under Ubuntu):

I'm using pycharm. In pycharm I'm using python 3.6.8 (checked with pycharm terminal python --version)

When I'm working from linux terminal (not pycharm terminal) and I'm checking the version I'm getting:

3.7.6

I checked which python versions I'm using:

sudo update-alternatives --config python
* 2 /usr/local/bin/python 3.6 0 manual mode

when checking:

python which:
/home/userA/miniconda3/bin/python
  1. Why the terminal shows 3.7.6 version while I set the 3.6 version ?

  2. How can I fix it ?

2
  • Hi, in the terminal, can you do which python . This will show you what python terminal is using Commented May 27, 2020 at 4:36
  • /home/userA/miniconda3/bin/python Commented May 27, 2020 at 4:39

2 Answers 2

1

You have installed anaconda python version for the user instead of globally. You can try to rectify this by uninstalling miniconda3 on this user. Or using virtual env created from your desired python version.

This can be achieved by using running following command with absolute path of your desired python library

/usr/local/bin/python -m venv <dir_name>

for more Info, Check out this reference on virtual env

https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments

Sign up to request clarification or add additional context in comments.

Comments

0

Print python version from linux command line with

python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))'

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.