pyside / PySide

ATTENTION: This project is deprecated, please refer to PySide2
https://wiki.qt.io/PySide2
GNU Lesser General Public License v2.1
291 stars 66 forks source link

PySide does not install properly into a VirtualEnv #122

Closed autumnjolitz closed 10 years ago

autumnjolitz commented 10 years ago

I tried launching ipython qtconsole

Predictably, I got an error that required me to pip install pyside inside of my virtualenv.

Then I got this on attempting to load the console (which imported QtGui):

ImportError: dlopen(/Users/bjolit/.virtualenvs/cpython27/lib/python2.7/site-packages/PySide/QtGui.so, 2): Library not loaded: libpyside-python2.7.1.2.dylib
  Referenced from: /Users/bjolit/.virtualenvs/cpython27/lib/python2.7/site-packages/PySide/QtGui.so
  Reason: image not found

I changed the iPython loader effectively do this:

def import_pyside():
    cwd = os.getcwd()
    import PySide
    os.chdir(os.path.dirname(os.path.abspath(PySide.__file__)))
    from PySide import QtGui, QtCore, QtSvg
    os.chdir(cwd)
    return QtCore, QtGui, QtSvg, QT_API_PYSIDE

And it would work.

Apparently there is an error in QtGui.so that rpath is suppose to solve, but isn't. Bug?

This is on MacOSX on a VirtualEnv.

Example:

(cpython27) bjolit@BJOLIT1013mac:[~]$ python
Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PySide import QtGui, QtCore, QtSvg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/bjolit/.virtualenvs/cpython27/lib/python2.7/site-packages/PySide/QtGui.so, 2): Library not loaded: libpyside-python2.7.1.2.dylib
  Referenced from: /Users/bjolit/.virtualenvs/cpython27/lib/python2.7/site-packages/PySide/QtGui.so
  Reason: image not found
>>> ^D
ctismer commented 10 years ago

Did you run the pyside_postinstall.py script, which is necessary (still) if you are not on windows?

Sent from my Ei4Steve

On Aug 8, 2014, at 22:38, Benjamin Torsten Jolitz notifications@github.com wrote:

I tried launching ipython qtconsole

Predictably, I got an error that required me to pip install pyside inside of my virtualenv.

Then I got this on attempting to load the console (which imported QtGui):


Referenced from: /Users/bjolit/.virtualenvs/cpython27/lib/python2.7/site-packages/PySide/QtGui.so
Reason: image not found

I changed the iPython loader effectively do this:
def import_pyside():
cwd = os.getcwd()
import PySide
os.chdir(os.path.dirname(os.path.abspath(PySide.file)))
from PySide import QtGui, QtCore, QtSvg
os.chdir(cwd)
return QtCore, QtGui, QtSvg, QT_API_PYSIDE

Apparently there is an error in QtGui.so that rpath is suppose to solve, but isn't.
—
Reply to this email directly or view it on GitHub.
autumnjolitz commented 10 years ago

No, I installed using PIP + wheels.

Which normally should run all post installation scripts.

Ben

On Aug 8, 2014, at 2:11 PM, Christian Tismer notifications@github.com wrote:

Did you run the pyside_postinstall.py script, which is necessary (still) if you are not on windows?

Sent from my Ei4Steve

On Aug 8, 2014, at 22:38, Benjamin Torsten Jolitz notifications@github.com wrote:

I tried launching ipython qtconsole

Predictably, I got an error that required me to pip install pyside inside of my virtualenv.

Then I got this on attempting to load the console (which imported QtGui):


Referenced from: /Users/bjolit/.virtualenvs/cpython27/lib/python2.7/site-packages/PySide/QtGui.so 
Reason: image not found 

I changed the iPython loader effectively do this: 
def import_pyside(): 
cwd = os.getcwd() 
import PySide 
os.chdir(os.path.dirname(os.path.abspath(PySide.file))) 
from PySide import QtGui, QtCore, QtSvg 
os.chdir(cwd) 
return QtCore, QtGui, QtSvg, QT_API_PYSIDE 

Apparently there is an error in QtGui.so that rpath is suppose to solve, but isn't. 
— 
Reply to this email directly or view it on GitHub.
—
Reply to this email directly or view it on GitHub.
ctismer commented 10 years ago

"""Which normally should run all post installation scripts. ""' Sorry, this is not true.

PIP + wheels exactly does not run the postinstaller for PySide. The exception is windows, because there no postinstall is required. On a Mac this does not work.

Chris

On 09.08.14 04:28, Benjamin Torsten Jolitz wrote:

No, I installed using PIP + wheels.

Which normally should run all post installation scripts.

Ben

On Aug 8, 2014, at 2:11 PM, Christian Tismer notifications@github.com wrote:

Did you run the pyside_postinstall.py script, which is necessary (still) if you are not on windows?

Sent from my Ei4Steve

On Aug 8, 2014, at 22:38, Benjamin Torsten Jolitz notifications@github.com wrote:

I tried launching ipython qtconsole

Predictably, I got an error that required me to pip install pyside inside of my virtualenv.

Then I got this on attempting to load the console (which imported QtGui):

dlopen(/Users/bjolit/.virtualenvs/cpython27/lib/python2.7/site-packages/PySide/QtGui.so,
2): Library not loaded: libpyside-python2.7.1.2.dylib
Referenced from:
/Users/bjolit/.virtualenvs/cpython27/lib/python2.7/site-packages/PySide/QtGui.so

Reason: image not found

I changed the iPython loader effectively do this:
def import_pyside():
cwd = os.getcwd()
import PySide
os.chdir(os.path.dirname(os.path.abspath(PySide.file)))
from PySide import QtGui, QtCore, QtSvg
os.chdir(cwd)
return QtCore, QtGui, QtSvg, QT_API_PYSIDE

Apparently there is an error in QtGui.so that rpath is suppose to
solve, but isn't.
—
Reply to this email directly or view it on GitHub.
—
Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/PySide/PySide/issues/122#issuecomment-51674647.

Christian Tismer :^) tismer@stackless.com Software Consulting : http://www.stackless.com/ Karl-Liebknecht-Str. 121 : http://www.pydica.net/ 14482 Potsdam : GPG key -> 0xFB7BEE0E phone +49 173 24 18 776 fax +49 (30) 700143-0023

autumnjolitz commented 10 years ago

I just examined https://github.com/PySide/pyside-setup/blob/master/pyside_postinstall.py

Please close this "bug" out as invalid.

Thank you for your time.

I'm deinstalling this package and I'll look into using CFFI instead to avoid modifying shared libraries.

ctismer commented 10 years ago

I can't follow you why you think you need to avoid modifying shared libraries? That is what all installers do in the end, more or less, and there's nothing wrong with it. There is only the library changed that you just installed, to make it work.

Installing PySide to a virtualenv works fine. What is not ok for you?

autumnjolitz commented 10 years ago

The last time I manually corrected corrupted/incorrect rpaths was in compiling QT using homebrew (miscompilation). That was fixed by an awesome developer (hats off to him) and post-install correction of the libraries was no longer necessary.

I originally assumed this report was a miscompilation bug, like the QT one I noted above. That was my error. Sorry for wasting time.

Again, thank you for your assistance.

On Aug 9, 2014, at 10:14 AM, Christian Tismer notifications@github.com wrote:

I can't follow you why you think you need to avoid modifying shared libraries? That is what all installers do in the end, more or less, and there's nothing wrong with it. There is only the library changed that you just installed, to make it work.

— Reply to this email directly or view it on GitHub.