I am trying to use openCV to do a small color detection from a camera. I followed and used this youtube code and downloaded openCV. I also downloaded the Python and Code Runner extension through Visual Studio Code.
I keep getting an error that python is not installed.
What am I doing wrong here as I am using the same code from the video found from his github
ERROR MESSAGE IN TERMINAL:
[Running] python -u "C:\Users\LINEA~1.LAP\AppData\Local\Temp\tempCodeRunnerFile.python"
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
[Done] exited with code=9009 in 2.123 seconds
https://github.com/CreepyD246/Simple-Color-Detection-with-Python-OpenCV
This error is occurring because while you have the Python extension for VSC installed, you don't have the Python interpreter installed, which is a separate piece of software. You can find the Python installer here. I recommend adding Python to PATH (an option it gives during the installation).
Once you've got Python installed, you'll still need to install Python bindings for OpenCV. This can be done from the terminal, by typing pip install opencv-python. If this doesn't work, try py -m pip install opencv-python.
Related
I am on Linux Mint. When i try to import robot for robotframework in my python application it doesnt get recognized as a installed library. This while i checked the executable with the "which" command.
which python
Gives the output: /usr/bin/python
I put that path '/usr/bin/python' in the interpreter path in vscode. But it doesn't get
the installed libraries.
when i use the terminal outside of vscode and do
pip list
I get a big list with all of my installed libraries. But when i do the same in VScode i just get a short list with nothing of the installed libraries.
I tried to deinstall python, vscode and reinstall both but that doesn't work. The python path to the system python.exe is in the PATH variables. I dont know what i can try further.
It looks like that they both point to the same pip instance but it doesn't recognize the same packages. Like it cant find the site-packages folder
Can anyone please help?
I've found the problem.
In Linux Mint when you install visual studio code via the application manager built into the OS. It installs the flatpack version of Visual studio code. Which creates what looks like its own environment that cannot get the pip packages from the main system.
For me what solved it was to download the .deb version from the official vscode website(https://code.visualstudio.com/Download) and install that one using the:
sudo apt install /Downloads/{name of downloaded.deb file}
When I used this version of Visual studio code it all worked for me with no problem.
I'm trying to install a python package (specifically pandas) into Visual Studio code on a chromebook's linux virtual machine. I've tried many different things but none of them seem to work: trying to use pip install pandas results in bash: pip: command not found. I have no idea where the actual python interpreter is located, so I can't go to the source. I thought it was that I wasn't using the correct terminal, but the only other option is JavaScript Debug Terminal. What am I doing wrong? Is it even possible?
Pip is a python package management tool, which provides the functions of finding, downloading, installing and uninstalling Python packages. However, this tool is not included in the system and needs to be installed manually. Here is the official website of PIP, which contains installation instructions.
I am trying to import the module mtcnn in VSCode.
I have run the following commands in the terminal:
pip3 install MTCNN
and
python3.8 -m pip install mtcnn
Which downloads MTCNN
Terminal showing its already installed
But when I try run my python file in VSCode, I run into this error:
Error
I am using python version 3.8.5 in VSCode. There is no red line error under the import line in VSCode so I'm confused why it's not working.
Open an integrated terminal in VS Code, run python --version to check if it's as the same as the one you selected for python interpreter, which is shown in status bar.
Run pip show mtcnn. If you get detailed information like name, version and location, reload window should solve your question.
If you get WARNING: Package(s) not found: mtcnn, it means no such module in your current selected environment, install it.
Besides, to avoid messing up the global python environment, you may create a virtual environment. See Create a Virtual Environment.
I am using PyCharm community edition 2018.2.
Code completion works fine but just for installed modules if I install external library code completion doesn't work for them. However I have no problem with running code based on them.
I checked that my PyCharm is not in the 'PowerSafeMode'.
I have created project both for main and local Python interpreter.
In the IDE I also try to select installed libraries as a source.
I tried this for PIL library and OpenCV library.
Anyone has and idea what I might be missing or doing wrong?
Didn't you installed opencv via terminal?
For example, like this.
$ pip install opencv-python
$ pip install opencv-contrib-python
When I installed opencv through terminal, experienced the same problem.
If so, please try this.
1.Create new Pycharm Project, with new environment using Virtualenv.
2.Install opencv through Pycharm.
File -> Settings... -> Project interpreter -> +
I'm having trouble getting python to work on my Windows 10 computer. I downloaded 3.5.2 off the website and ran the exe, but when I try to use
pip install nltk
So I copied and ran get-pip.py, but it still tells me "pip" is not recognized as an internal or external command, operable program or batch file.
python -m pip install pip
tells me that python is also not recognized. What should I do?
EDIT: Have tried reinstalling python, made sure the box to install pip was checked. Tried re-running the pip command in the Python command line (the one titled Python 3.5 (32-bit)) and it gave me an invalid syntax error on the word install.
When installing "the exe", make sure that you tick the checkbox labelled "Add Python 3.5 to PATH". That will solve the issue you mentionned.