I am having issues with PyDev not auto completing pyside correctly, I suspect that I am missing a crucial step in the installation process.
So, How does one install and configure a fresh OS X lion install to develop pyside ?
Note: This Question does NOT belong on another stack site. This is what a programmer has to do to get his machine in shape to develop python PySide using PyDev. A system administrator is unlikely to have encountered this specific issue.
I suspect you followed the various scattered documentation around and mixed different python interpreters and python tools. Also Step 4 below needs to also be done, which not many guides mention.
To get the system in a state for PySide development in line with a linux distro, where all the plumbing aligns by default you have to do the following steps:
Step 1 : install Xcode, brew, and xcode command line tools (you will find documentation for this on the brew website). Once you have Xcode and command line tools downloaded and installed the following command line should install brew.
Check everything is OK with
brew doctor
.add the path for user installed binaries to
~/.profile
or/etc/paths
with a text editor (export PATH=/usr/local/bin:$PATH
). Make sure the new path is before the$PATH
(or at the top of/etc/paths
and not after).Also, after install you want to make sure any python admin utilities that you use are picked up from the correct directory. For this add
/usr/local/share/python
to the path next to the new path you specified above. This is important because you want easy_install to be correctly functioning and installing to your version of python and not sox's, below we verify that the correct items are being picked up.Step 2: Use brew to install python2.7.*
Step 3: verify the python binary and the easy_install binary are in the correct directories. You do this by using
which
and notwhereis
.Step 4: Since OSX has the funky notion of frameworks, for library management, we have to symlink things so that other tools (such as eclipse) can auto config correctly.
Step 5: Install pyside using brew (
brew install pydev
). This also installs Qt4 as a dependency.Step 6: Install Eclipse along with PyDev
Step 7: Configure eclipse. Do not auto configure, manually add a new interpreter and supply
/usr/local/bin/python
as the python path. It should pick up the libraries automatically. Also addPySide
to the built-ins, since PySide autocompletion requires active introspection, rather than static code analysis.Step 8: install pip
easy_install install pip
Provided you use
pip
orbrew
for getting further python code, you should get things piping into the correct directories. That is till mountain lion comes along and ruins your day :Dnote to self
I Know now that dependency management is no easier in python compared to windows .net or C/C++ (CRT) GAC or Linux's soname's or java's class path. We all end of with a maze of indirections.