I have installed python 3.7.9 and 3.10.1. I have one virtual environment say(test). I have set up pycharm project interpreter as 3.7.9. But in the pycharm terminal, it is showing as 3.10.1, while in the interpreter it is 3.7.9. How to make them the same?
Related
I have problem with new created project with PyCharm community 2019.3.
After creating new enviroment with fresh python 3.7 interpreter, the interpreter path in terminal is still related do the linux system path:
(venv) *#*:~/PycharmProjects/test$ python
import sys
sys.executable
--> /usr/bin/python3.7
instead of:
/home/*/PycharmProjects/test/venv/bin/python
but if i check the interpreter path in Pycharm python console then i get proper result.
In project settings Project interpreter path is:
Python3.7 (test) ~/PycharmProjects/test/venv/bin/python
PATH for this interpreter are:
/home/*/PycharmProjects/test/venv/lib/python3.7/site-packages
/usr/bin/python3.7
After creating new venv with python 3.7 and after activate it, problem remains:
echo $PATH
/home/*/PycharmProjects/test/venv2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PATH is ok /home/*/PycharmProjects/test/venv2/bin but interpreter is from /usr/bin/python3.7.
Question How to correct this issue?
On JetBrains link
Turns out that Pycharm v2019.3 Terminal PATH is bugged. The issue is not occur in previous versions.
I am using Ubuntu 18.10(dual Boot win10), I have installed anaconda (conda version- 4.6.7) on ubuntu. After this Installation I installed Pycharm via snap on Command Prompt. Since Pycharm(version - 2018.3.5) didnt Detect my python Location automatically I set the python Interpreter via
Adding Location ->System Interpreter (As I didn't want any Venv) -> Path
But when I try to import opencv in Pycharm it says
ModuleNotFoundError: No module named 'cv2'
Python3.6 in Anaconda Bin is shown to which I have linked in Pycharm (I have also tried other Python files there as well but no luck)
When I run in Terminal: python3 -c 'import sys; print(sys.path)'
It shows:
['', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6
/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/local
/lib/python3.6/dist-packages/setuptools-39.1.0-py3.6.egg', '/usr/lib`/python3
/dist-packages']
So could anyone help me out in this?? Thank You in Advance!!
Edit 1:
I am also unable to access any of the libraries from terminal Itself. So Could anyone help me with that as well. Should I export path of this Python in Anaconda bin folder to bashrc file in Ubuntu?
Edit 2:
The libraries affected is not just opencv. There are few other Libraries like Portaudio which are affected as well along with Opencv
Having several exe's of Python, I would like to specify the command (py or python) to launch a certain version from the command line.
At the moment, I have different versions of Python (2.7, 3.6, 3.7 Anaconda) installed on my Windows machines (7 at work, 10 at home). Unfortunately, the commands in the cmd-prompt are not the same.
The output of the following cmd commands is as follows:
py -> 3.7.1 of Anaconda (work) and 3.7.0 (home)
python -> 2.7.13 (work) and 3.6.2 (home)
pyton2 -> not recognized (work) and 2.7.15 (home)
How can I order the variables, so the same commands call the same version of python? Researching about the path variable I could not find how to define the command that launches a specific python.exe.
I really appreciate your help or a pointing in the right direction.
Kind regards,
Seb
Good Morning,
my apologies, yesterday I did not find this thread here:
In CMD "python" starts Python 3.3, "py" starts Python 2.7, how do I change this?
From now on I will go with "py -X.Y" to start the version of Python I want.
Kind regards,
Seb
My basic problem is that I want to install scipy on a Window's machine for Python 3 and use Pycharm as my development environment.
The suggestion from the Scipy Documentation as well as several StackOverflow posts (Installing NumPy and SciPy on 64-bit Windows (with Pip), Trouble installing SciPy on windows, etc.) is to use Anaconda to install a prebuilt scipy and avoid the Fortran and C compilers.
I've used Anaconda for Python 2.7 in the past, so I created an Anaconda environment for Python 3 following these directions.
Command to create the environment
conda create -n py3k python=3 anaconda
And the command to activate the environment
source activate py3k
This works fine, but I do most of my development in PyCharm and I can't figure out how to activate the Anaconda environment from PyCharm. Is there a way to do this or should I take another approach?
Explanations how to configure PyCharm with Anaconda can be found in the documentation.
In PyCharm preferences you can just select the correct python interpreter under,
Project Interpreter > Python Interpreters
As pointed out by #Cecilia, in the case when a virtual environment (e.g. named py3k) is used with Anaconda, the correct python interpreter is located under,
~/Anaconda/envs/py3k/python.exe
I have installed Anaconda on Windows 7 from the full installer and then created an Anaconda Python 3 environment (py3k) using conda. From my reading of the installation instructions at
http://continuum.io/blog/anaconda-python-3
I type activate py3k at the Anaconda command prompt to obtain that environment and in the Command Prompt window it says
[py3k] C:\users.. etc
which would appear to indicate that I am, in fact, in a Python 3.X environment. However, when I type 'Python' at the prompt I get
Python 2.7.5 | Anaconda ... etc
Am I still in a Python 3.X environment or have I omitted to do something installation-wise or otherwise?
have you tried unset PYTHONPATH, and which python?
If you do that after activating py3, you should be able to the python 3 interpreter. If not, what do you get after executing which python?