public
Last active

Installing EPD 7.0 + ETS on OSX x64 + virtualenv

  • Download Gist
00README
1 2 3 4 5 6 7 8
Please note that this gist applies to EPD version 7.0 and 7.1. EPD 7.1 includes ETS
but not completely on OSX x64. Furthermore a patch has been submitted for inclusion
in virtualenv that should resolve the virtualenv issue.
 
The notes below were compiled for 7.0 and will need to be replaced with corresponding
7.1 paths.
 
https://github.com/satra/virtualenv/tree/fix/EPDpatch
EPD+OSXx64+virtualenv.rst
reStructuredText

OS X x64 EPD install with ETS and virtualenv

This is from a macbook pro running 10.6.6 in 64-bit boot mode.

Install EPD

Run the installer and then open terminal (this will invoke the EPD install)!

Install wx2.9 for python 2.7 into EPD

install from http://downloads.sourceforge.net/wxpython/wxPython2.9-osx-2.9.1.1-cocoa-py2.7.dmg

patch postflight under '/Library/Receipts/wxPython2.9-osx-cocoa-py2.7.pkg/Contents/Resources/postflight':

8c8
< for dir in /usr/bin            /usr/local/bin            /Library/Frameworks/Python.framework/Versions/2.7/bin            /System/Library/Frameworks/Python.framework/Versions/2.7/bin /Library/Frameworks/EPD64.framework/Versions/7.0/bin; do
---
> for dir in /usr/bin            /usr/local/bin            /Library/Frameworks/Python.framework/Versions/2.7/bin            /System/Library/Frameworks/Python.framework/Versions/2.7/bin; do
29c29
< for dir in /Library/Python/2.7/site-packages            /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages /Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/site-packages; do
---
> for dir in /Library/Python/2.7/site-packages            /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages; do

then re-execute:

sudo sh /Library/Receipts/wxPython2.9-osx-cocoa-py2.7.pkg/Contents/Resources/postflight

Install PyQt and associated packages into EPD

Download and install Qt x64 from http://get.qt.nokia.com/qt/source/qt-mac-opensource-4.7.1.dmg

Sip

download sip:

curl -O http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.12.3.tar.gz

patch siputils.py:

1437c1437
<             if "Python.framework" not in dl:
---
>             if not any([".framework" in value for value in dl]):

install sip:

python configure.py
make
make install

PyQt

download pyqt:

curl -O http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.8.4.tar.gz

install pyqt:

python configure.py
make
make install

QScintilla

download qscintilla:

curl -O   http://www.riverbankcomputing.co.uk/static/Downloads/QScintilla2/QScintilla-gpl-2.5.1.tar.gz

install qscintilla:

cd Qt4
qmake qscintilla.pro -spec macx-g++
make
make install
cd ../Python
python configure.py
make
make install

Install VTK

This section assumes you know how to use CMake (cmake.org) and compile VTK using cmake and make.

download from http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz

configure VTK:

BUILD_SHARED_LIBS = ON
CMAKE_BUILD_TYPE = Release
VTK_USE_QT = ON
VTK_WRAP_PYTHON = ON

toggle to advanced mode (press t inside ccmake). on osx ccmake picks up the default system python library.:

PYTHON_LIBRARY to /Library/Frameworks/EPD64.framework/Versions/7.0/Python

compile and install. by default the python wrappers will be installed in /usr/local/lib/python2.7/site-packages/ so re-execute the python install:

make
make install
cd "Wrapping/Python" &&  /Library/Frameworks/EPD64.framework/Versions/Current/bin/python2.7   setup.py install

Install ETS

see ets download instructions at (needs git): http://code.enthought.com/source/

python ets.py setup install

Install virtualenvwrapper

install virtualenvwrapper http://www.doughellmann.com/projects/virtualenvwrapper/ and then uninstall virtualenv:

easy_install virtualenvwrapper
pip uninstall virtualenv

