Visual Code gives error that it cannot find Python on Mac Pro - python-3.x

I'm running a Mac Pro 2021 model version 12.6. For some reason, my vscode will not run Python anymore when I tried using a program. I switched over to the cloud-based version for a while and now switched back to the application. It says that it could not find Python in my files. I believe both VSCode and my Mac are updated up to date. I installed python 3.11.0 for Mac, but no progress. I also tried running the update shell.command and the certificate commands as a part of the download in the vscode terminal, but it did not help. I also reinstalled the Python
v2022.16.1 Vscode extension and restarted the program. I still get the same error.
Explained above.

Have you tried Shift + Command + P type "Python: Select interpreter" yet?
Usually, all installed Python interpreters show up here, and you can also enter a path to a Python interpreter on your system.

Related

Showing python 2.7.12 for python 3.9.1 on Command window?

I am using python 3.9.1 on my computer and when I try this command on cmommand windows : python -- version , I come up with 2.7.12 !!! And it does not show the version correct.
I uninstalled python and removed all the related files on C drive as well as environmental Variables...
Now I don't have python but it still shows the version 2.7.12 when I ask for Command windows!!!
Does anyone know what is the problem ????
if you have both versions then you should write python2 --version o
Go to my computer, right click and then properties. Here go to Advanced System setting
and at the bottom of the window open Environment Variables and check any variable having python on it. if there are two variable maybes this is the problem.
Also go to the app data on your windows and check files if there is a file related to the older version of python.
Good Luck.
You can use PowerShell instead of cmd as well try this one after checking the variables.

Visual Studio Code with Python for Windows AND Anaconda

I'm trying to use Visual Studio Code with both Anaconda and Python for Windows.
I have both installed, and I have the visual studio code extensions for both.
But no matter what I do now the Conda Base gets activated -
(base) PS C:\Users
even though the Python for Windows is the selected version
or if I try to activate an environment I get a mix of both, the venv with python for windows and the conda base activated.
(venv_iocparser) (base) PS C:\Users\
The settings.json file in this folder only has python for windows in the 'python.pythonPath'; with no mention of conda, but still activates the conda base.
Does anyone know a good article that walks through setting VSCode up with both? With python for windows as the default?
Thank you!
Had a similar issue. Its most likely since you installed VS Code with Anaconda, for some reason or another it just assumes thats what env you want when starting it.
To get out of it just run $ conda deactivate and then activate whatever env you want after that. I fixed it by changing the PATH for the python to only point at the non-conda versions though. I also had uninstalled it all and reinstalled it all at one point though.

How to use pip with Visual Studio Code

I have python 3.6 installed, I have a python extension installed on Visual Studio code but I still can't use pip on Visual Studio code. It says it is not a recognised command. Any help please?
Update: I tried installing pip manually but a file in python2.7 keeps stopping. What's bothersome is that I uninstalled python 2.7 ages ago and I've currently removed every folder with it but python-V still says I have python2.7.6 installed.
I'm on windows 10
I found some solution on this website:
https://pip.pypa.io/en/stable/installing/
If you use Visual Studio Code, you can type the following command:
C:\> py -m pip
If everything is alright, you should see the list of commands, which you can use. They are listed in your terminal, as per below.
I also would advise you to check/select the version of Python you are using:
VSCode: There is no Pip installer available in the selected environment
I am pretty sure your problems of VSCode not finding the correct version of Python will be resolved if you add your ( Python 3.6 installation ) location to the system path.

Odoo Mac OSX installation get error "Could not execute command lessc" in PyCharm Community Edition

I installed Odoo 9 on Mac OSX using Homebrew virtual environment.
I installed npm, less and less-plugin-clean-css.
Finally if I launch Odoo from the Mac Terminal, using the appropriate parameters, everything goes well and I can enter my odoo with localhost:8069.
I then setup PyCharm Community Edition for odoo development, but when I run odoo from within PyCharm I get the error:
"Could not execute command lessc"
and obviously the web layout is totally wrong.
I saw here NodeJS plugin in IntelliJ Community Edition does not work that you cannot use NodeJS plugin with PyCharm CE.
My question then is: "How to enable PyCharm CE to use less and get rid of the error?".
If you are in Pycharm in getting error Could not execute command lessc and you have installed less which you can check by entering lessc command in terminal
Fix:
If you are using virtualenv then activate virtualenv from terminal and restart the server again from terminal, this time it won't give any error.
If you are not using virutalenv then you can just run from terminal server without any problems
I'm not sure why this problem is specific to PyCharm.
I had the same issue from PyCharm Professional, but I solve this issue with this way
When i finish installing the PyCharm pro ,then i set the environment variables in the 'run/debug configuraition'
(/usr/loca/bin)
which value(path) i found is using command "which lessc" in the terminal
Then I think the PyCharm can find lessc, and finnally I get rid of this nightmare
`Could not execute command 'lessc'
For me, updating the node was the solution. It was version 0.10.33. Now it's 6.1.12.
Check out this answer. You must uninstall node and reinstall it in a certain order:
https://stackoverflow.com/a/36395799?noredirect=1
At least that is what worked for me.

How to set Python IDLE to use certain python version

I am using Windows 8.
Python version 2.7.3 have been installed on my computer together with another software.
Now I have installed python 3.3.5 and i want to use this version from now.
But everytime I run Python IDLE it runs version 2.7.3.
Even if I go to C:\Python33\Lib\idlelib\idle.pyw and run idle.pyw it runs with the 2.7.3 version.
I thought that every python version install its own IDLE so I am quiet confused here.
When I run Hello world program from the console it runs using the version 3.3.5 I have checked that.
So what I need to do is to run IDLE using 3.3.5 version
Anybody knows what to do?
Each installation of Python comes with its own respective version if IDLE. I suggest you explore your Python installation folder, and find the version of IDLE you're looking for and create a shortcut to it, or add it to your environment variable list, so you can invoke a specific version from the command line.

Resources