arch -i386 ipython notebook Error
Question: I have installed all the required packages to run the ipython notebook using
macports with the +universal build option. I can run ipython with arch -i386
ipython without a problem. I have successfully opened the notebook using the
64bit build. However, when I try to open the notebook in 32bit mode I get the
following error:

    
    
        Traceback (most recent call last):
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/zmq/__init__.py", line 52, in <module>
        from zmq.utils import initthreads # initialize threads
    ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/zmq/utils/initthreads.so, 2): no suitable image found.  Did find:
        /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/zmq/utils/initthreads.so: mach-o, but wrong architecture
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/utils/zmqrelated.py", line 35, in check_for_zmq
        import zmq
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/zmq/__init__.py", line 54, in <module>
        raise ImportError("%s\nAre you trying to `import zmq` from the pyzmq source dir?" % e)
    ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/zmq/utils/initthreads.so, 2): no suitable image found.  Did find:
        /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/zmq/utils/initthreads.so: mach-o, but wrong architecture
    Are you trying to `import zmq` from the pyzmq source dir?
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/opt/local/bin/ipython", line 9, in <module>
        load_entry_point('ipython==1.2.1', 'console_scripts', 'ipython3')()
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/__init__.py", line 118, in start_ipython
        return launch_new_instance(argv=argv, **kwargs)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/application.py", line 544, in launch_instance
        app.initialize(argv)
      File "<string>", line 2, in initialize
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/application.py", line 89, in catch_config_error
        return method(app, *args, **kwargs)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/terminal/ipapp.py", line 312, in initialize
        super(TerminalIPythonApp, self).initialize(argv)
      File "<string>", line 2, in initialize
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/application.py", line 89, in catch_config_error
        return method(app, *args, **kwargs)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/core/application.py", line 373, in initialize
        self.parse_command_line(argv)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/terminal/ipapp.py", line 307, in parse_command_line
        return super(TerminalIPythonApp, self).parse_command_line(argv)
      File "<string>", line 2, in parse_command_line
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/application.py", line 89, in catch_config_error
        return method(app, *args, **kwargs)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/application.py", line 474, in parse_command_line
        return self.initialize_subcommand(subc, subargv)
      File "<string>", line 2, in initialize_subcommand
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/application.py", line 89, in catch_config_error
        return method(app, *args, **kwargs)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/config/application.py", line 405, in initialize_subcommand
        subapp = import_item(subapp)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/utils/importstring.py", line 42, in import_item
        module = __import__(package, fromlist=[obj])
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/html/notebookapp.py", line 36, in <module>
        check_for_zmq('2.1.11', 'IPython.html')
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/IPython/utils/zmqrelated.py", line 37, in check_for_zmq
        raise ImportError("%s requires pyzmq >= %s"%(required_by, minimum_version))
    

Any suggestions would be greatly appreciated!


Answer: If the port that installed
`/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-
packages/zmq/utils/initthreads.so` is installed with the universal variant
(use `port provides $file` to find out which port that is), that's a bug in
said port. Please file a ticket about this.

