I'm having a problem installing python packages and I think it has to do with the fact that I apparently have 4 Python directories. I can download and install them without a problem using pip... but when trying to import them in an IDE they don't appear.
Any help would be appreciated and I should say that I'm a complete beginner.
That's a really tricky issue specific to OS X, and also hard to fix. The root cause is the fact the GUI apps and console apps do not share the same environment (with things like PATH and PYTHONPATH).
Read https://stackoverflow.com/a/588442/99834
I'm building a project that depends on pyqt (e.g. VTK with pyqt). I'm getting an error like QtCoremod.sip: No such file (or something similar). What's going wrong?
In Ubuntu, package python-qt4-dev was missing. I installed it and it fixes the problem.
This can be caused if you have multiple installations of sip on your system and the pyqt configure script found the wrong one. It searches your $PATH environment variable to locate sip, and that determines where to place the sip output files for pyqt.
One solution is to manually specify the sip installation locations via options to the pyqt configure.py script. (That is, ./configure.py --sip=[...] --sip-incdir=[...] --sipdir=[...] etc.)
Another option is to make sure that your intended python and sip binaries are found on your $PATH before any others that may exist on your system. Make sure your PATH is set correctly.
For details, see the pyqt installation documentation:
http://pyqt.sourceforge.net/Docs/PyQt4/installation.html
Years later, same problem, Ubuntu 20.04, but the file is now called,
pyqt5-dev
In Ubuntu, package python-qt4-dev was missing. I installed it and it
fixes the problem.
This is something I've been researching for past few hours but so far nothing come out of it.
Basically I have software that use Python 2.5.5. It does not have QT module in it.
So in my attempt to install it I did this.
Downloaded executable QT PyQt4-4.10.2-gpl-Py2.7-Qt4.8.4-x64. Run Exe. It installed in python 2.7 site-packages.
Then I moved that folder to my software Python 2.5.5. Now there was no site-packages folder so I created it.
Next step was to go over this instruction http://docs.python.org/2/install/ and use Alternate installation: Windows (the prefix scheme) with my file location from inside program. But I cant run python setup.py install --prefix="\Temp\Python" (with my location of python) because python is not defined and so on. I'm pretty sure thats the wrong way to do it. So how or where do I look for information as to how to do it? The software itself dont have any documentation.
Thanks, bye.
That binary version of PyQt4 only supports python2.7, so no matter what you do, you won't get it to run with python2.5.
The last PyQt4 version with a binary for python2.5 is PyQt4.9.4, so if you want to have any chance of making this work you should try with this version.
Note however that the software you distribute like this will also only run on python2.5.
some months ago, I installed Python 2.7 on my laptop (my os is Windows 7).
After, I decided to use Python xy 2.7.3 instead of 'pure' Python; so, as suggested, I removed Python 2.7 and tried to install Python xy 2.7.3. However, when I tried to run the .exe file for installation, a warning window appears telling me that Python 2.7 is already installed on my computer. I tried to install a different version of Python xy (2.6) and everything went fine; however, I'd really prefer to use the latest version of Python xy.
Actually, I can't figure out what went wrong whie uninstalling Python 2.7; does someone have any clue?
I can tell you that I followed the 'normal' procedure for programm uninstalltion; control panel -> Programs -> Remove Program
Thanks in advance
Stefano
Run regedit, backup and delete the registry keys:
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_CURRENT_USER\Software\Python
My problem occurred when changing from Canopy to Python(x,y).
So, also delete all folders that are left behind when uninstalling.
https://support.enthought.com/entries/23580651-Uninstalling-Canopy
I also had this issue as well. It was due to third party installs. Even though you have uninstalled python, it leaves all the third party libraries that were installed and I think Python(x,y) just detects the directory.
To fix, uninstall Python 2.7 and then check to see if C:\Python27 still exists. If it does, go ahead and delete and then try installing Python(x,y). That is what worked for me.
I faced this issue: I tried to uninstall the python and fresh install, reason my pip version issue was not getting resolved. So I deleted the python folder, removed python from system path, and when I tried to uninstall from "Uninstall a program" in control panel, it showed "Windows installation package" error window and could not clean uninstall.
Solution what i found was: In the "Uninstall a program" select python and click repair. And then uninstall the python, it worked for me. Hope this helps and save some time.
PS: I am pretty new to python, and any help correcting me would be appreciated.
Maybe to put an answer out there.
Uninstalling anything from windows can have multiple side effects residing completly on your specific machine. As to what is common:
-> Python sets itself in your windows path. Here is how to modify your windows path: http://www.computerhope.com/issues/ch000549.htm
It means that there is a probability that python is gone but the path entry might not be. That is a guess however -> more information needed
-> Are you sure that everything was removed from your computer? If you already did the normal uninstalling process - try to look up if any python directory is still present.
-> Thirdparty installed? Have you downloaded any libs that are still on your machine.
Besides from that - it could be anything - the more information you give us the more we can say about it.
Maybe this post will help you: How to completely remove Python from a Windows machine?
I had python 2.7.12 and wanted to uninstall it for 2.7.9. I had the same problem as you and to fix it I tried to delete all of the local files and then uninstall however it still gave me the same error. So instead I decided to repair the python 2.7.12 and then uninstall which worked perfectly and completely got rid of the error.
I had python 2.7 installed and enthought canopy. I wanted to switch to python(x,y) to access a full version of the OpenCV library. python(x,y) installation complained about python 2.7 already being installed after:
1)Using windows control panel
2)Removing all lingering python files
3)Removing the windows path as suggested above
Not until I removed all registry entries related to python/enthough did python(x,y) install without issue.
I installed Enthought before. When I wanted to install Python(x,y) instead, I met the problems above.
After I had tried to uninstall Enthought and Python(x,y) from the Control Panel and then restart the PC, the problem still occured the next time I installed Python(x,y).
I solved this problem by:
deleting all the relevant files in C:/User/UserName/AppData/ about Python, including the third party softwares like Enthought;
deleting the Path in user and system Environment;
=====the two steps were failed if I didn't do the third step.=====
deleting the register keys as #Daniel said. (include all the relevant keys with the prefix py if you installed the third party software about Python. )
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_CURRENT_USER\Software\Python
Locate that set up file which was used to install Python. Run it and choose repair. If that doesn't solve the problem. Go to c:\Python(x,y) and delete this folder completely by shift+Del.
Run that set up file again and click on "Change" which will ultimately install the Python again. By default in my case option to add path and making that version of Python the default on my system was unchecked which can be figured out by seeing the red cross mark in one of the installation screen. Click on it if you want set up to make it default Python version and also click on the option to indicate you want the path to be added in windows environment variable.
No need to touch registry as previous ones will be overwritten again.
In my case it worked. I was getting error like:
Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can't find encoding
Besides that un-installation was failing from control panel. So above steps solved all of my problem. Hope it helps.
I Repaired/Modified to install all the components for the Python
version I wanted to uninstall.
Once that was done, I clicked on Uninstall/Change and that uninstalled it for good.
I have python 2.6 installed on my Windows 7 OS. I can run the python command from the command line and I enter into a python interpreter. Now I want to install the pygtk modules. In the past I have installed GTK+, PyGTK, PyCairo and PyGObject separately and got everything to work. I would like to use the all-in-one installer provided on the pygtk website. I downloaded the version from python 2.6 and the installation completed successfully.
However import gtk and import pygtk still give me the ImportError: No module named .... Does anyone know a trick to get this "all-in-one" installer to work?
Please see my answer to the post here. Bottom line is I couldn't get the all-in-one installer to work for windows 7, but I DID get pygtk running by following the instructions given in that post.
I am a dummy for installing the NOT all-in-one-package, (Perhaps confusingly) the one listed top on the pygtk download page (pygtk-2.24.0.win32-py2.7.exe) to which the link on the description points is the wrong installer (i.e. NOT the all in one installer).
When I corrected my mistake and used the pygtk-all-in-one-2.24.2.win32-py2.7.msi installer, everything worked just fine! Perhaps this is what happened to jeffery_the_wind too...
The all in one installer works. Try the following link:
pygtk-all-in-one-2.24.2.win32-py2.6.msi
On the PyGTK downloads page, clicking on the all-in-one installer link directs you to listing of PyGTK installation binaries. Perhaps you downloaded and installed the 'pygtk-2.24.0.win32-py2.6.msi' binary which is at the top of the listing (and probably shouldn't be here) but doesn't work.
I don't know if this can help, but it may be the solution as it once was for me years ago under XP :
The all-in-one installer installs PYgtk, PYcairo, ... and allsort PYstuff, but DOES NOT install GTK+ itself.
I had to download the GTK library separately, unzip it in some folder (say "C:\GTK"), and ADD that folder in the system path, and there it was fixed !
(there is an all-in-one bundle for GTK : http://www.gtk.org/download/win32.php)
Hope this was helpful.