Unable to install cv2 in Python 3.5 on Ubuntu - python-3.x

I have created a virtual environment on Ubuntu 18.0 series with Python 3.5. I am unable to import cv2, error is no module found and a trace back related to Python 2.7. I have already pip installed opencv-Python and opencv-contrib-Python but still the issue persists.
Please help at the earliest.

There a few ways you could go about this:
Using python3
Try:
python3 -m pip install opencv-python opencv-contrib-python
Deactivate your virtual enviroment
Try deactivating your virtual environment by typing deactivate and re-activating it again.
And If all else fails:
Reinstalling Python
Python 3.5 and below no longer has official support, so that may (most likely not) be the problem.
My Tutorial for re-installing python can be found here.
After that, try:
pip install opencv-python opencv-contrib-python

Related

Do I have different python versions and which one I am working with?

I am confused about different python versions on my Computer and in Anaconda.
First: I use an iMac (OSX Catalina).I sometimes use the command line (Terminal on my iMac) directly and sometimes I use Anaconda Navigator (for example when I want to work with Jupyter Notebooks).
When I type python3 --version, I get the answer that I have python 3.8.0 installed. But recently, I installed the latest pip version with pip3 --user --upgrade pip. The answer I got was:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 20.0.2 from /Users/Andrea_5K/Library/Python/3.7/lib/python/site-packages/pip (python 3.7)
I wondered why in this message python 3.7 is referenced.
When I check my Library/Python folder in my user folder I see that I have a 3.7 folder and a 3.8 folder as well. Is there something wrong? Is pip 20.0.2 now installed on python 3.7 although I use python 3.8? And what does the WARNING message mean?

Installing Spacy is failing with Python 3.7 on Windows 10

Installing Spacy on Windows 10 with pip is failing. Installing any other of a number of modules is working fine for me.
Here is a pastebin containing the error message:
pip install -U spacy
or
python -m pip install spacy
output:
https://pastebin.com/Y9np4veN
I have tried this both with and without virtualenv and it is failing in the same manner either way. I have also already tried installing and updating setuptools. I've ensured that I am using Python 3.7 and pip3. There is no other version of python or pip installed on my PC.
I downgraded to Python 3.6 and was able to successfully install spacy
Using x86-64 ("64-bit") version of Python 3.7 (3.7.4) instead of x86 ("32-bit") one on Windows fixed the issue for me.

ERROR in install opencv in my python 3.6.6

I HAVE PYTHON 3.6.6 INSTALLED IN MY WINDOWS 7 PLATFORM BUT WHEN I TRIED TO INSTALL OPENCV PACKAGE IT SAYS REQUIREMENT ALREADY SATISFIED AND IF I TRY TO IMPORT CV2 IT SAYS NO MODULE .I'VE TRIED ALL POSSIBLE METHODS ON INTERNET WHAT SHOULD I DO
i tried to download opencv exe from sourceforge and copying cv2.pyd file and then pasting it in site packages
i tried pip install opencv_python-4.0.1-cp37-cp37m-win_amd64.whl
but nothing works
The error message says that you are asking PIP install a version of cv2 for 64-bit Python 2.7, and that installation is failing. So the installation is not happening because it's the wrong version. That might be because you don't have Python 2.7, or because you have a 32-bit processor, or both. Navigate to Python36\Scripts and issue the command pip install opencv_python. Then pip will find the appropriate file to download, and install it.

Install working rosbag package for Jupyter Notebook (Python 3)

Trying to plot the data from ros topics in a rosbag file. My system by default had Python 2.7 and I installed Python 3.5 just to work with Jupyter notebooks.
Now I have installed several packages twice, once for Python 2 and again for Python 3. Although most packages are compatible with both versions of Python, I am beginning to wonder if all the ros packages are compatible here.
For the image in this question, initially I was getting an error 'No module named 'rosbag_pandas'', then I installed it with pip3. Now I am facing the error shown in the image with regards to rosbag. I have searched high and low for a quick fix but to no avail. I read online that some packages only work with either Python 2.7 or with Python 3.5. Is that what's happening here?
FYI I have installed pyrosbag with pip and pip3 both. Still facing this issue. Could really use some help with this.
I faced the same problem and found a workaround for me. Basically, on top of the usual python 3 installation, install a python 2 kernel for jupyter notebook, as described here, as follows:
python2 -m pip install pip
python2 -m pip install --upgrade ipykernel
python2 -m ipykernel install
Not sure if there is indeed a python 3 package for rosbag but using the python 2 kernel you can import rosbag files to save them in another format for further processing in python 3.

Error intalling scipy for python 3.5

Got an error installing scipy package (see attachement) from prompt. Windows 7, 64bit, Python 3.5.1. Also tryed scipy-0.19.0-cp35-cp35m-win_amd64.whl but got a scipy-0.19.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform response. So how to find the supported wheel? Thanks in advance!
UPDATE: Didn't find the way to install scipy package itself but installed Anaconda and made it as a default PyCharm Python interpreter, scipy imports properly now.
Update you pip
pip install --upgrade pip
And then try
pip install scipy

Resources