download virtualenv source from bitbucket (http://bitbucket.org/ianb/virtualenv)

patch virtualenv.py:

872,881c872,885
<     if 'Python.framework' in prefix:
<         logger.debug('MacOSX Python framework detected')
<
<         # Make sure we use the the embedded interpreter inside
<         # the framework, even if sys.executable points to
<         # the stub executable in ${sys.prefix}/bin
<         # See http://groups.google.com/group/python-virtualenv/
<         #                              browse_thread/thread/17cab2f85da75951
<         original_python = os.path.join(
<             prefix, 'Resources/Python.app/Contents/MacOS/Python')
---
>     if '.framework' in prefix:
>         if 'Python.framework' in prefix:
>             logger.debug('MacOSX Python framework detected')
>
>             # Make sure we use the the embedded interpreter inside
>             # the framework, even if sys.executable points to
>             # the stub executable in ${sys.prefix}/bin
>             # See http://groups.google.com/group/python-virtualenv/
>             #                              browse_thread/thread/17cab2f85da75951
>             original_python = os.path.join(
>                 prefix, 'Resources/Python.app/Contents/MacOS/Python')
>         if 'EPD' in prefix:
>             logger.debug('EPD framework detected')
>             original_python = os.path.join(prefix, 'bin/python')

install:

python setup.py install
EPDOSXx64virtualenv.rst
reStructuredText

OS X x64 EPD install with ETS and virtualenv

This is from a macbook pro running 10.6.6 in 64-bit boot mode.

Install EPD

Run the installer and then open terminal (this will invoke the EPD install)!

Install wx2.9 for python 2.7 into EPD

install from http://downloads.sourceforge.net/wxpython/wxPython2.9-osx-2.9.1.1-cocoa-py2.7.dmg

patch postflight under '/Library/Receipts/wxPython2.9-osx-cocoa-py2.7.pkg/Contents/Resources/postflight':

8c8
< for dir in /usr/bin            /usr/local/bin            /Library/Frameworks/Python.framework/Versions/2.7/bin            /System/Library/Frameworks/Python.framework/Versions/2.7/bin /Library/Frameworks/EPD64.framework/Versions/7.0/bin; do
---
> for dir in /usr/bin            /usr/local/bin            /Library/Frameworks/Python.framework/Versions/2.7/bin            /System/Library/Frameworks/Python.framework/Versions/2.7/bin; do
29c29
< for dir in /Library/Python/2.7/site-packages            /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages /Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/site-packages; do
---
> for dir in /Library/Python/2.7/site-packages            /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages; do

then re-execute:

sudo sh /Library/Receipts/wxPython2.9-osx-cocoa-py2.7.pkg/Contents/Resources/postflight

Install PyQt and associated packages into EPD

Download and install Qt x64 from http://get.qt.nokia.com/qt/source/qt-mac-opensource-4.7.1.dmg

Sip

download sip:

curl -O http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.12.3.tar.gz

patch siputils.py:

1437c1437
<             if "Python.framework" not in dl:
---
>             if not any([".framework" in value for value in dl]):

install sip:

python configure.py
make
make install

PyQt

download pyqt:

curl -O http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.8.4.tar.gz

install pyqt:

python configure.py
make
make install

QScintilla

download qscintilla:

curl -O   http://www.riverbankcomputing.co.uk/static/Downloads/QScintilla2/QScintilla-gpl-2.5.1.tar.gz

install qscintilla:

cd Qt4
qmake qscintilla.pro -spec macx-g++
make
make install
cd ../Python
python configure.py
make
make install

Install VTK

This section assumes you know how to use CMake (cmake.org) and compile VTK using cmake and make.

download from http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz

configure VTK:

BUILD_SHARED_LIBS = ON
CMAKE_BUILD_TYPE = Release
VTK_USE_QT = ON
VTK_WRAP_PYTHON = ON

toggle to advanced mode (press t inside ccmake). on osx ccmake picks up the default system python library.:

PYTHON_LIBRARY to /Library/Frameworks/EPD64.framework/Versions/7.0/Python

compile and install. by default the python wrappers will be installed in /usr/local/lib/python2.7/site-packages/ so re-execute the python install:

make
make install
cd "Wrapping/Python" &&  /Library/Frameworks/EPD64.framework/Versions/Current/bin/python2.7   setup.py install

Install ETS

see ets download instructions at (needs git): http://code.enthought.com/source/

python ets.py setup install

Install virtualenvwrapper

install virtualenvwrapper http://www.doughellmann.com/projects/virtualenvwrapper/ and then uninstall virtualenv:

easy_install virtualenvwrapper
pip uninstall virtualenv

download virtualenv source from bitbucket (http://bitbucket.org/ianb/virtualenv)

patch virtualenv.py:

872,881c872,885
<     if 'Python.framework' in prefix:
<         logger.debug('MacOSX Python framework detected')
<
<         # Make sure we use the the embedded interpreter inside
<         # the framework, even if sys.executable points to
<         # the stub executable in ${sys.prefix}/bin
<         # See http://groups.google.com/group/python-virtualenv/
<         #                              browse_thread/thread/17cab2f85da75951
<         original_python = os.path.join(
<             prefix, 'Resources/Python.app/Contents/MacOS/Python')
---
>     if '.framework' in prefix:
>         if 'Python.framework' in prefix:
>             logger.debug('MacOSX Python framework detected')
>
>             # Make sure we use the the embedded interpreter inside
>             # the framework, even if sys.executable points to
>             # the stub executable in ${sys.prefix}/bin
>             # See http://groups.google.com/group/python-virtualenv/
>             #                              browse_thread/thread/17cab2f85da75951
>             original_python = os.path.join(
>                 prefix, 'Resources/Python.app/Contents/MacOS/Python')
>         if 'EPD' in prefix:
>             logger.debug('EPD framework detected')
>             original_python = os.path.join(prefix, 'bin/python')

install:

python setup.py install
using the virtualenv.rst
reStructuredText

$ export WORKON_HOME=/software/python/EPD/virtualenvs/7.0

$ mkdir /software/python/EPD/virtualenvs

$ mkdir /software/python/EPD/virtualenvs/7.0

$ source /software/python/EPD/7.0/bin/virtualenvwrapper.sh:

virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/initialize
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/premkvirtualenv
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/postmkvirtualenv
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/prermvirtualenv
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/postrmvirtualenv
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/predeactivate
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/postdeactivate
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/preactivate
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/postactivate
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/get_env_details

$ mkvirtualenv devpype:

New python executable in devpype/bin/python
Installing setuptools........................done.
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/devpype/bin/predeactivate
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/devpype/bin/postdeactivate
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/devpype/bin/preactivate
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/devpype/bin/postactivate
virtualenvwrapper.user_scripts creating /software/python/EPD/virtualenvs/7.0/devpype/bin/get_env_details

to use the environment devpype (automatically activated by mkvirtualenv) but for other users they would just need to do:

source /software/python/EPD/virtualenvs/7.0/devpype/bin/activate
and then to turn off
deactivate

alternatively using virtualenvwrapper (put into bashrc)

export PATH=/software/python/EPD/7.0/bin:$PATH
export WORKON_HOME=/software/python/EPD/virtualenvs/7.0/
source /software/python/EPD/7.0/bin/virtualenvwrapper.sh

then in the terminal you can use virtualenvwrapper commands:

workon devpype

Anyone get this working with EPD 7.1?

hi brian,

epd 7.1 x64 for osx contains ets!

cheers,

satra

On Mon, Jul 11, 2011 at 10:16 PM, ellisonbg <
reply@reply.github.com>wrote:

Anyone get this working with EPD 7.1?

Reply to this email directly or view it on GitHub:
https://gist.github.com/845545

I am interested in the virtualenv piece. I tried applying your patch
to virtualenv, but it doesn't work for EPD 7.1.

Cheers,

Brian

On Mon, Jul 11, 2011 at 7:17 PM, satra
reply@reply.github.com
wrote:

hi brian,

epd 7.1 x64 for osx contains ets!

cheers,

satra

On Mon, Jul 11, 2011 at 10:16 PM, ellisonbg <
reply@reply.github.com>wrote:

Anyone get this working with EPD 7.1?

Reply to this email directly or view it on GitHub:
https://gist.github.com/845545

Reply to this email directly or view it on GitHub:
https://gist.github.com/845545

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

ah - try this.

1122,1131c1122,1134
< if 'Python.framework' in prefix:
< logger.debug('MacOSX Python framework detected')
<
< # Make sure we use the the embedded interpreter inside
< # the framework, even if sys.executable points to
< # the stub executable in ${sys.prefix}/bin
< # See http://groups.google.com/group/python-virtualenv/
< #
browse_thread/thread/17cab2f85da75951
< original_python = os.path.join(

< prefix, 'Resources/Python.app/Contents/MacOS/Python')

if '.framework' in prefix:
    if 'Python.framework' in prefix:
        logger.debug('MacOSX Python framework detected')
        # Make sure we use the the embedded interpreter inside
        # the framework, even if sys.executable points to
        # the stub executable in ${sys.prefix}/bin
        # See http://groups.google.com/group/python-virtualenv/
        #

browse_thread/thread/17cab2f85da75951
original_python = os.path.join(
prefix, 'Resources/Python.app/Contents/MacOS/Python')
if 'EPD' in prefix:
logger.debug('EPD framework detected')
original_python = os.path.join(prefix, 'bin/python')

posted a patch with the gist.

I tried the patch (at least the one on the gist originally) and it no
longer fies the issue :(

Brian

On Mon, Jul 11, 2011 at 7:30 PM, satra
reply@reply.github.com
wrote:

posted a patch with the gist.

Reply to this email directly or view it on GitHub:
https://gist.github.com/845545

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

no longer fixes the issue, that is...

On Tue, Jul 12, 2011 at 8:47 AM, Brian Granger ellisonbg@gmail.com wrote:

I tried the patch (at least the one on the gist originally) and it no
longer fies the issue :(

Brian

On Mon, Jul 11, 2011 at 7:30 PM, satra
reply@reply.github.com
wrote:

posted a patch with the gist.

Reply to this email directly or view it on GitHub:
https://gist.github.com/845545

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Thanks for this - is this still a current fix for EPD 7.1?

this is still a fix, except for the fact that EPD 7.1 does provide a number of the ETS packages. a few notes:

  • you will have to uninstall using enpkg - Qt and PySide
  • the virtualenv patch though is in my github virtualenv fork. i haven't checked it in a while though.
  • you should get the latest versions of wx 2.9 for osx (although wxpython will complain and not run as it expects a framework build, which EPD 64 doe not appear to be) - so you will have to rely on Qt for any windowing.

Hi I want to use mayavi with 64-bit EPD but I'm getting the following error when I import the module

Fatal Python error: PyThreadState_Get: no current thread
Abort trap

Any Suggestions?

Did you follow the instructions related to using the ETS listed above?

Have you put the question to the related Enthought mailing list, epd-users@enthought.com ? The core developers are often hanging around there and are helpful with this sort of issue.

On 2012-04-20, at 1:42 AM, Ranjit Khanuja wrote:

Hi I want to use mayavi with 64-bit EPD but I'm getting the following error when I import the module

Fatal Python error: PyThreadState_Get: no current thread
Abort trap

Any Suggestions?


Reply to this email directly or view it on GitHub:
https://gist.github.com/845545

Thanks for your reply. I will email on the enthought mailing list. It works fine with 32-bit EPD though. So
for now, I'm using that

Yes - As you can see from this post and other results on Google 32-bit is a ok, while ETS (anything with a UI I think) is an issue with the 64-bit EPD version.

If you're not super interested (or needing) 64-bit, just going with the 32-bit simplifies some of the rough edges.

Good luck.

On 2012-04-20, at 12:24 PM, Ranjit Khanuja wrote:

Thanks for your reply. I will email on the enthought mailing list. It works fine with 32-bit EPD though. So
for now, I'm using that


Reply to this email directly or view it on GitHub:
https://gist.github.com/845545

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.