Pycharm runtime: No Python at dir\that\doesnt\exist - python

I had Anaconda installed as well as Python3 and this was causing some conflicts. I removed Anaconda and ensured my PATH variables all point to the Python3 install at C:\Users\me\AppData\Local\Programs\Python\Python38-32
I have opened a project in PyCharm and set the python interpreter to that very path: no venv in case it was causing problems.
However, when CTRL+SHIFT+F10 to run it states No Python at 'C:\Users\me\Anaconda3\python.exe'
I have googled this for the past two hours and all I'm finding is "you haven't installed Python" or "set up the PyCharm interpreter to point to the python executable" which I have done.
I have even reinstalled Pycharm.
Please can someone suggest what I am doing wrong? There is no sign of Anaconda in the system or in the PyCharm terminal interpreter/project interpreter Thanks.
Edit:
Forgot to mention, in the Project > Python Interpreter settings I can see the interpreter and all the packages just fine. On the face of it: Everything is working fine. But run-time is giving me the anaconda install dir error.

Try restarting pycharm once...if not your System..Comment here if it doesn't solve the issue.

I don't know what caused this problem but it resolved itself. Sorry I cannot offer any insights.

Related

problem with pycharm interperter and installing packages

I have a problem with installing packages in my pycharm project.
Until today everything worked perfectly, I could install packages and everything worked.
I didn't change anything but now everytime I try to install new package I get an error
pycharm message 1
pycharm message 2
But I do have pip installed in python interpreter
interpreter packages
I'm trying to understand what is the problem and how to fix it.
I'm not sure if this is the problem, but the interpreter is python 3.7 and the weird thing is when I'm checking the version on my cmd it's 3.8.3 but when I checked on Windows's apps it showed python 3.7.3
python version from cmd
Is there a reason it happened just randomly after it worked perfectly in the last couple of weeks I worked on the program?
Maybe it's because i updated the pip?
You can try few things
Running same command in terminal. If it doesn't work then please locate your pip.exe which is generally in the Scripts folder right next to python.exe. Make sure the path/to/folder is in environment variables
Reset project settings. Try deleting .idea directory in your project. This folder is created by pycharm to save settings. Open the project folder again in pycharm and set the interpreter.
Did you try to install directly with pip in the terminal ? If it doesn't work maybe you should reinstall it

Why my Python 2.7 envs only works when I start the terminal by Anaconda Navigator?

All python 2* envs I created doesn't really start when activating dicrectly from cmd. When activating this way, there is no error message on the prompt, all seem to be ok, then I run python 2 scripts and they doesn't work. Only way I found to do it is by starting the terminal from Anaconda Navigador. This also happens with Pycharm: code doesn't works when running py2 scripts in Pycharm WITHOUT having started it from Anaconda Navigator.
Computer programming and configuration is not my professional area, so if the answer relates to configuring path, or system variables, please be kind giving me a "for dummie" explanation.
I'm using Windows 10.
Thanks!

What directory are Python packages installed in?[MAC]

I downloaded pycharm and python 3.8, but everytime I try to pip install it goes to some hidden opt/ directory. When i type python --version in the terminal, it says 2.7. I suppose I need to get better with the command line but not sure what to do.
I'd GREATLY appreciate any help on this. Been browsing similar questions for hours and nothing helps.
I think Pycharm by default uses a virtual environment with new projects. Have you tried using the terminal in Pycharm itself? Also, check your installations, you may have multiple Python installations causing the issue.

Change the interpreter in Pycharm but it doesn't work

I changed the interpreter from python3.7 to python2.7 in Pycharm. But after I did this process, the interpreter showed success but actually, when I ran the code it still was running with python 3.7.
The interpreters are set from the anaconda.
This image shows that I have changed the external library to Python 2.7 but when I test the type of python in the terminal, it still shows in Python3.7.
I really struggle about this problem, hope someone can help me.
I believe you face a known PyCharm bug: PY-23417. IDE fails to activate the conda environment in the terminal so you end up running Python 2 instead of 3 by python executable as it uses the first interpreter in PATH.
Try PyCharm 2019.1 EAP build. The problem should be resolved there.

Invalid Python SDK Error while using Python 3.4 on PyCharm

When I switch my PyCharm to use Python 3.4.3 and I am getting the error:
Invalid Python SDK
Also PyCharm does not automatically find the Python 3.4 interpreter for me, even though it is on the desired path /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4. See the screenshot:
Despite this the interpreter does work. I am able to get correct output as expected, but code completion related to Python 3.4 is not working.
E.g. print("hello world!) still shows an error on the editor, but the console shows the correct output.
This also happened to me. I renamed a repository and then my virtual environment got stuck in the old path.
I grepped all configuration files and could not find any reference to the old one.
What finally solved the problem was to clear caches with the option File > Invalidate Caches / Restart...:
I had the same issue.
Try to comment/remove the PYTHONPATH variable in your ~/.bash_profile
#export PYTHONPATH=/usr/local/lib/python2.7/site-packages/
If it does not help it also may be useful to look in the idea.log for the errors:
/Users/username/Library/Logs/PyCharm40/idea.log
I had the following errors:
Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x!
PYTHONPATH is currently: "/usr/local/lib/python2.7/site-packages/"
You should `unset PYTHONPATH` to fix this.
I go the same error message in Windows version of PyCharm after I re-installed Python (3.5) on a different location. The problem was that most of my existing virtual environments registered in PyCharm were still referencing the old installation of Python.
I resolved it by deleting these existing virtual environments and creating a new one. If deleting existing interpreters (in virtual environment) is not an option, you should be able to modify them instead in File | Settings | Project Interpreter
I got the same issue, when I updated Python (3.x) version via Home brew in MacOS.
Above answers didn't work for me. But with those, I realize that, it's an issue with linking the directories. I deleted ~/.virtualenvs folder and recreated all virtual envs.
$ ls -a ~/.virtualenvs
local-dev wdias-dev
$ rm -rf ~/.virtualenvs
$ which python3
/usr/local/bin/python3
$ mkvirtualenv local-dev --python=/usr/local/bin/python3
$ mkvirtualenv wdias-dev --python=/usr/local/bin/python3
Open the PyCharm again, and it works fine.
I couldn't get anything to work, so I cloned my conda env (see how), called it something else, and then set it in PyCharm to the new one.
For me, changing the paths in ~\venv\pyvenv.cfg made PyCharm recognize the new environment after bringing my projects to a new PC.
I had the same issue in Windows10. I was so frustrated, beacause everything seems looked OK. I've added PYTHONPATH, I've restarted Pycharm and deleted old virtualenv folders and created new... It did't work.
And at the end I have just opened Pycharm in an administrator mode and it works!
When creating a new project my interpreter was set to python 2.7 so I had to change that to python3 and everything works like a charm
I got the same problem with Pop OS 21.04 and Pycharm installed via Flatpack. So i remove it and installed via Snap and started working again.
I ended up having to install Python as an admin and make sure it installed to the C:\Program Files\Python310 folder. I think The option was to make sure it installed for all users. If I installed it under for user's appdata it wouldn't work.
Once I did that I was able to point pycharm to the C:\Program Files\Python310\ for the interpreter. Pretty annoying but finally got it working
I've solved it too. Uninstalled python 3.10, installed python 3.9. Changed the python interpreter to 3.9 through pycharm setting. Created a new virtual environment.

Categories