How do I download PyPy? - download

I run Windows 10 64 bit.
I haven't tried downloading PyPy because I didn't find any tutorials on YouTube.
I have also went to the official PyPy website but it is for Python 3.6
Do I need to have python 3.6 downloaded too?
Also tell the steps to download PyPy
Edit: I am having problems in installing modules too. It gives a GINORMOUS error saying I need wheel, and some compilers like G77, GNU, Visual C++, etc.

If I understand you correctly, I dont think you need python 3.6 installed,
If you have already downloaded pypy from the website, extract the file by right-clicking on it and run the .exe file. Then run pypy and you shouldn't have any problems from there on.
Hope my advice is useful.

Related

Class RunLoopModeTracker is implemented in both - Qt

Just to precise I'm a total beginner in this. I check on the internet and it seems that nothing match to this problem.
My goal is to run this github which is a facial recognition program: https://github.com/anisayari/easy_facial_recognition
So here is the error:
Class RunLoopModeTracker is implemented in both
/Users/pierre/anaconda3/lib/python3.7/site-packages/cv2/.dylibs/QtCore (0x1086267f0)
and /Users/pierre/anaconda3/lib/libQt5Core.5.9.7.dylib (0x122fc0a80).
One of the two will be used. Which one is undefined.
From what I understand, I just have to indicate which one to use but I don't find anything about how to do it. Also, It seems to be a recurrent error on Mac.
I had this error on my Mac too. Apparently opencv's GUI tools were conflicting with the PYQT libraries that were also installed on my system in my anaconda/lib/ folder. So to give opencv just one set of GUI tools and since I wasn't sure what else was using PYQT in my lib, I chose to use the non-GUI version of opencv, aka opencv-python-headless. I previously had opencv-python-headless installed on my system, and maybe the two packages can't co-exist in the new version of OpenCV or with Catalina.
I removed opencv-python
pip uninstall opencv-python
uninstalled and reinstalled the headless version (which has no GUI tools)
pip uninstall opencv-python-headless
pip install opencv-python-headless
I don't know if it was necessary to remove then reinstall the existing headless package, but that's what I did. I wasn't sure that opencv-headless would find the PYQT in my lib but it didn't have any problems.

Install graph-tool on Mac OS, graph drawing issue

In the end, created an env to install graph-tool thru the channel vgauthier.
Thinking by now that I might have as well used earlier version of python or installed a whole new python latest version just for this.
But as it is all part of the learning process to creating dev. env.. (at the same time worrying my Mac has too many installations with much too interlinked dependencies)
Someone kindly let me know if this rings any bell or got any suggestion:
Incompatible library version states that _cairo.cpython-36m-darwin.so requires later version of libcairo.2.dylib.
Errors could have been from:
having on .condarc file, wrong priorities btw channels, so having trouble finding the right files
(modified to the order of conda-forge > ~dir/vgauthier > default
my having given up on installing pygobject after googling it is not supported on Mac OS (which was apparently wrong or I just wasnt searching well)
Solution to easy setup of graph-tool for conda-installed python users:
Get the benefit of GUI (seriously a god option) ->
https://medium.com/#ronie/installing-graph-tool-for-python-3-on-anaconda-3f76d9004979
To still continue with command line (still get the idea from GUI)
conda install -c pkgw-forge gtk3
conda install -c https://conda.anaconda.org/fallen pygobject
(if there are cairo blah blah missing, look up setup directions for igraph which has more information and help, having been an older library)
Do these before installing graph-tool, which Im still wondering why I cannot remove from the system though. ;)
For others, https://git.skewed.de/count0/graph-tool/wikis/installation-instructions#compiler-choice-in-macos-x

App failed to start because it could not find Qt platform plugin "Windows" in ""

I have been bogging my mind on this one for a few days with various versions of python and freeze utilities.
Python 3.6, PyQt5
I created a script, and am trying to make a standalone .exe
However, when running pyinstaller, I get the result I have posted below. I am currently using an Anaconda distribution, so I am not sure if this has anything to do with it. How do I resolve this issue?
I have tried to fix it for several days using different python and pyqt versions, but the short story is that some of the libraries I am using come into conflict in other versions. I am posting this again because nothing else has really worked, and I am on my last straws.
Thanks in advance.
Error Window:
From this page:
PyQt5 - Failed to load platform plugin "windows". Available platforms are: windows, minimal
this answer solved my problem.
Copying the folder platforms from python installation directory into my built folder solved the problem. the "platforms" folder contains qminimal.dll.
Maybe it helps you too!
Can you try to install Anaconda in a folder that does not use non-ascii characters?
Also, you say you have done conda update --all, but your Qt version states 5.6.0. Last week we released version 5.6.2, so conda update --all should have got that version for you.
Perhaps try conda update qt and see that it installs 5.6.2?

Installing OpenCV on Windows 7 for Python 3.2.3 [duplicate]

