View Other Window Environment Python not available - python

Microsoft says this about adding Python to VS Studio;
https://learn.microsoft.com/en-us/visualstudio/python/managing-python-environments-in-visual-studio?view=vs-2019#manually-identify-an-existing-environment
Select View - Other Windows - Python Environment
I have Python 3.6 installed - I open VS Studio 2107 Community Edition, Click View - click Other - Python is not listed. I can not seem to figure out why Python Environment is not listed. Please assist
Screen Print

I figured it out. When I had originally installed the python extensions using the VS Installer, I did not run as administrator. I went back and re-ran the installer as Administrator and now it functions properly.

Related

How can I set the latest python interpreter

I have many python versions installed. I need nevertheless that when using VSC the script be run by python3.10.7. I changed accordingly the interpreter in VSC to the latest python version. The latest python version, python3.10.7, is installed in the folder /user/bin, while the one which I get with which python is installed in a different folder, home/myname/anaconda3/bin/python. I will appreciate your help. I use Ubuntu 20.4. I do not have experience in using virtual environments. How do I change the interpreter to the latest one ? Thanks for your help.
you can do it by opening the Command Palette using Ctrl+Shift+P and enter Preferences: Open User Settings. Then set python.defaultInterpreterPath, which is in the Python extension section of User Settings, with the appropriate interpreter.

How to clear Visual Studio Code cache?

I am in anaconda dependency hell so I keep building and then deleting different environments and the Visual Studio Code cache seems confused about what environments are available, for example looking for an environment that has been deleted.
I uninstalled and reinstalled VSC (Windows Server 2012 - waiting for upgrade) but the issue persists.
Thanks for any thoughts.
When using Python in VS Code, it recognizes the available python executable file "python.exe", which we can view in the system variables:
In VS Code, it uses the python environment used last time by default, therefore, for unused python environments, you could select other available python environments in VS Code and ignore the deleted python environments. (F1, Python: Select Interpreter)
For more information about the python environment in VS Code, please refer to this document: Using Python environments in VS Code.
Reference: How do I add Python to the Windows PATH?

VS Code Python installation and Python Interpreter not recognized

I am getting this message on the VS Code that "Python is not installed. Please download and install python before using the extension."
There is also no *"Python Interpreter"* to select. When I click on it it shows it empty.
I do have Python and Python extension installed and I do have virtual environments set up in the Anaconda navigator but for some reason, I am not able to use them. I tried many ways like reinstalling the Python, Anaconda, and VS Code and also the Python extension for VS code but it's not solving the issue. What could be the reason?
I have attached a screenshot of the VS Code as well.
Pleae click here to see the screenshot
Thanks for your help.
I tried many methods but none worked. So then I removed this extension "Anaconda Extension Pack by Microsoft" and it solved the issue. So anyone facing the same issue might try uninstalling this extension.
I once faced similar problem and i found out that by default vs code looks for /usr/bin/python however in some cases on linux and mac the path is /usr/bin/python3 or 2 , so you can fix it by declaring python3 as default version .
open terminal and type the following command
sudo apt install python-is-python3
check the installation using -
python --version
it should give the output as 3.x.x
This is interpreter error. you have to click on interpreter error showing bottom right in vs code then you choose installed latest python version.
I reinstalled VS Code as is - not changing existing libraries etc - and now VS Code recognises Python/ paths again. :)
After updating to Windows 11 I think it just needed a refresh.
What did it for me was adding python to the environment variables (Windows).
Find python at "C:\Users\user\AppData\Local\Programs\Python\Python310\python.exe"
Copy this path
In the file explorer right click "This PC" and select properties
Click Advanced System Settings in the settings window that will open (blue link on the right)
Select Environment Variable -> New -> Add the copied python path

PyCharm doesn't detect interpreter

