Pycharm python version in terminal

Hello, below is what I execute in Pycharm Terminal:

why is my version of python is python 3.7.7, but terminal still use python2 to import package?

 

I also set python 3.7 as the project interpreter. Can somebody advise how to solve this issue?

 

5 comments
Comment actions Permalink

Please try the following suggestions:

1. `which pip` - should show which pip executable is actually being used. Is it from correct environment? 

2. Try reproducing the issue in the terminal outside of IDE - activate the same venv and run the same command.

0
Comment actions Permalink

Often the same issue.  As example : clone project from github,  and terminal displays (venv) but reporting Python version as system.

in case if create new env not use already existed - no issues.

0
Comment actions Permalink

It's not recommended to copy venv directories from other systems. The best practice is to create a new venv on the machine where you clone the project, and install dependencies using techniques like requirements.txt or other.

0
Comment actions Permalink

I'm not using venv from github. I use venv created on my local machine, connecting it by env selector. In any case if I activate env end run Pycharm by script from terminal where venv activated, it works fine in any scenarios. Main question is why terminal in Pycharm  (time to time) displays (venv) but in the same time displays system python version.  It easy to manage but ...

0
Comment actions Permalink

Did you move the venv to another directory by any chance? This can be a side effect. Does the same issue reproduce if you create a new venv and set it as project interpreter?

0

Please sign in to leave a comment.