I'm relatively new to Python programming, so apologies in advance if this question seems stupid. I'm trying to download a new Python editor (drpython) that is written with wxpython. I have Python 3.4.1 64-bit on a Windows 8.1 machine.
I was under the impression that wxpython was bundled into the standard library in Python 3, yet whenever I try to use applications that utilize it I get a 'can't import' error. On the wxpython website, it seems they only have downloads for Python 2.
Is wxpython not supported on Python 3.4? Has anyone else had trouble using wxpython with Python 3.4?
wxPython is not part of Python. You may be thinking of Tkinter, a UI toolkit that is included with Python. Currently, wxPython is only supported on Python 3 via the Phoenix project. At the time of this writing, Project Phoenix has the core wxPython widgets ported, but much of the 3rd party widgets are not.
As already mentioned, you can read about Phoenix here:
http://wiki.wxpython.org/ProjectPhoenix
You need the latest version of pip to install a wheel. Make sure you have the latest. Once you do, you can do something like this to install wxPython Phoenix:
pip install -U --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
See also:
https://groups.google.com/forum/#!searchin/wxpython-dev/pip$20install/wxpython-dev/LmGIrQyh7jc/_qe3FiVJv1MJ
Before python3 - wxPython.
From python3 onwards - wxPython_Phoenix. (new version of wxPython)
When wxPython is used on Python3 it gives import errors. Command given by
Mike Driscoll in answer above works but small update is with https.
pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
Related
I was trying to install PyQt 5.9 but I have no idea what I'm doing. According to what I've seen I have to download Qt from:
https://qt-project.org
and then SIP (whatever that is...) and PyQt from:
http://www.riverbankcomputing.com
I did all that and Qt weights like 30 Gb...
Now I have to install pyqt but the README.md file says this:
'''INSTALLATION
Check for any other README files in this directory that relate to your
particular platform. Feel free to contribute a README for your platform or to
provide updates to any existing documentation.
The first step is to configure PyQt5 by running the following command.
python configure.py
'''
And I have no idea what to do now, I keep getting the 'no such file/directory found' error.
I went to the directory where I have python installed and I still get the same.
-
I have a Mac and python 3.6
Turns out I have Qt 5.8 already installed, and since I just downloaded 5.9 I'd like to upgrade it but I don't know how. And maybe it's taking up another 30Gb somewhere else.
Also, when I type 'which python' I get 'anaconda/bin/python' and not python 2.7, how do I fix that? also I went to the dir where I have python and have python 2.4, 2.5 and 2.7. Should I just delete the others? and what is SIP??
Check these steps
Go to the QT website and download it.
Install python on your pc,
If it's Linux: sudo apt-get install python3.6
Or see this link.
Install also some IDLE to work on, I'd recommend you to use PyCharm
You can install now your PyQt through your Pycharm, see in here, find for pyqt5.
There is always the option to install through pip3, try to use pip3 instead of pip, since you are using python3.
After having pip3, try now to install your pyqt5. Check it out.
Now you have an IDLE to work on with PyQt and Qt in your machine, maybe you have to say in your PyCharm that you will use python3.6 as your interpreter.
so, i want to learn python and looking around for python IDE, i already have PyCharm but i also want to be able to make GUI so i download eric IDE
eric IDE need these prerequisites to install
Python 3.1.0 or better
Python 2.6.0 or better
Qt 5.3.0 or better (from Digia)
Qt 4.10.0 or better (from Digia)
PyQt 5.3.0 or better (from Riverbank)
PyQt 4.10.0 or better (from Riverbank)
QScintilla 2.8.0 or better (from Riverbank)
i already download them all and able to install python 2.7 but i don't understand how to install the other, the only guide i found is only for win xp or linux.
I just went through this process on Windows 7, so hopefully I can help you.
If you are running Windows7, get the following:
1) Python 2.7.0 link (11 was the version I used) amd64 - I got bit by this. When you follow the download link on the eric website, click on the version number instead of the download link. This will give you the option of downloading the x64 version.
2) PyQT 4.10 link -You will want to get this version if you are using python 2.7.x. There are no 5.x builds for Python 2.7. When looking to download the binaries (unless you want to compile), pay close attention to both the x64/x32 and the Py[ver] the link is for.
Note, it is important that both Python and PyQt be in sync for x32/x64 or Eric will not compile. It is also important to note that PyQt is Python version sensitive. PyQt 5.3.x is currently only built for Python 3.3.x, not Py 2.3x. PyQt 4.10.x has been built for both Py 2.7.x and Py 3.3.x
3) The Eric Zip, uncompressed, in a writable directory for the user.
Install Python first, followed by PyQt (It installs in the Python Directory), and then run the install.py from the root directory of eric. Watch the cmd window carefully since it will give you some useful information if things don't work.
If you're on Windows, you can get binary packages from the PyQt4 download page that will install everything except Python and Eric.
Ignore the source packages at the top of the page - scroll down to where the Windows exe installers are and make sure you pick the right one for the version of Python you want to use (2.7 or 3.4) and the platform you're on (32bit or 64bit).
You don't need any of those other downloads. Since you already seem to have Python installed, all you need to do is run the PyQt4 installer, and then run the Eric installer.
There is also a PyQt Wiki which you might find helpful if you're just getting started.
Python 3.4.4 may be a better choice than 2.7 in the long run.
For other stuff. this page may be helpful:
http://techattitude.com/tips-tricks-and-hacks/how-to-install-eric6-ide-for-python-on-windows/
It is not that easy to install eric6 on Windows 8.1 x64.
Python 3.5.1 x64 installs in \appdata\local\programs\python\python35.
Pyqt5.5.1 x64 does not detect python 3.5 and it is only built for python 3.4, and starts to drop a folder called C:\python34.
Further googling provided no help, only this stackoverflow question.
How can I download wxPython 3 on windows?
I see this link but it has .egg extension, and not exe. Ive given up on pyQT because of the lack of advanced tutorials for PyQT4, and I really would like a good libaray i can build GUI's from in Python. Ive read that wxpython 3 is compatible with the wxpython 2 api.
I cant find any good online tutorials for installation. Im using Python 3.3.2, Any suggestions? Thanks!
wxPython does not yet officially support Python 3. However, if you unpack the .tar.gz in a directory and run c:\Python33\python.exe setup.py install or equivalent on your system, it should install just fine.
However, beware that some parts of the library may not work on Python 3 yet.
Note: Tested with wxPython_Phoenix-3.0.1.dev75711.tar.gz.
To install wxPython for py3k (Phoenix) on windows.
First install setuptools.
This creates easy_install.exe in your Python Scripts folder.
Then download Phoenix.
For example: wxPython_Phoenix-3.0.1.dev75783-py3.3-win32.egg
Put the downloaded egg file somewhere.
For example in C:\Python33\
Open the console, go to C:\Python33\Scripts
run:
C:\Python33\Scripts>easy_install.exe C:\Python33\wxPython_Phoenix-3.0.1.dev75783-py3.3-win32.egg
Phoenix will install
My Idle is throwing errors that and says tkinter can't be imported.
Is there a simple way to install tkinter via pip or easy_install?
There seem to be a lot of package names flying around for this...
This and other assorted variations with tkinter-pypy aren't working.
pip install python-tk
I'm on Windows with Python 2.7 and I don't have apt-get or other system package managers.
The Tkinter library is built-in with every Python installation. And since you are on Windows, I believe you installed Python through the binaries on their website?
If so, Then most probably you are typing the command wrong. It should be:
import Tkinter as tk
Note the capital T at the beginning of Tkinter.
For Python 3,
import tkinter as tk
If you are using virtualenv, it is fine to install tkinter using sudo apt-get install python-tk(python2), sudo apt-get install python3-tk(python3), and and it will work fine in the virtual environment
Well I can see two solutions here:
1) Follow the Docs-Tkinter install for Python (for Windows):
Tkinter (and, since Python 3.1, ttk) are included with all standard Python distributions. It is important that you use a version of Python supporting Tk 8.5 or greater, and ttk. We recommend installing the "ActivePython" distribution from ActiveState, which includes everything you'll need.
In your web browser, go to Activestate.com, and follow along the links to download the Community Edition of ActivePython for Windows. Make sure you're downloading a 3.1 or newer version, not a 2.x version.
Run the installer, and follow along. You'll end up with a fresh install of ActivePython, located in, e.g. C:\python32. From a Windows command prompt, or the Start Menu's "Run..." command, you should then be able to run a Python shell via:
% C:\python32\python
This should give you the Python command prompt. From the prompt, enter these two commands:
>>> import tkinter
>>> tkinter._test()
This should pop up a small window; the first line at the top of the window should say "This is Tcl/Tk version 8.5"; make sure it is not 8.4!
2) Uninstall 64-bit Python and install 32 bit Python.
When installing make sure that under Tcl/Tk you select Will be installed on hard drive. If it is installing with a cross at the left then Tkinter will not be installed.
The same goes for Python 3:
When you install python for Windows, use the standard option or install everything it asks. I got the error because I deselected tcl.
I came here looking for an answer to this same question and none of the answers above actually answer the question at all!
So after some investigation I found out:
there is a package (for python 3.x at least):
pip3 install pytk
The problem is, it is only the python part of the equation and doesn't install the tkinter libraries in your OS, so the answer is that you can't install it completely via pip
https://tkdocs.com/tutorial/install.html
Personally I find this very annoying as i'm packaging a python application to be installed via pip that uses tkinter and I was looking for a way to have pip ensure that tkinter is installed and the answer is I can't I have to instruct users to install it if it's not installed already, a very poor experience for end users who should not need to know or care what tkinter is to use my application.
Had the same problem in Linux. This solved it. (I'm on Debian 9 derived Bunsen Helium)
$ sudo apt-get install python3-tk
In python, Tkinter was a default package, you can repair the installation and select Tcl/Tk. When you run this, DDL should be installed like so:
I'm posting as the top answer requotes the documentation which I didn't find useful.
tkinter comes packaged with python install on windows IFF you select it during the install window.
The solution is to repair the installation (via uninstall GUI is fine), and select to install tk this time. You may need to point at or redownload the binary in this process. Downloading directly from activestate did not work for me.
This is a common problem people have on windows as it's easy to not want to install TCL/TK if you don't know what it is, but Matplotlib etc require it.
I was trying to upgrade my tkinter from the python built-in and found this method useful:
conda install -c anaconda tk
I had the similar problem with Win-8 and python-3.4 32 bit , I got it resolved by downloading same version from python.org .
Next step will be to hit the repair button and Install the Tk/tkinter Package or Just hit the repair.
Now should get Python34/Lib/tkinter Module present.
The import tkinter should work ..
Easiest way to do this:
cd C:\Users\%User%\AppData\Local\Programs\Python\Python37\Scripts>
pip install pythonds
Inside cmd, run command pip install tk and Tkinter should install.
if your using python 3.4.1 just write this line from tkinter import * this will put everything in the module into the default namespace of your program. in fact instead of referring to say a button like tkinter.Button you just type Button
I've been trying to connect opencv and python in both Ubuntu and Windows XP. I've failed on both.
I've read many webpages and threads about "how to install" it but none has worked (the worst part is that they all say kind of the same).
Steps (windows xp):
Installed Python 2.7 by default (works perfectly)
Installed PIL and cx_Freeze (may they
create a conflict? I don't think so
:s)
Installed Opencv 2.2 by default
(OpenCV-2.2.0-win32-vs2010.exe) and
it isn't recognized inside a py nor
as import opencv.cv nor using the
cookbook way, import cv (I skipped
the visual studio steps since I'll
use it with python)
Checked path (it's ok, it has the
Opencv2.2\bin thing)
Rechecked webpages and stuff
Steps (ubuntu):
Had python working
sudo apt-get install, cmake, make,
sudo make install, etcetc (from the
tutorials)
same thing... module not recognized
Please can you help?
Update:
I managed to install it and have it recognized by the system (I used http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv and it worked perfectly after that).
The problem now is that it crashes when I try to use CaptureFromFile. Someone else has reported it 3 days ago so now I wait.
I'll check the other wrappers, maybe one of them will work.
For windows see my web page: http://www.modernmind.org/wiki/OpenCV
For Ubuntu you should just need to apt-get install python-dev then generate the make files with Cmake, build it and then make install. In order to build the python bindings you need to have the python header files on your system and you probably don't. When you run configure in Cmake make sure that you don't see any messages at the top about PYTHON_INCLUDE not being defined.
To access a library it needs a Python library installed in the Python version you are using. From what you write above it seems to me that you install OpenCV in general, but that you don't specifically install the Python library. This is why it doesn't work.
I'm not sure how to install the Python wrappers, and the OpenCV documentation is a bit sparse on that info. But if you did build them (and that needs to be turned on explicitly, says the docs) they seem to end up in opencv/release/lib .
Look at "Testing Python wrappers" on http://opencv.willowgarage.com/wiki/InstallGuide
If there is still no luck, there is a bunch of alternative Python wrappers available: http://pypi.python.org/pypi?%3Aaction=search&term=opencv&submit=search
Maybe they are better documented.