Error installing open-cv | windows | anaconda | python 3.8 - python-3.x

I am trying to install Open-cv on anaconda prompt but every time I start installation using
python -m pip install opencv-python
it shows me different errors, I have tried installing OpenCV using cmd but it shows:
Requirement already satisfied: opencv-python in c:\users\wajid\appdata\local\programs\python\python38-32\lib\site-packages (4.5.1.48)
Requirement already satisfied: numpy>=1.17.3 in c:\users\wajid\appdata\local\programs\python\python38-32\lib\site-packages (from opencv-python) (1.20.2)
what does this mean? Checked on jupyter notebook it shows:
ModuleNotFoundError: No module named 'cv2'
I have only single version of python installed on my laptop.

Related

Can't update tensorflow OS X Monterey

I write in terminal pip3 show tensorflow and that's what i get:
pip3 show tensorflow Name: tensorflow Version: 1.8.0
here is what i get when im trying to upgrade it with pip3 install tensorflow==2.5.0:
pip3 install tensorflow==2.5.0 Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement tensorflow==2.5.0 (from versions: none) ERROR: No matching distribution found for tensorflow==2.5.0
PYTHON VERSION - 3.8.9
I have also tried to do it through source installing, but the same problem

unable to locate pip packages using asdf in VSC

I have just installed a fresh install of BigSur and Python (using asdf) when installing pip packages they seem to end up in:
./.asdf/installs/python/3.9.2/lib/python3.9/site-packages
when typing which flake8 for example I get flake8 not found but when I go to install it again pip install flake8 I get the following:
> which flake8
flake8 not found
~
> pip install flake8
Requirement already satisfied: flake8 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (3.8.4)
Requirement already satisfied: pycodestyle<2.7.0,>=2.6.0a1 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (2.6.0)
Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (0.6.1)
Requirement already satisfied: pyflakes<2.3.0,>=2.2.0 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (2.2.0)
I have just tried to use requests which I installed like pip install requests and I also got not found when using which but I manage to use the package in VSC ok.
I am using flake8 and Black and I need to give VSC their paths. I have used
./.asdf/installs/python/3.9.2/lib/python3.9/site-packages/<package name>
but VSC doesn't seem to pip it up. I am using the latest verisons.
> python -V
Python 3.9.2
~
> pip -V
pip 21.0.1 from /Users/paul/.asdf/installs/python/3.9.2/lib/python3.9/site-packages/pip (python 3.9)
this might help too:
~
> which python
/Users/paul/.asdf/shims/python
~
> which pip
/Users/paul/.asdf/shims/pip
Any idea how I can get which to display the correct paths so I can get my listing and formatting working ok?
This fixed it... https://til.hashrocket.com/posts/ques11vrjs-get-pip-installed-executables-into-the-asdf-path
asdf reshim python
I would be curious why I have to do this...if anyone could answer

Cannot install jupyter

Every time I load jupyter notebook I get the error:
(venv) C:\Users\Kris\PycharmProjects\HelloWorld>jupyter notebook
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
I reinstalled Pycharm, Python and Conda but the issue persists.
When running pip install jupyter, I do get some installation but it errors out at
Collecting MarkupSafe>=0.23 (from jinja2>=2.4->nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz
Collecting pywin32>=1.0; sys_platform == "win32" (from jupyter-core->nbconvert->jupyter)
Could not find a version that satisfies the requirement pywin32>=1.0; sys_platform == "win32" (from jupyter-core->nbconvert->jupyter) (from versions: )
No matching distribution found for pywin32>=1.0; sys_platform == "win32" (from jupyter-core->nbconvert->jupyter)
How can I get Jupyter to install?
You can try this: python -m pip install jupyter and then python -m jupyter notebook.

ModuleNotFoundError: No module named 'selenium' You are using pip version 9.0.1, however version 19.3.1 is available error using selenium using Python

I wrote a python script and using selenium driver. I am getting the below error:
from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
When I run the command: pip install selenium, the output is:
Requirement already satisfied: selenium in d:\windows\system32\config\systemprofile\appdata\local\programs\python\python36\lib\site-packages
Requirement already satisfied: urllib3 in d:\windows\system32\config\systemprofile\appdata\local\programs\python\python36\lib\site-packages (from selenium)
You are using pip version 9.0.1, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Can you please help to resolve this.
This error message...
Requirement already satisfied: selenium in d:\windows\system32\config\systemprofile\appdata\local\programs\python\python36\lib\site-packages
Requirement already satisfied: urllib3 in d:\windows\system32\config\systemprofile\appdata\local\programs\python\python36\lib\site-packages (from selenium)
You are using pip version 9.0.1, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
...implies that you are using pip v9.0.1 which is pretty ancient. You need to update pip to the latest available version of pip v19.3.1 using the following command from the command prompt:
python -m pip install --upgrade pip

Jupyterlab Package Directory

I'm having trouble importing pypyodbc in a jupyterlab notebook. I'm able to import it in a shell and even "old" jupyter notebooks. I've tried installing it via pip, conda, and manually. When I run !{sys.executable} -m pip install pypyodbc in the notebook it just shows:
Requirement already satisfied: pypyodbc in
c:~\appdata\local\continuum\anaconda3\lib\site-packages\pypyodbc-1.3.3-py3.6.egg
(1.3.3)
Requirement already satisfied: setuptools in
~\appdata\local\continuum\anaconda3\lib\site-packages
(from pypyodbc) (39.1.0)
I can import other packages just fine, but pypyodbc isn't working. What is the default package directory for jupyterlab, and how can I point it to a specific directory to import packages from?
It's possible you have multiple versions of Python running on your computer and Jupyter is selecting a version that does not have that package. To figure out what version of Python is running in your notebook do this inside Jupyter:
import os
import inspect
inspect.getfile(os)
Then you can run pip on that specific version:
python3.6 -m pip install pypyodbc
Alternatively, you can try to uninstall the package and reinstall via pip if it still doesn't work.

Resources