Opencv3 is not installed for python3 - python-3.x

I am using pyenv for python3.4 and want to install opencv3.
$ brew install opencv3 --HEAD --with-python3 --with-ffmpeg --with-tbb --with-contrib --with-opengl --with-qt5
but in /usr/local/Cellar/opencv3/HEAD-8e8da3f/lib/ there is no python3.4
it only have python2.7.
i don't know what is the problem.

Install anaconda and run the collowing command:
conda install -c menpo opencv3

Related

how to solve the pytorch_geometric install error. Undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs #999

how to solve the pytorch_geometric install error. Undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs #999
solution:
conda install pytorch pyg -c pytorch -c pyg -c conda-forge
conda create -n py38 pip
conda install pytorch pyg -c pytorch -c pyg -c conda-forge
conda install pyg -c pyg -c conda-forge
sudo apt-get install libfreetype6-dev
pip install -r requirements.txt
Maybe check here:
https://github.com/pyg-team/pytorch_geometric/issues/999
Most people say it is due to how you installed pytorch and two versions (the cpu and gpu versions are both installed)
I had a similar issue. As mentioned in this GitHub comment, this issue occurs when we have different torch versions installed in our system. This problem occurred in my anaconda virtual environment, which I installed in the following path.
/home/anaconda3/envs/python-3.9
I followed the following steps to solve this issue.
Step 01: First remove all the existing torch installations and their dependencies.
$ cd /home/anaconda3/envs/python-3.9/lib/python3.9/site-packages
$ rm -rf torch*
Step 02: Reinstall a specific PyTorch version and relevant dependencies as follows.
$ pip install torch -f https://data.pyg.org/whl/torch-<PYTORCH-VERSION>+<CPU|GPU>.html
$ pip install torch-geometric -f https://data.pyg.org/whl/torch-<PYTORCH-VERSION>+<CPU|GPU>.html
$ pip install torch-sparse -f https://data.pyg.org/whl/torch-<<PYTORCH-VERSION>+<CPU|GPU>.html
$ pip install torch-scatter -f https://data.pyg.org/whl/torch-<PYTORCH-VERSION>+<CPU|GPU>.html
Make sure you install a PyTorch version according to your requirements and your system (CPU or GPU). For example, I installed the following version.
$ pip install torch -f https://data.pyg.org/whl/torch-1.12.1+cpu.html
$ pip install torch-geometric -f https://data.pyg.org/whl/torch-1.12.1+cpu.html
$ pip install torch-sparse -f https://data.pyg.org/whl/torch-1.12.1+cpu.html
$ pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.1+cpu.html
You can find all the stable PyTorch versions here. In addition, now you will be able to see the installed packages inside your anaconda installation path /home/anaconda3/envs/python-3.9/lib/python3.9/site-packages.

Installing PyQt5 on Raspberry (Buster) with Python 3.7.3 [duplicate]

I need to port some code that's Python2+PyQt4 to Python3+PyQt5.
I started installing pip3
sudo apt-get install python3-pip
Works great. Tried
sudo pip3 install PyQt5
Downloading/unpacking PyQt5
Could not find any downloads that satisfy the requirement PyQt5
Cleaning up...
No distributions at all found for PyQt5
Online I find the following steps:
http://pyqt.sourceforge.net/Docs/PyQt5/installation.html
But they are too many. What's the easiest way to Install PyQt5 along with Python3 in Ubuntu 14.04 ?
Why not simply install it via apt-get?
sudo apt-get install python3-pyqt5
Otherwise you'd have to compile PyQt (and potentially Qt) by hand, which is cumbersome.
Well I documented the steps for Installing pyqt5 with qt designer and code generation here: https://gist.github.com/ujjwal96/1dcd57542bdaf3c9d1b0dd526ccd44ff
Installation
pip3 install --user pyqt5
sudo apt-get install python3-pyqt5
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools
Configuring to run from terminal
$ qtchooser -run-tool=designer -qt=5
OR
Write the following in /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf
/usr/lib/x86_64-linux-gnu/qt5/bin
/usr/lib/x86_64-linux-gnu
Code Generation
Create uic.py file.
#!/usr/bin/python3
import subprocess
import sys
child = subprocess.Popen(['pyuic5' ,'-x',sys.argv[1]],stdout=subprocess.PIPE)
print(str(child.communicate()[0],encoding='utf-8'))
$ chmod +x uic.py
Create a symlink:
$ sudo ln uic.py "/usr/lib/x86_64-linux-gnu/qt5/bin/uic"
Desktop Entry
[Desktop Entry]
Name=Qt5 Designer
Icon=designer
Exec=/usr/lib/x86_64-linux-gnu/qt5/bin/designer
Type=Application
Categories=Application
Terminal=false
StartupNotify=true
Actions=NewWindow
Name[en_US]=Qt5 Designer
[Desktop Action NewWindow]
Name=Open a New Window
Exec=/usr/lib/x86_64-linux-gnu/qt5/bin/designer
save in ~/.local/share/application with .desktop extension
sudo apt-get install python3-pip
sudo pip3 install PyQt5
How to install PyQt5 in Python3
Tested on Ubuntu 18.04.
Just installing it did not work for me. I had to uninstall it first, then reinstall it:
# upgrade pip
python3 -m pip install --upgrade pip
# uninstall
python3 -m pip uninstall PyQt5
python3 -m pip uninstall PyQt5-sip
python3 -m pip uninstall PyQtWebEngine
# reinstall
python3 -m pip install PyQt5
python3 -m pip install PyQt5-sip
python3 -m pip install PyQtWebEngine
See here for my full answer, including how to install it for a specific version of Python3, such as Python3.8: How to install PyQt5 in Python3