I'm new to programming and just started a course on Python. I want to use PyCharm, so I downloaded and intalled it (v. 4.5, community edition). I had previously installed Python 3.5 64-bit from python.org (I'm using Windows 10).
To start using PyCharm, I need a project interpreter, which I can select in the settings. As far as I'm concerned, the interpreter is "py.exe", but when I select it, I get this error message: "The selected file is not a valid home for Python SDK". I also tried to use every file whose name contained "python" or "py", and failed.
On every website and video I see, they select a file called "python.exe", but they're using Python 3.4 or a previous version. I checked that PyCharm supports 3.5 ("Initial support for Python 3.5").
Is there anything I'm doing wrong? What should I do to be able to use PyCharm?
All replies are appreciated. Thanks in advance.
file > new project settings > project Interpreter > click in the drop down and select 'show all' > click the '+' button >
Now, in the Virtualenv Environment tab under the New environment radio button, check the path in the 'Base interpreter:' field. For me, mine was set to an invalid path. Once I had corrected the path to point to python.exe I recreated my new project and PyCharm built the virtualenv.
For me there was a bit more too.... When creating the new project I expanded the drop down and had to verify the directory where the venv directory was being created. Once I had corrected the path here I had to click around a bit to get it to let me create the project.
I'm going to chaulk this up to a bug. I'm using Community edition.
When creating a project in PyCharm, if the interpret is not already selected, in the drop down menu under the projects "Location:", you can click the gear-looking icon to the right of the interpreter option, and click "Add Local"; then select the file location of the python.exe file that you have installed. It will probably be C:\Python35\Python.exe
I faced a Similar issue and was not able to find Python interpreter anywhere on the system.
The problem with it was that python was installed directly with default settings and there was no exe found in
C:\Python35\
and to solve this i tried uninstalling and reinstalling with custom settings and selecting allow for all users as well which did the trick and path was set correctly to
C:\Python35\python.exe.
After whichPycharm was able to detect the interpreter on this path.
PyCharm project interpreter problem Resolved
I installed anaconda python distribution (Anaconda3-5.0.1-Windows-x86_64.exe) from the anaconda website. https://anaconda.org/anaconda/python
What it actually did was it re-installed my Python3.6.3 (pertinent to mention I have windows10, with pyCharm community & python 3.5 already but with the interpreter problem and while installing anaconda I chose the following settings and disabled my antivirus before my anaconda installation):
selecting allow for all users
installation path was set correctly and (stored safely for future)
restart my Computer after installation.(not essential-but I did)
opened Anaconda & Jet brian pycharm
selected new project in PyCharm screen shot of my New project default Python interpreter location = C:\Users\Skboy\PycharmProjects\dani Interpreter = C:\Users\Skboy\AppData\Local\Programs\Python\Python36-32\python.exe
Wow! my pyCharm started working for me,
Resolution : Python6.3 re-installation with proper custom setting
make a python test test1.py program file to print "hello python test world"
Run
now my Python Interpreter(automatically -by default select) Python 3.6.3
edit configuration & check for interpreter
(C:\Users\user1\AppData\Local\Programs\Python\Python36-32\python.exe)
Run
success test Run
worth to mention Anaconda Jupyter is a web based can also be used in case novice user are still having problems
I have had the exact same problem and was unable to find the solution until just now. Hopefully this works for anyone that was struggling with it.
I went to the location of the Python 3.5 (32-Bit) in my C: Drive which it turns out is just a shortcut to the actual Python application, right click on it and select Open file location which should direct you to the application version of python - simply called 'python'. This is the .exe file that PyCharm was looking for to use as the interpreter.
Now go to the configure interpreter menu in Pycharm and type in the file location of the actual python application. To get to mine I had to go to AppData/Local/Programs/Python/Python35-32. Click on the python.exe file and it should work.
This is my first post here so if its formatted incorrectly or doesn't use the conventional terms - sorry. Let me know if the solution worked for anyone else with the problem or if I fluked it.
If you kept the default settings while installing python, Your project interpreter for PyCharm will be:
C:\Users\yourUserName\AppData\Local\Programs\Python\Python36\python.exe
Chose the above location as your project interpreter inside PyCharm.
Depending on which python version you have, it could be either Python36\python.exe or Python35\python.exe.
For me the following solution it worked:
My configuration:
Pycharm Community edition 2019.1.1
Anaconda distribution with python 3.7. Interpreter in standard location.
Problem:
Pycharm was not able to find python interpreter after reinstallation of anaconda distribution.
Solution:
- Make sure you run pycharm as admin (right click and run as admin). This was actually the critical step.
- Create new project (or open an existing one)
- Depending on the choice choose interpter or go to file > settings > project interpreter > choose small gear on rights side > add > on base interpreter choose the 3 dots > paste the location of the interpreter in the anaconda distribution.
Hope it helped someone. For me the blocking point was that for some reason pycharm was not launching with admin rights.
Blockquote

How to configure Eclipse for PyDev? Python doesn't appear in Preferences window

I'm trying to install PyDev in Eclipse 3.6 on Windows 7.
I have Python 2.7 successfully installed. I installed PyDev through Eclipse, and restarted.
When attempting to configure Eclipse to find my installed Python, (Window -> Preferences) the list that appears does not contain Python. (See image below.)
If I go back to Help -> Install New Software to check what has been installed, PyDev appears as having been installed.
I've tried quitting Eclipse and opening again, with no change. I tried uninstalling PyDev, and re-installing, with no effect. Any ideas how to get Eclipse to see PyDev?
There's an issue when installing plugins under Windows 7 with UAC (User Access Control) active. You need to run as administrator. Read my blog post for more details.
I had the same issue with interpreters not seen for pydev/python.
I followed the link1 below, I had to use the PyDev 3.2.0.zip file and install it with 7zip in the dropin folder, for my system it is:
"eclipse-SDK-3.5.2-win32-x86_64__classicversion\eclipse\dropins" folder. (if you just right click to unzip (not using 7zip) in the dropins folder, you get the 0x80010135 Path too long error).
Then I had to reboot my windows 7 64bit pc to see the pydev/python interpreters.
Then follow link2 and watch derek banas python online videos where he goes over the installs and tutorials.
link1: http://pydev.org/manual_101_install.html
then at the bottom of the page select
http://pydev.org/manual_101_interpreter.html
Note: I also had to use the unzip trick for other eclipse updates ...

Categories