Install pyside from python3 on os x

I tried installing pyside along with python3 on osx mountain lion. I tried both

brew install pyside 

But then it only works in python2.

I also tried using buildscripts from pyside github rep. Necessary changes

 ./build_and_install 

however, with

 Linking CXX shared library libpyside.cpython-33m.dylib [ 4%] Built target pyside [ 4%] Running generator for QtCore... /bin/sh: /Users/einar/devel/pkg/pyside-sandbox-python3/bin/SHIBOKEN_GENERATOR-NOTFOUND: No such file or directory make[2]: *** [PySide/QtCore/PySide/QtCore/qabstracteventdispatcher_wrapper.cpp] Error 127 make[1]: *** [PySide/QtCore/CMakeFiles/QtCore.dir/all] Error 2 make: *** [all] Error 2 

I do not know what to do now. I found this pyside forum page , suggesting that I only had to symbolize some things to make it work in python3 after doing brew install pyside , but /usr/local/Cellar/pyside/1.1.2/lib only has files named 2.7 .

Could anyone get pyside to work with python3 on osx or find out some kind of guide on how to do this? My google-fu is failing.

+3
source share
3 answers

This has been fixed in Homebrew ( see wiki ). Install Pyside with

 brew install pyside --with-python3 

will install it for both Python 2 and Python 3. For this, you may need to first remove the shiboken and pyside if they are already installed for Python 2.

+5
source

Perhaps in this case do not use homebrew and do

 pip3 install pyside 

? Assuming you brewed python3.

Edit: not working. This is probably the reason why there is a homegrown formula.

+2
source

It should be mentioned that you can use homegrown with slight modifications.

  • brew change pyside
  • Modify who_python to just return "python3.3" (or whatever version you are using)
  • Add CMAKE flag -DUSE_PYTHON3 = 1
  • Save and exit
  • brew change shiboken
  • Change python_prefix as python3.3-config --prefix
  • Change python_version as python3.3-config --libs
  • Change who_python to return "python3.3"
  • brew remove pyside shiboken
  • brew install pyside
  • python3 -c "from import PySide.QtGui *"
  • Basque in glory.

Attention! This can cause conflicts if pyside is also installed for python2. There is an active development of this problem for both pyside and pyqt. See https://github.com/mxcl/homebrew/pull/18588

+1
source

Source: https://habr.com/ru/post/919889/


All Articles