Installing PyQt4.11.2 on Scientific Linux 6.5 - python

I know this is probably something trivial, but I cannot seem to find the answer. I have just completed a fresh install of Scientific Linux 6.5 - which ships with Python 2.6 and Qt 4.6.2. I wish to use the Python interpreter python2.7.8 so downloaded this and installed. I use the QtDesigner for ease when making guis, so then need the PyQt bindings to go with it. I therefore downloaded SIP-4.16.3, configured with:
python2.7 ./configure (in the sip download directory)
to make the bindings for the newer version of python. Everything works fine so far.
I then try to install PyQt4.11.2 in the same way:
python2.7 ./configure --qmake=/usr/lib/qt4/bin/qmake -g (to pick up the qt4 version of qmake with static qt libraries)
the configure script completes fine, but I get the following error during 'make':
error: ‘PrintCurrentPage’ is not a member of ‘QAbstractPrintDialog’
..../Downloads/PyQt-x11-gpl-4.11.2/QtGui/sipQtGuiQAbstractPrintDialog.cpp:1787: error: too many initializers for ‘sipEnumMemberDef’
make[1]: * [sipQtGuiQAbstractPrintDialog.o] Error 1
make[1]: Leaving directory `..../Downloads/PyQt-x11-gpl-4.11.2/QtGui'
make: * [all] Error 2
I am at this point a little lost and have been bashing my head for a while, it must be something simple I have missed, any help would be great.
Thanks in advance

Search string 'PrintCurrentPage' in files of your PyQt-package. You will find it in 4 files.
Remove corresponded lines with string 'PrintCurrentPage'

I know this thread is old, but I ran into a similar error installing PyQt4.11.4 by source on a Red Hat Enterprise Linux 5 machine.
I ended up adding the members 'PrintShowPageSize = 0x0008' and 'PrintCurrentPage = 0x0040' to the class definition of QAbstractPrintDialog. This C++ class definition is located in the header file qabstractprintdialog.h. On my distribution, this was located in /usr/lib64/qt4/include/QtGui/.
After adding those missing members, I re-ran make with no compile errors.
The only reason I stumbled onto this solution was looking at this version of qtabstractprintdialog.h here. I noticed my version of the header file was missing those members in the QAbstractPrintDialog class.
I haven't put the new PyQt4 install to use yet, so I can't vouch for functionality just now. But it did compile/install!

Related

Struggling to build SIP for PyQt4

Basically, trying to build SIP so that I can install PyQt4. I manage to use
python configure.py
That is completely fine - I get the sipconfig.py file.
Problem comes when I try to build. It won't recognise make. I've tried to get Visual Studio to do it - but that just made me really confused. Any suggestions would be really good - I've tried other solutions and nothing seems to work.
So yeah, any help would be great!
You need to install MinGW , and then set your path to include mnGW and use: mingw32-make and mingw32-make install
The full detail of this process can be found in Python web manual

"R6034 An application has made an attempt to load the C runtime library incorrectly" after pygtk being installed

I'm using python 2.7.9 and encountered a problem when installing pygtk.
It displayed "Runtime error!...R6034 An application has made an attempt to load the C runtime library incorrectly" when installing numpy/scipy after pygtk being installed.
I tried to figure it out by searching it in stackoverflow and found two similar questions: Runtime error R6034 in embedded Python application and An application has made an attempt to load the C runtime library incorrectly.
So following the first one, I deleted the path corresponding to msvcr90.dll, however, it still cannot work. Then I chose to simply delete msvcr90.dll; at this time, this error wasn't presented when installing numpy/scipy, however, these two modules cannot work when simply typing "importing numpy/scipy".
I also renamed gtk-2.0 following the second one. Then numpy and scipy can be successfully installed. But it displayed "Error processing line 3 of C:\Python27\lib\site-packages\pygtk.pth" when installing matplotlib using pip.
I'm really confused about it. Can anybody provide some methods to fix it?
I've installed Python and PyGTK on 5+ machines, at least two of them brand new, clean builds of Win 7.
I've got the An application has made an attempt to load the C runtime library incorrectly error whenever I install a Python package as a windows installer (rather than using pip) on all these machines. It's annoying, but has never made a jot of difference, both Python and Gtk function correctly.
You've deleted msvcr90.dll, and that is why you get your Error processing line 3... If you look at this file, you'll see that line 3 is import runtime, and if you look further into the 'runtime' package, you'll see that this then tries to find the missing dll.
I think your best bet is to try to restore the missing file. If it's still in your recycle bin - great!
If not, the best thing to do is reinstall the Visual C++ runtime library
I made this video to show my way: https://www.youtube.com/watch?v=s6jhR1VBfeU. I use Anaconda to embedded Python in my C++ application. I simply changed "msvcr90.dll" to "msvcr90.dll_hihi" in 3 folders:
C:\Users\your user\Anaconda2\Library\bin, C:\Users\your user\Anaconda2 and C:\Program Files\Intel\iCLS Client (for x64)

Sphinx Extensions (numpydoc)

NOTE Added After: I finally got numpydoc working. It was also a python 2 problem. I ran 2to3 on it and now it seems to be working.
OK, I've spent an entire day trying to get any Sphinx extension to work and am now hoping someone could point out what I'm doing wrong. (Sorry this is a bit long, but maybe more info will help you quickly find the error of my ways).
Sphinx seems to be working as advertised, but I would like to use NumPy style documentation so thought I'd install numpydoc. In case it matters, I'm using Python 3.3 (winpython 64 bit on windows 7). I started with the directions here but got the error:
Extension error:
Could not import extension numpydoc (exception: cannot import name setup)
Googling that I found that some people got around it by using numpydoc.numpydoc No dice. I made sure everything possibly relevant was in my path (as well as added into sys.path in sphinx's conf.py file). I even tried copying numpydoc into sphinx's ext folder and changing the extension string accordingly, still no luck.
At this point I gave up on numpdoc and decided to try napoleon. Following the installation directions I just pip install sphinxcontrib-napoleon and then should be good to go. But alas, no, as napoleon seems to be in 2.x not 3 (though the egg says Sphinx-1.1.3-py3.3.egg-info and during installation it says it is installing sphinxcontrib_napoleon-0.2.1-py3.3-nspkg.pth. None-the-less, lots of python 2 code. I tried converting it with 2to3 but then I get a recursion too deep error.
So, I decide to see if I am capable of installing any extension to sphinx. I essentially at random pick findanything. Install it as requested and it also fails, this time because of a relpath error (ValueError: path is on mount 'C:', start on mount 'D:'). Which I guess means that it is unhappy that my python installation is on C but my code I'm trying to document (and where I'm trying to run sphinx) is on D (and that I'm running Windows).
So, did I just happen to pick 3 troubled extensions? Or, if not, what am I doing wrong and (more importantly) how can I do it right so that I get this working?
PS I'm completely new to Python so please don't assume that I'm not making an incredibly stupid and basic error.
Old thread, however...
If you are using Ubuntu 20+, don't install numpydoc via pip. Use
apt install python3-numpydoc
instead. Many of the sphinx packages need to be installed this way going forward.

Can't install pywin32..?

I tried to install pywin32 via the 32 bit python 2.6 msi installer and got this error:
I have no idea why, so I went and installed python 2.7 and tried again with the pywin32 2.7 installer and got an error that amounted to another error (Sorry for not being more specific, but python 2.7 is now gone from my computer. The error was incredibly vague and had "Error:" and then no more text after it if I recall correctly).
I can't figure out what this error means, however. I wanted to use pyinstaller but it requires pywin32, so after I couldn't install pywin32 I tried py2exe and got this error:
*** finding dlls needed ***
error: pywintypes26.dll: No such file or directory
So I'm pretty sure I need pywin32. Anyone have any ideas?
I don't know the cause, but I got the same error (only with different line numbers, maybe from a different version of pywin32), and this fix worked for me, installing on windows 7:
Extract the installer file to a directory using the free 7zip (or similar) program
Copy everything in the PLATLIB directory to C:\Python26\Lib\site-packages
Open a command prompt to the SCRIPT directory and type:
python pywin32_postinstall.py -install
You must have Python already installed (perhaps obviously) and in your windows PATH environment variable for this to work. You can also try the testall script in that PLATLIB directory (though for me, that hung). After doing this, I was able to import pywin32 modules from the Python IDLE just fine.
(Trying to run the installer in compatibility mode didn't solve this for me.)
I did the following and worked for version 2.7 (I did not try 3.0 and up, but it should work too):
Move the .exe file into the platlib (C:\Python27\Lib\site-packages)
Run as admin the .exe file and you should be Good :)
If you want to check if it worked just do: import win32api and run it.
As of when I wrote this (Feb'12), IMO Python 2.5 is the most stable version of Python on Windows. I suggest you try re-installing everything on Python 2.5. I use it on Windows 7 and I don't have any issues whatsoever

Problems building node.js on Cygwin, please help

I'm trying to get node.js running on Windows 7. I have no experience with Linux so I've just been blindly following instructions from tutorials I've found, but I'm still unable to build node.js.
What I did:
Install Cygwin - the entirety
Attempt to build node.js
This is the error I first got:
I then followed the commands of two other similar sites and they all resulted in this error (could getting several version of node have caused me more problems? I'm completely clueless on this).
I read somewhere that the Windows version of Python could be causing the problem so I uninstalled my Python 2.7 and added C:\cygwin\bin to the PATH.
That still didn't work and I read somewhere else that I'm supposed to rebaseall so I tried that, but I also got an error for that:
That's where I'm at now. Have any steps I've taken exacerbated the situation?
Add -e '/\/sys-root\/mingw\/bin/d' at line 110 in /bin/rebaseall file.
Then re-run rebaseall -v and you shouldn't get the error anymore.
See this pretty helpful blog posting - Node on CygWin doesn't work for Node v0.2.5. Use the latest v0.4.0 version instead.
Also consider the post's recommendation of compiling against MinGW instead of in CygWin.
First of all, why did you check out such an old release v0.2.5? When I did it a few weeks ago I just took the latest and ended up with 0.5.0pre, but it would also be reasonable to specify v0.4.3. For instance, type git clone git://github.com/joyent/node.git to download node, and then:
cd node
./configure
make install
Secondly, do not rebase by running ash from the CYGWIN shell. Instead, shutdown all Cygwin processes, then use Windows explorer to open the ash.exe binary. Since I have a Windows 7 system without node.js, I decided to follow my instructions and build. Not so easy. I ran into some wierd dll issues that all went away when I ran ./rebaseall followed by ./perlrebase from the ash prompt. It seems that rebaseall is not sufficient anymore.
Thirdly, there is a message that makes it sound like you don't have a C compiler. Some googling will lead you to sites telling which Cygwin packages you need, but at minimum install the g++ compiler and that should pull in C as a dependency.
When I did this I simply ran configure and every time there was an error, installed one more Cygwin package to supply the missing piece. Even OpenSSL is available.
What I just found is remove the windows based install of Python. After uninstalling this, everything is peachy.
I like cygwin a lot -- but recent releases have become pretty unreliable. Some packages just wont build, and some "standard" apps dont work e.g. gvim's "save as" bombs out on my installation.
A possible solution would be run one of the better Linux distributions (ubuntu, fedora, suse etc.) either as a virtual machine or a dual boot setup and do the build inside linux.

Categories

Resources