Install Shapely in Python 3

I cant install the shapely module in my anaconda prompt.
pip install --upgrade setuptools
pip install shapely
Command "python setup.py egg_info" failed with error code 1 in C:\Users\renau\AppData\Local\Temp\pip-install-27xf59zz\shapely\
Any solutions?
If you are using Anaconda, then it would probably be best to use:
conda install shapely
i guess you are using Windows ?
if so, you can't install shapely directly via pip
here's the steps:
go to this site and download desired version of shapely
run this script
pip install Shapely‑1.6.4.post1‑cp36‑cp36m‑win_amd64.whl
here i'm going to install Shapely version 1.6.4 for python 3.6 running in Windows 64bit
sudo apt-get install python-shapely
on Python 3
sudo apt-get install python3-shapely

Unable to install beautifulsoup4 in python on Mac Os

I am trying to install beautifulsoup4 in my mac using the following command:
pip3 install beautifulsoup4
But I am getting this following error:
Could not find a version that satisfies the requirement beautifulsoup4 (from versions: )
No matching distribution found for beautifulsoup4
How can I solve this?
Update pip with pip3 install --upgrade pip. Now you should be able to install beautifulsoup pip3 install beautifulsoup4. If that fails try: python3 -m pip install beautifulsoup4
If you’re using a recent version of Debian or Ubuntu Linux, you can install Beautiful Soup with the system package manager:
$ apt-get install python-bs4 (for Python 2)
$ apt-get install python3-bs4 (for Python 3)
Or
you can install it with easy_install or pip.
$ easy_install beautifulsoup4
$ pip install beautifulsoup4
If you are using Anaconda distribution, you can use this command.
conda install -c anaconda beautiful-soup
Hope this helps.
I tried upgrading pip3 with what Jatmir was suggesting, but it did not work for me. Finally, I found another way to upgrade it in this post https://github.com/pypa/pip/issues/5255#issuecomment-381702613
curl https://bootstrap.pypa.io/get-pip.py | python3
I had the same issue with my MacBook and I did below.(2018/September)
Update pip with
pip3 install --upgrade pip
Now you should be able to install beautifulsoup
pip3 install beautifulsoup4
If that fails try:
python3 -m pip install beautifulsoup4
You can download the tarball from here.
extract it, then run:
sudo python setup.py install
if pip fails to work

How to install PyQt5 in Python 3 (Ubuntu 14.04)

I need to port some code that's Python2+PyQt4 to Python3+PyQt5.
I started installing pip3
sudo apt-get install python3-pip
Works great. Tried
sudo pip3 install PyQt5
Downloading/unpacking PyQt5
Could not find any downloads that satisfy the requirement PyQt5
Cleaning up...
No distributions at all found for PyQt5
Online I find the following steps:
http://pyqt.sourceforge.net/Docs/PyQt5/installation.html
But they are too many. What's the easiest way to Install PyQt5 along with Python3 in Ubuntu 14.04 ?
Why not simply install it via apt-get?
sudo apt-get install python3-pyqt5
Otherwise you'd have to compile PyQt (and potentially Qt) by hand, which is cumbersome.
Well I documented the steps for Installing pyqt5 with qt designer and code generation here: https://gist.github.com/ujjwal96/1dcd57542bdaf3c9d1b0dd526ccd44ff
Installation
pip3 install --user pyqt5
sudo apt-get install python3-pyqt5
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools
Configuring to run from terminal
$ qtchooser -run-tool=designer -qt=5
OR
Write the following in /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf
/usr/lib/x86_64-linux-gnu/qt5/bin
/usr/lib/x86_64-linux-gnu
Code Generation
Create uic.py file.
#!/usr/bin/python3
import subprocess
import sys
child = subprocess.Popen(['pyuic5' ,'-x',sys.argv[1]],stdout=subprocess.PIPE)
print(str(child.communicate()[0],encoding='utf-8'))
$ chmod +x uic.py
Create a symlink:
$ sudo ln uic.py "/usr/lib/x86_64-linux-gnu/qt5/bin/uic"
Desktop Entry
[Desktop Entry]
Name=Qt5 Designer
Icon=designer
Exec=/usr/lib/x86_64-linux-gnu/qt5/bin/designer
Type=Application
Categories=Application
Terminal=false
StartupNotify=true
Actions=NewWindow
Name[en_US]=Qt5 Designer
[Desktop Action NewWindow]
Name=Open a New Window
Exec=/usr/lib/x86_64-linux-gnu/qt5/bin/designer
save in ~/.local/share/application with .desktop extension
sudo apt-get install python3-pip
sudo pip3 install PyQt5
How to install PyQt5 in Python3
Tested on Ubuntu 18.04.
Just installing it did not work for me. I had to uninstall it first, then reinstall it:
# upgrade pip
python3 -m pip install --upgrade pip
# uninstall
python3 -m pip uninstall PyQt5
python3 -m pip uninstall PyQt5-sip
python3 -m pip uninstall PyQtWebEngine
# reinstall
python3 -m pip install PyQt5
python3 -m pip install PyQt5-sip
python3 -m pip install PyQtWebEngine
See here for my full answer, including how to install it for a specific version of Python3, such as Python3.8: How to install PyQt5 in Python3

Resources