By default I had python-2.6 installed on my Centos. I installed python-3.6.1 and Pycharm IDE. When I open settings of my Pycharm I can't see new interpreter for python-3.6.1. How do I locate and add the new interpreter?
How did you install python-3.6.1? Also, why not search for the python3 executable? I don't specifically know about Centos, but on UNIX systems it could be in /usr/bin/python3
Documentation based on Windows version, on mac is pretty the same, I'm not familiar with Linux version GUI, but should be very similar https://www.jetbrains.com/help/pycharm/configuring-python-interpreter-for-a-project.html
In short, point to the Python executable by adding local interpreter in Pycharm project settings http://imgur.com/ekvC0bM
Related
Common issue here: I installed Python and then Spyder, and now when I install packages with "pip install ", Spyder can't find the modules, but if I call Python on the command prompt (using Windows), it finds all installed packages with pip.
I noticed that in Spyder, a new console shows it is running Python 3.7.9, but if I run "python -V" on the command promp, it shows Python 3.9.1 , also for "py -0" and "py -0p" it only shows one installation of Python, namely
>>> py -0p
Installed Pythons found by py Launcher for Windows
-3.9-64 C:\Users\my_name\AppData\Local\Programs\Python\Python39\python.exe *
so what is going on here? Why does Spyder seem to have its own Python version? Is this the reason why packages installed with pip are not communicating with Spyder?
I was facing the same issue as you. I understand your question and the answer to it is yes. However you can change it and use the systems python as well.
Tools -> preferences -> python interpreter -> select "use the following interpreter" and provide is the path to the directory that you have the systems python installed.
Restart spyder and the kernel should then show you the update version
For any library that you want to add that is not included in the default search path of spyder, you need add its path via the PYTHONPATH manager.
Go to Spyder->Tool-> PYTHONPATH manager ->Add Path
I haven't used Python in a while, and only in Linux. Now on Windows, and just installed 3.7.4. I noticed immediately that python3.exe is not in the install directory, nor any of the pythonX.x.exe files, that are used for compatibility. I can only access Python through "python" from my command prompt, and old scripts that use Python 3 won't work.
Is there something I am missing here?
Of course, I can solve this for now by using symlinks, but is this an error in 3.7.4, or more likely, have I done something wrong in setting up my environment on Windows?
No, there's nothing wrong. This is just how Python is on Windows. There's the py launcher too that might help you out here.
https://docs.python.org/3/using/windows.html
3.2 The Microsoft Store Package
All three commands are also available with version number suffixes, for example, as python3.exe and python3.x.exe as well as python.exe (where 3.x is the specific version you want to launch, such as 3.7).
Virtual environments can be created with python -m venv and activated and used as normal.
If you have installed another version of Python and added it to your PATH variable, it will be available as python.exe rather than the one from the Microsoft Store. To access the new installation, use python3.exe or python3.x.exe.
I'm using Pycharm Community 2018.1.4 on Linux Mint 19 Tara Xfce.
It works well with Python 3.5 interpreter.
I installed Python 3.7 to be the default Python interpreter on the system.
python -V command returns Python 3.7.0b3
I would like to use Python 3.7 in Pycharm.
I've tried :
which python
/usr/bin/python
which python3.7
/usr/local/bin/python3.7
When I go to File > Settings > Project and Interpreter > Add and there is no /usr/local folder and there is no python3.7 in /usr/bin
I can cd to /usr/local/bin folder in the terminal, but Pycharm just can't.
I restarted, uninstalled/reinstalled Pycharm, refreshed its inner browser, restarted my pc. Nothing changed.
What am I missing?
You will need to add the interpreter to the list of available interpreters.
Use which python to find out the path of the interpreter, then in the Settings > Project Interpreter > Add > System Interpreter window hit the "..." button and add that interpreter. (The screenshot below is from macOS, but it should be the same on Linux.)
I had the same issues with Pycharm Community Edition 2020.1, Linux Mint 19.3.
For reasons I don't know, the Flatpak version, which is only provided in Linux Mint's repositories can't see and access most of the directories which are beyond the user's home.
Pycharm 2020.1 Flatpak comes with a Python 3.7 interpreter, which seems to live in the virtual environment, located in the user's home.
I tried to change for the default python3 compiler of Linux Mint 19.3, which is version 3.6 and lives in /usr/bin - no chance, neither by navigating with Pycharm's file browser, nor by copy and paste to the path field.
Strangely also most of the directories e.g. below /usr/lib weren't displayed.
I then installed Pycharm via a ppa (alternative package repository for some Linux flavors), to be specific this one
Voilà! Any installed interpreter is accessible and can be selected.
How do you launch Python3.7 in terminal? For example, you use python3.7 to launch.
Then you can which python3.7 to find where it is.
And then add that path to your Pycharm's Python Interpreter.
if you already have 3.7 installed. right click and run Pycharm as admin. then it should display, and install the new packages.
In flatpak-version PyCharm you can found host-os files in this directory:
/var/run/host/
For example:
/var/run/host/usr/bin/python3.8
But this is a bad way. It is better to install from the ppa.
use ctrl + alt + s to open interpreter the select the one you wanted to use that is for the environment you have chosen. If you wanted to change the interpreter for the environment the go to the interpreter settings after pressing the ctrl + alt + s and select the environment interpreter.
I want use the python on wsl in pycharm
I refer to this article
https://www.jetbrains.com/help/pycharm/using-wsl-as-a-remote-interpreter.html#prereq
pycharm can connect wsl by ssh,but Failed
https://i.stack.imgur.com/26ni1.png
It seems that the interpreter you are trying to use is not installed in your WSL, or you are pointing the wrong place. Make sure it exists, if not try to use /usr/bin/python as the interpreter.
I use miniconda and have python 3.6 installed on /home/USERNAME/miniconda/. In pycharm, I point the interpreter to /home/USERNAME/miniconda/bin/python3.6.
For different conda envs, point the interpreter to their respective python
I am using Windows 8 where I have Python 2.7 installed. In addition I have cygwin installed where I installed also Python 2.7.
I need to install a Python library whose installation on Windows is not supported but it is on Linux so I want to try to use it on Cygwin.
The library has a "configure" script who checks dependencies for many packages and settings and complaints because some python packages are not installed.
But when I try to install them, the system says they are installed. From this, I have concluded that my python windows installation is overlapping my python cygwin installation.
I think that the cygwin is importing in the Path all the windows Path and while the script checking the configuration can find the cygwin installation, when executing from the command-line it is not the case.
Of course, I don't want to remove from the PATH my windows python.
My question is then, what option do I have to work from cygwin only with the cygwin python installed?
As far as I have seen in other questions, usually the problem is the opposite (making cygwin to use windows python, what is problematic and not recommended in some cases).
Set the path in your .profile then.
So if e.g. your Python is in C:\Python27
remove the windows paths to /cygdrive/c/Python27 in .profile
E.g.:
$ echo $PATH
/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:
/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:
/usr/bin:/cygdrive/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/bin:/cygdrive/c/Python27:
/cygdrive/c/Python27/Scripts
=>
.profile:
export PATH=/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:
/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:
/cygdrive/c/Program Files/Microsoft SQL Server/110/Tools/Binn