82238

Psycopg2 under osx works on commandline but fails in Aptana studio

Question:

I have been developing under Python/Snowleopard happily for the part 6 months. I just upgraded Python to 2.6.5 and a whole bunch of libraries, including psycopg2 and Turbogears. I can start up tg-admin and run some queries with no problems. Similarly, I can run my web site from the command line with no problems.

However, if I try to start my application under Aptana Studio, I get the following exception while trying to import psychopg2:

('dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: _PQbackendPID\n Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/psycopg2/_psycopg.so\n Expected in: flat namespace\n in /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/psycopg2/_psycopg.so',)

This occurs after running the following code: try: import psycopg2 as psycopg except ImportError as ex: print "import failed :-( xxxxxxxx = " print ex.args

I have confirmed that the same version of python is being run as follows: import sys print "python version: ", sys.version_info

Does anyone have any ideas? I've seem some references alluding to this being a 64-bit issue. - dave

Answer1:

Problem solved (to a point). I was running 64 bit python from Aptana Studio and 32 bit python on the command line. By forcing Aptana to use 32 bit python, the libraries work again and all is happy.

Recommend

  • What is the red X on my CSS file icon in Aptana Studio 3?
  • Aptana3 rename variable in a file
  • How to add to Aptana helpful panel with snippets?
  • How to print colorful text in Python terminal? [closed]
  • Does using package generics require the package to be in Depends or Imports?
  • Obtain access token for both Microsoft Graph and individual service API endpoints (Outlook REST APIs
  • How to make a div appear under button
  • Mac Default Python Path Change
  • QObject::findChild() returns None without obvious reason
  • Objective C - Create a framework for my iphone apps?
  • CS1703: In Xamarin.Droid, should I use the .Net Standard windowsruntime.dll located in Mono.Framewor
  • Upgrade project from WorkLight 6.1 to MobileFirst 7.1
  • TFS - how do I sum child task hours to parent
  • Deploying a CodeRush plugin from the Community Site
  • How to pass solution folder as parameter in command line arguments (for debug)?
  • Does Apple allow the usage of sysctl.h within iOS applications?
  • During installation of Django, why do I keep getting ImportError: No module named django?
  • pillow imaging ImportError
  • Django model inheritance, filtering models
  • How can I set a binding to a Combox in a UserControl?
  • Does it make sense to call System.gc() and Thread.sleep() when working on Bitmaps?
  • Make VS2015 use angular-cli ng at build time in a .NET project
  • Reading JSON from a file using C++ REST SDK (Casablanca)
  • All Classes Conforming to Protocol Inherit Default Implementation
  • FB SDK and cURL: Unknown SSL protocol error in connection to graph.facebook.com:443
  • Using $this when not in object context
  • Jenkins: How To Build multiple projects from a TFS repository?
  • C# - Serializing and deserializing static member
  • How do I fake an specific browser client when using Java's Net library?
  • Problems to linebreak with an int in JLabel
  • How reduce the height of an mschart by breaking up the y-axis
  • Sending data from AppleScript to FileMaker records
  • Perl system calls when running as another user using sudo
  • Websockets service method fails during R startup
  • Apache 2.4 - remove | delete | uninstall
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Is there a mandatory requirement to switch app.yaml?
  • How to include full .NET prerequisite for Wix Burn installer
  • Is it possible to post an object from jquery to bottle.py?
  • UserPrincipal.Current returns apppool on IIS