am trying desperately to get OpenCV to work on Windows 7. I download and installed it, and it didn't work, I got
ImportError: No module named opencv
when I tried to run one of the samples. I google my problem and got only random solutions that don't work. Can anybody guide me in installing it, or know where i can get a clear installation guide design for a programming noob.
As of OpenCV 2.2.0, the package name for the Python bindings is "cv".The old bindings named "opencv" are not maintained any longer. You might have to adjust your code. See http://opencv.willowgarage.com/wiki/PythonInterface.
The official OpenCV installer does not install the Python bindings into your Python directory. There should be a Python2.7 directory inside your OpenCV 2.2.0 installation directory. Copy the whole Lib folder from OpenCV\Python2.7\ to C:\Python27\ and make sure your OpenCV\bin directory is in the Windows DLL search path.
Alternatively use the opencv-python installers at http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv.
I have posted a very simple method to install OpenCV 2.4 for Python in Windows here : Install OpenCV in Windows for Python
It is just as simple as copy and paste. Hope it will be useful for future viewers.
Download Python, Numpy, OpenCV from their official sites.
Extract OpenCV (will be extracted to a folder opencv)
Copy ..\opencv\build\python\x86\2.7\cv2.pyd
Paste it in C:\Python27\Lib\site-packages
Open Python IDLE or terminal, and type
>>> import cv2
If no errors shown, it is OK.
UPDATE (Thanks to dana for this info):
If you are using the VideoCapture feature, you must copy opencv_ffmpeg.dll into your path as well. See: https://stackoverflow.com/a/11703998/1134940
I have posted an entry to setup OpenCV for Python in Windows:
http://luugiathuy.com/2011/02/setup-opencv-for-python/
Hope it helps.
Actually you can use x64 and Python 2.7. This is just not delivered in the standard OpenCV installer. If you build the libraries from the source (http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html) or you use the opencv-python from cgohlke's comment, it works just fine.
download the opencv 2.2 version from https://sourceforge.net/projects/opencvlibrary/files/opencv-win/
install package.
then Copy cv2.pyd to C:/Python27/lib/site-packeges.
and it should work:
import cv2
open command prompt and run the following commands (assuming python 2.7):
cd c:\Python27\scripts\
pip install opencv-python
the above works for me for python 2.7 on windows 10 64 bit
One thing that needs to be mentioned. You have to use the x86 version of Python 2.7. OpenCV doesn't support Python x64. I banged my head on this for a bit until I figured that out.
That said, follow the steps in Abid Rahman K's answer. And as Antimony said, you'll need to do a 'from cv2 import cv'
Installing OpenCV on Windows 7 for Python 2.7

Python executables: py2exe or PyInstaller?

To create executable files (windows) I assume that we should use one of them:
Py2exe or PyInstaller.
What are the difference between them?
Py2exe and PyInstaller both are wrappers but here are few differences that I noticed,
Py2exe is compatible with python2.4+ including python3.0 & 3.1 whereas PyInstaller is currently, compatible with python 2.7 and 3.3–3.5
As far I know, Py2exe didn't support signing whereas Pyinstaller has support for signing from version 1.4
In PyInstaller it is easy to create one exe, By default both create a bunch of exes & dlls.
In py2exe its easier to embed manifest file in exe, useful for run as administrator mode in windows vista and beyond.
Pyinstaller is modular and has a feature of hooks to include files in the build that you like. I don't know about this feature in py2exe.
Hope this helps you in your decision making.
[Update] - It looks like PyInstaller is actively developed (https://github.com/pyinstaller/pyinstaller/) and released. py2exe is still using sourceforge and its release cycle is very random on pypi there is no build after 2014 and their code show development in 2017 as well (https://sourceforge.net/p/py2exe/svn/HEAD/tree/trunk/py2exe-3/py2exe/). So, I recommend using pyinstaller till the time py2exe stabilizes its release cycle in favor of developers.
There is a fork of py2exe that is being actively developed to support ongoing versions of Python, https://github.com/albertosottile/py2exe, currently at v0.9.3.2 which works with Python 3.7.
I've used it on a small project and it works as expected, producing a working executable. Download the correct version from the releases page and install with pip.
Update 2020-11-06:
As per LolPython's comment, this fork now redirects to the official repo so use that instead:
https://github.com/py2exe/py2exe
From the message of the wikipedia,py2exe is not active for long time :
Stable release: 0.9.2.2 for Python 3 /; 21 October 2014; 0.6.9 for Python 2 /; 15 November 2008
So I advise to use the pyinstaller.....
But now the pyinstaller also meet the problemThe offical website of pyinstaller:
Help keeping PyInstaller alive: Maintaining PyInstaller is a huge amount of work. PyInstaller development can only continue if users and companies provide sustainable funding. See Funding PyInstaller for how to support PyInstaller.

Resources