Search Results

Search found 282 results on 12 pages for 'importerror'.

Page 10/12 | < Previous Page | 6 7 8 9 10 11 12  | Next Page >

  • Django MOD_PYTHON ERROR

    - by Cato Johnston
    I have had django running with mod_python for awhile now but today I get the following error MOD_PYTHON ERROR ProcessId: 4551 Interpreter: 'thatch' ServerName: 'thatch' DocumentRoot: '/var/www/thatch' URI: '/' Location: '/' Directory: None Filename: '/var/www/thatch/' PathInfo: '' Phase: 'PythonHandler' Handler: 'django.core.handlers.modpython' Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1202, in _process_target module = import_module(module_name, path=path) File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 304, in import_module return __import__(module_name, {}, {}, ['*']) ImportError: No module named django.core.handlers.modpython This is my virtual host configuration <VirtualHost *:80> ServerName thatch DocumentRoot /var/www/thatch <Location "/"> SetHandler python-program PythonPath "['/var/www/thatch'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE thatch.settings PythonOption django.root /var/www/thatch PythonDebug On </Location> <Location "/media"> SetHandler None </Location> <LocationMatch "\.(jpg|gif|png|css|js)$"> SetHandler None </LocationMatch> </VirtualHost> Any ideas why this is happening?

    Read the article

  • Using SQL Alchemy and pyodbc with IronPython 2.6.1

    - by beargle
    I'm using IronPython and the clr module to retrieve SQL Server information via SMO. I'd like to retrieve/store this data in a SQL Server database using SQL Alchemy, but am having some trouble loading the pyodbc module. Here's the setup: IronPython 2.6.1 (installed at D:\Program Files\IronPython) CPython 2.6.5 (installed at D:\Python26) SQL Alchemy 0.6.1 (installed at D:\Python26\Lib\site-packages\sqlalchemy) pyodbc 2.1.7 (installed at D:\Python26\Lib\site-packages) I have these entries in the IronPython site.py to import CPython standard and third-party libraries: # Add CPython standard libs and DLLs import sys sys.path.append(r"D:\Python26\Lib") sys.path.append(r"D:\Python26\DLLs") sys.path.append(r"D:\Python26\lib-tk") sys.path.append(r"D:\Python26") # Add CPython third-party libs sys.path.append(r"D:\Python26\Lib\site-packages") # sqlite3 sys.path.append(r"D:\Python26\Lib\sqlite3") # Add SQL Server SMO sys.path.append(r"D:\Program Files\Microsoft SQL Server\100\SDK\Assemblies") import clr clr.AddReferenceToFile('Microsoft.SqlServer.Smo.dll') clr.AddReferenceToFile('Microsoft.SqlServer.SqlEnum.dll') clr.AddReferenceToFile('Microsoft.SqlServer.ConnectionInfo.dll') SQL Alchemy imports OK in IronPython, put I receive this error message when trying to connect to SQL Server: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.3607 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlalchemy >>> e = sqlalchemy.MetaData("mssql://") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\Python26\Lib\site-packages\sqlalchemy\schema.py", line 1780, in __init__ File "D:\Python26\Lib\site-packages\sqlalchemy\schema.py", line 1828, in _bind_to File "D:\Python26\Lib\site-packages\sqlalchemy\engine\__init__.py", line 241, in create_engine File "D:\Python26\Lib\site-packages\sqlalchemy\engine\strategies.py", line 60, in create File "D:\Python26\Lib\site-packages\sqlalchemy\connectors\pyodbc.py", line 29, in dbapi ImportError: No module named pyodbc This code works just fine in CPython, but it looks like the pyodbc module isn't accessible from IronPython. Any suggestions? I realize that this may not be the best way to approach the problem, so I'm open to tackling this a different way. Just wanted to get some experience with using SQL Alchemy and pyodbc.

    Read the article

  • Django custom managers - how do I return only objects created by the logged-in user?

    - by Tom Tom
    I want to overwrite the custom objects model manager to only return objects a specific user created. Admin users should still return all objects using the objects model manager. Now I have found an approach that could work. They propose to create your own middleware looking like this: #### myproject/middleware/threadlocals.py try: from threading import local except ImportError: # Python 2.3 compatibility from django.utils._threading_local import local _thread_locals = local() def get_current_user(): return getattr(_thread_locals, 'user', None) class ThreadLocals(object): """Middleware that gets various objects from the request object and saves them in thread local storage.""" def process_request(self, request): _thread_locals.user = getattr(request, 'user', None) #### end And in the Custom manager you could call the get_current_user() method to return only objects a specific user created. class UserContactManager(models.Manager): def get_query_set(self): return super(UserContactManager, self).get_query_set().filter(creator=get_current_user()) Is this a good approach to this use-case? Will this work? Or is this like "using a sledgehammer to crack a nut" ? ;-) Just using: Contact.objects.filter(created_by= user) in each view doesn`t look very neat to me. EDIT Do not use this middleware approach !!! use the approach stated by Jack M. below After a while of testing this approach behaved pretty strange and with this approach you mix up a global-state with a current request. Use the approach presented below. It is really easy and no need to hack around with the middleware. create a custom manager in your model with a function that expects the current user or any other user as an input. #in your models.py class HourRecordManager(models.Manager): def for_user(self, user): return self.get_query_set().filter(created_by=user) class HourRecord(models.Model): #Managers objects = HourRecordManager() #in vour view you can call the manager like this and get returned only the objects from the currently logged-in user. hr_set = HourRecord.objects.for_user(request.user)

    Read the article

  • Scapy Installed, when i use it as module Its full of errors ???

    - by Rami Jarrar
    I installed scapy 2.xx (after get some missed modules to make it install),, then i'm trying to use it as module in my python programs,, but i cant it give me alot of errors, I download and installed some missed modules and finally i'm depressed, because this error, after hard work i got this Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> from scapy.all import * File "C:\Python26\scapy\all.py", line 43, in <module> from crypto.cert import * File "C:\Python26\scapy\crypto\cert.py", line 15, in <module> from Crypto.PublicKey import * File "C:\Python26\lib\Crypto\PublicKey\RSA.py", line 34, in <module> from Crypto import Random File "C:\Python26\lib\Crypto\Random\__init__.py", line 29, in <module> import _UserFriendlyRNG File "C:\Python26\lib\Crypto\Random\_UserFriendlyRNG.py", line 36, in <module> from Crypto.Random.Fortuna import FortunaAccumulator File "C:\Python26\lib\Crypto\Random\Fortuna\FortunaAccumulator.py", line 36, in <module> import FortunaGenerator File "C:\Python26\lib\Crypto\Random\Fortuna\FortunaGenerator.py", line 32, in <module> from Crypto.Util import Counter File "C:\Python26\lib\Crypto\Util\Counter.py", line 27, in <module> import _counter ImportError: No module named _counter by do the following code: from scapy.all import * p=sr1(IP(dst=ip_dst)/ICMP()) if p: p.show() so what should i do,, is there a solution for this ???

    Read the article

  • How do I correctly install dulwich to get hg-git working on Cygwin?

    - by Erik Vold
    I have a similar issue as in this issue, but in my case I am trying to use cygwin. First I followed the instructions here, and I ran: $ easy_install hg-git The I created ~/.hgrc, with: [extensions] hgext.bookmarks = hggit = Then when I typed 'hg' at a command prompt, I'd see: "* failed to import extension hggit: No module named hggit" So I did a search for "hggit" and found /cygdrive/c/Python26/Lib/site-packages/hg_git-0.2.1-py2.6.egg/hggit, so I updated .hgrc: [extensions] hgext.bookmarks = hggit = /cygdrive/c/Python26/Lib/site-packages/hg_git-0.2.1-py2.6.egg/hggit Then when I type 'hg' I get "No module named dulwich.errors" If you read this question, it's the same problem. In python shell I cannot import dulwich: >>> import dulwich Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named dulwich I checked out my easy-install.pth and it does contain the dulwich egg: import sys; sys.__plen = len(sys.path) ./hg_git-0.2.1-py2.6.egg ./dulwich-0.5.0-py2.6-win32.egg import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new) So how can I fix this so that import dulwich works, which should fix my problem using hg-git I assume..

    Read the article

  • py2app, pyObjc & macports compilation errors

    - by Neewok
    Hi, I'm currently writing a small python app that embeds cherrypy and django using py2app. It worked well until I tried to include pyobjc in my project, since my app needed a small GUI (which consists of a small icon in the top menu bar + a drop down menu). I can run my python script without any problem (I'm using python 2.6 with macports), but I can't launch the application bundle generated by py2app. A dialog box appears with the following message: ImportError: dlopen(/Users/denis/tlon/standalone/mac/dist/django_cherry.app/Contents/Resources/lib/python2.6/lib-dynload/CoreFoundation/_inlines.so, 2): no suitable image found. Did find: /Users/denis/tlon/standalone/mac/dist/django_cherry.app/Contents/Resources/lib/python2.6/lib-dynload/CoreFoundation/_inlines.so: mach-o, but wrong architecture I did a quick : sudo port -u install py26-pyobjc +universal but for some reason macports tries to build openssl, with which compilation fails each time. It seems the problem is related to zLib - this is what appears in the logs : :info:build ld: warning: in /opt/local/lib/libz.dylib, file is not of required architecture ...And here is the output of file /opt/local/lib/libz.dylib : /opt/local/lib/libz.dylib: Mach-O universal binary with 2 architectures /opt/local/lib/libz.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 /opt/local/lib/libz.dylib (for architecture i386): Mach-O dynamically linked shared library i386 Nothing looks wrong to me. I'm a bit stuck here. I don't even understand what openssl has to do with pyObjc, but it looks like I can't go anywhere if I don't manage to compile it. Macports really suck sometimes :/ EDIT I manage to fix Macports issue, but not py2app one. If I get it right, py2app try to create a 32-bits app, while Core Foundation files on Snow Leopard are for 64 bits architectures. Damn. Either I build this on Leopard, either I have to find a way to create a 64bit app with py2app, but then Snow Leopard only.

    Read the article

  • C++ Swig Python (Embedded Python in C++) works in Release but not in Debug

    - by sambha
    Platform: Windows 7, 64 bit (x64), Visual Studio 2008 I chose Python & Swig binding as the scripting environment of the application. As a prototype, created a simple VS solution with main() which initializes Python (Py_Initalize, Py_setPyHome, etc) & executes test.py. In the same solution created another project which is a DLL of a simple class. Used SWIG to wrap this class. This DLL is the _MyClasses.pyd. test.py creates the objects of my class & calls its member functions. All this works like a charm in the Release mode. But does not work in Debug mode (even tried banging my head on the laptop ;-) ). Output of my work looks like this (in both release & debug): x64 -debug - _MyClasses.pyd - MyClasses.py - test.exe - test.py - python26.dll - python26_d.dll Note that the debug version is linked against python26_d.lib. Had to build python myself for this! test.py import MyClasses print "ello" m = MyClasses.Male("John Doe", 25) print m.getType() Male is the C++ class. The problem: Traceback (most recent call last): File "test.py", line 6, in <module> import MyClasses File "...\x64\Debug\MyClasses.py", line 25, in <module> _MyClasses = swig_import_helper() File "...\x64\Debug\MyClasses.py", line 17, in swig_imp ort_helper import _MyClasses ImportError: No module named _MyClasses [15454 refs] I am used to Makefiles & am new to Visual Studio. I dont know who the culprit is here: Swig, The debug build of Python, Visual Studio, my stupidity. Thank you in advance. It will be a great help.

    Read the article

  • "import numpy" tries to load my own package

    - by Sebastian
    I have a python (2.7) project containing my own packages util and operator (and so forth). I read about relative imports, but perhaps I didn't understand. I have the following directory structure: top-dir/ util/__init__.py (empty) util/ua.py util/ub.py operator/__init__.py ... test/test1.py The test1.py file contains #!/usr/bin/env python2 from __future__ import absolute_import # removing this line dosn't change anything. It's default functionality in python2.7 I guess import numpy as np It's fine when I execute test1.py inside the test/ folder. But when I move to the top-dir/ the import numpy wants to include my own util package: Traceback (most recent call last): File "tests/laplace_2d_square.py", line 4, in <module> import numpy as np File "/usr/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module> import add_newdocs File "/usr/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module> from numpy.lib import add_newdoc File "/usr/lib/python2.7/site-packages/numpy/lib/__init__.py", line 4, in <module> from type_check import * File "/usr/lib/python2.7/site-packages/numpy/lib/type_check.py", line 8, in <module> import numpy.core.numeric as _nx File "/usr/lib/python2.7/site-packages/numpy/core/__init__.py", line 45, in <module> from numpy.testing import Tester File "/usr/lib/python2.7/site-packages/numpy/testing/__init__.py", line 8, in <module> from unittest import TestCase File "/usr/lib/python2.7/unittest/__init__.py", line 58, in <module> from .result import TestResult File "/usr/lib/python2.7/unittest/result.py", line 9, in <module> from . import util File "/usr/lib/python2.7/unittest/util.py", line 2, in <module> from collections import namedtuple, OrderedDict File "/usr/lib/python2.7/collections.py", line 9, in <module> from operator import itemgetter as _itemgetter, eq as _eq ImportError: cannot import name itemgetter The troublesome line is either from . import util or perhaps from operator import itemgetter as _itemgetter, eq as _eq What can I do?

    Read the article

  • VPython in Eclipse - thinks it has the wrong architecture type.

    - by Duncan Tait
    Evening, So I've recently installed VPython on my MacBook (OS X, Snow Leopard) - and it works absolutely fine in IDLE and from the command line (interactive mode). However, eclipse has issues. Firstly it couldn't find it (which is a bit of an issue actually with all these 'easy install' python modules - when they don't tell you where they actually install to!) but I searched it out in the depths of Library\Frameworks... and added that to the System PYTHONPATH listbox in Eclipse. Now it can find it, but it says the following: Traceback (most recent call last): File "/Users/duncantait/dev/workspace/Network_Simulation/src/Basic/Net_Sim1.py", line 15, in <module> import visual File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/visual/__init__.py", line 59, in <module> import cvisual ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/visual/cvisual.so, 2): no suitable image found. Did find: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/visual/cvisual.so: mach-o, but wrong architecture I am guessing that VPython might not be built for a 64-bit architecture (Intel), but the fact remains that it works in both IDLE and command prompt... So there must be a way to configure Eclipse to run it right? (Wishful thinking). Thanks for any help! Duncan

    Read the article

  • Distutils - Where Am I going wrong?

    - by RJBrady
    I wanted to learn how to create python packages, so I visited http://docs.python.org/distutils/index.html. For this exercise I'm using Python 2.6.2 on Windows XP. I followed along with the simple example and created a small test project: person/ setup.py person/ __init__.py person.py My person.py file is simple: class Person(object): def __init__(self, name="", age=0): self.name = name self.age = age def sound_off(self): print "%s %d" % (self.name, self.age) And my setup.py file is: from distutils.core import setup setup(name='person', version='0.1', packages=['person'], ) I ran python setup.py sdist and it created MANIFEST, dist/ and build/. Next I ran python setup.py install and it installed it to my site packages directory. I run the python console and can import the person module, but I cannot import the Person class. >>>import person >>>from person import Person Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name Person I checked the files added to site-packages and checked the sys.path in the console, they seem ok. Why can't I import the Person class. Where did I go wrong?

    Read the article

  • Has Twisted changed its dependencies?

    - by cdecker
    Hi all, I'm currently working on a Python/Twisted project which is to be distributed and tested on Planetlab. For some reason my code was working on friday and now that I wanted to test a minor change it refuses to work at all: Traceback (most recent call last): File "acn_a4/src/node.py", line 6, in <module> from twisted.internet.protocol import DatagramProtocol File "/usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/__init__.py", line 18, in <module> from twisted.python import compat File "/usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/python/compat.py", line 146, in <module> import operator File "/home/cdecker/dev/acn/acn_a4/src/operator.py", line 7, in <module> File "/home/cdecker/acn_a4/src/node.py", line 6, in <module> from twisted.internet.protocol import DatagramProtocol File "/usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/internet/protocol.py", line 20, in <module> from twisted.python import log, failure, components File "/usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/python/log.py", line 19, in <module> from twisted.python import util, context, reflect File "/usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/python/util.py", line 5, in <module> import os, sys, hmac, errno, new, inspect, warnings File "/usr/lib/python2.5/inspect.py", line 32, in <module> from operator import attrgetter ImportError: cannot import name attrgetter And since I'm pretty new to python I have no idea what could have caused this problem. All suggestions are welcome :-)

    Read the article

  • python protobufs - avoid the install step ?

    - by orion elenzil
    i'm writing a small python utility which will be consumed by moderately non-technical users and which needs to interface w/ some protobufs. ideally, i would like the only prerequisites to using this on a local machine to be: have python installed * have an SVN checkout of the repository * run a simple bash script to build the local proto .py definitions * run "python myutility" i'm running into trouble around importing descriptor_pb2.py, tho. i've seen Why do I see "cannot import name descriptor_pb2" error when using Google Protocol Buffers? , but would like to avoid adding the additional prerequisite of having run the proto SDK installer. i've modified the bash script to also generate descriptor_pb2.py in the local heirarchy, which works for the first level of imports from my other _pb2.py files, but it looks like descriptor_pb2.py itself tries to import descriptor_pb2 can't find it: $ python myutility.py Traceback (most recent call last): File "myutility.py", line 4, in <module> import protos.myProto_pb2 File "/myPath/protos/myProto_pb2.py", line 8, in <module> from google.protobuf import descriptor_pb2 File "/myPath/google/protobuf/descriptor_pb2.py", line 8, in <module> from google.protobuf import descriptor_pb2 ImportError: cannot import name descriptor_pb2 my local folder looks like: * myutility.py * google/ * protobuf/ * descriptor.py * descriptor_pb2.py * protos * myProto_ob2.py also, i'm a python n00b, so it's possible i'm overlooking something obvious. tia, orion

    Read the article

  • How to install PySide v0.3.1 on Mac OS X?

    - by ivo
    I'm trying to install PySide v0.3.1 in Mac OS X, for Qt development in python. As a pre-requisite, I have installed CMake and the Qt SDK. I have gone through the documentation and come up with the following installation script: export PYSIDE_BASE_DIR="<my_dir>" export APIEXTRACTOR_DIR="$PYSIDE_BASE_DIR/apiextractor-0.5.1" export GENERATORRUNNER_DIR="$PYSIDE_BASE_DIR/generatorrunner-0.4.2" export SHIBOKEN_DIR="$PYSIDE_BASE_DIR/shiboken-0.3.1" export PYSIDE_DIR="$PYSIDE_BASE_DIR/pyside-qt4.6+0.3.1" export PYSIDE_TOOLS_DIR="$PYSIDE_BASE_DIR/pyside-tools-0.1.3" pushd . cd $APIEXTRACTOR_DIR cmake . cd $GENERATORRUNNER_DIR cmake -DApiExtractor_DIR=$APIEXTRACTOR_DIR . cd $SHIBOKEN_DIR cmake -DApiExtractor_DIR=$APIEXTRACTOR_DIR -DGeneratorRunner_DIR=$GENERATORRUNNER_DIR . cd $PYSIDE_DIR cmake -DShiboken_DIR=$SHIBOKEN_DIR/libshiboken -DGENERATOR=$GENERATORRUNNER_DIR . cd $PYSIDE_TOOLS_DIR cmake . popd Now, I don't know if this installation script is ok, but apparently everything works fine. Each component (apiextractor, generatorrunner, shiboken, pyside-qt and pyside-tools) gets compiled into its own directory. The problem is that I don't quite understand how PySide gets into the system's python environment. In fact, when I start a python shell, I cannot import PySide: >>> import PySide Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named PySide Note: I am aware of the Installing PySide - OSX question, but that question is not relevant anymore, because it is about a specific a dependency on the Boost libraries, but with version 0.3.0 PySide moved from a Boost based source code to a CPython one.

    Read the article

  • Error in {% markdown %} filter in Django Nonrel

    - by Robert Smith
    I'm having trouble using Markdown in Django Nonrel. I followed this instructions (added 'django.contrib.markup' to INSTALLED_APPS, include {% load markup %} in the template and use |markdown filter after installing python-markdown) but I get the following error: Error in {% markdown %} filter: The Python markdown library isn't installed. In this line: /path/to/project/django/contrib/markup/templatetags/markup.py in markdown they will be silently ignored. """ try: import markdown except ImportError: if settings.DEBUG: raise template.TemplateSyntaxError("Error in {% markdown %} filter: The Python markdown library isn't installed.") ... return force_unicode(value) else: # markdown.version was first added in 1.6b. The only version of markdown # to fully support extensions before 1.6b was the shortlived 1.6a. if hasattr(markdown, 'version'): extensions = [e for e in arg.split(",") if e] It seems obvious that import markdown is causing the problem but when I run: $ python manage.py shell >>> import elementtree >>> import markdown everthing works alright. Running Markdown 2.0.3, Django 1.3.1, Python 2.7. UPDATE: I thought maybe this was an issue related to permissions, so I changed my project via chmod 777 -R, but it didn't work. Ideas? Thanks!

    Read the article

  • mysql-python stopped working

    - by MAC
    This is a rather dumb question but i'am looking at a bizarre situation. I am running fedora and have python 2.6.5 installed. The other day i installed MySQL-python using yum (because i do not have the setuptools module so i cannot build it from source). Anyway yesterday i wrote my entire data access layer in python and it was running fine, i did test it. Today however it gives me an ImportError: No module named MySQLdb The only thing i ever changed was i installed eclipse and pyDev. Any ideas on what went wrong and how i fix it. I tried removing and re-installing MySql-python but that did not help. I did the following import sys print sys.path And it shows me all the paths which are basically pertaining to /usr/local/lib/python2.6 However i was trying to find where the MySQLdb module is installed and it seems that its installed in /usr/lib/python2.5/sitepackages Now i have no idea why it got installed there and why it was working earlier and why it stopped working now. Any ideas on how i should fix it. I did try copying the site-packages folder over to the python2.6 folder but that did not work Help!!

    Read the article

  • Full-text search on App Engine with Whoosh

    - by Martin
    I need to do full text searching with Google App Engine. I found the project Whoosh and it works really well, as long as I use the App Engine Development Environement... When I upload my application to App Engine, I am getting the following TraceBack. For my tests, I am using the example application provided in this project. Any idea of what I am doing wrong? <type 'exceptions.ImportError'>: cannot import name loads Traceback (most recent call last): File "/base/data/home/apps/myapp/1.334374478538362709/hello.py", line 6, in <module> from whoosh import store File "/base/data/home/apps/myapp/1.334374478538362709/whoosh/__init__.py", line 17, in <module> from whoosh.index import open_dir, create_in File "/base/data/home/apps/myapp/1.334374478538362709/whoosh/index.py", line 31, in <module> from whoosh import fields, store File "/base/data/home/apps/myapp/1.334374478538362709/whoosh/store.py", line 27, in <module> from whoosh import tables File "/base/data/home/apps/myapp/1.334374478538362709/whoosh/tables.py", line 43, in <module> from marshal import loads Here is the import I have in my Python file. # Whoosh ---------------------------------------------------------------------- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'utils'))) from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT from whoosh.index import getdatastoreindex from whoosh.qparser import QueryParser, MultifieldParser Thank you in advance for your help!

    Read the article

  • Troubles with PyDev and external libraries in OS X

    - by Davide Gualano
    I've successfully installed the latest version of PyDev in my Eclipse (3.5.1) under OS X 10.6.3, with python 2.6.1 I have troubles in making the libraries I have installed work. For example, I'm trying to use the cx_Oracle library, which is perfectly working if called from the python interpeter of from simple scripts made with some text editor. But I cant make it work inside Eclipse: I have this small piece of code: import cx_Oracle conn = cx_Oracle.connect(CONN_STRING) sql = "select field from mytable" cursor = conn.cursor() cursor.execute(sql) for row in cursor: field = row[0] print field If I execute it from Eclipse, I get the following error: import cx_Oracle File "build/bdist.macosx-10.6-universal/egg/cx_Oracle.py", line 7, in <module> File "build/bdist.macosx-10.6-universal/egg/cx_Oracle.py", line 6, in __bootstrap__ ImportError: dlopen(/Users/dave/.python-eggs/cx_Oracle-5.0.3-py2.6-macosx-10.6-universal.egg-tmp/cx_Oracle.so, 2): Library not loaded: /b/227/rdbms/lib/libclntsh.dylib.10.1 Referenced from: /Users/dave/.python-eggs/cx_Oracle-5.0.3-py2.6-macosx-10.6-universal.egg-tmp/cx_Oracle.so Reason: no suitable image found. Did find: /Users/dave/lib/libclntsh.dylib.10.1: mach-o, but wrong architecture Same snippet works perfectly from the python shell I have configured the interpeter in Eclipse in preferences - PyDev -- Interpreter - Python, using the Auto Config option and selecting all the libs found. What am I doing wrong here? Edit: launching file /Users/dave/.python-eggs/cx_Oracle-5.0.3-py2.6-macosx-10.6-universal.egg-tmp/cx_Oracle.so from the command line tells this: /Users/dave/.python-eggs/cx_Oracle-5.0.3-py2.6-macosx-10.6-universal.egg-tmp/cx_Oracle.so: Mach-O universal binary with 3 architectures /Users/dave/.python-eggs/cx_Oracle-5.0.3-py2.6-macosx-10.6-universal.egg-tmp/cx_Oracle.so (for architecture i386): Mach-O bundle i386 /Users/dave/.python-eggs/cx_Oracle-5.0.3-py2.6-macosx-10.6-universal.egg-tmp/cx_Oracle.so (for architecture ppc7400): Mach-O bundle ppc /Users/dave/.python-eggs/cx_Oracle-5.0.3-py2.6-macosx-10.6-universal.egg-tmp/cx_Oracle.so (for architecture x86_64): Mach-O 64-bit bundle x86_64

    Read the article

  • Having a Python package install itself under a different name

    - by cool-RR
    I'm developing a package called garlicsim. (Website.) The package is intended for Python 2.X, but I am also offerring Python 3 support on a different fork called garlicsim_py3.(1) So both of these packages live side by side on PyPI, and Python 3 users install garlicsim_py3, and Python 2 users install garlicsim. The problem is: When third party modules want to use garlicsim, they should have one package name to refer to, not two. Sure, they can do something like this: try: import garlicsim except ImportError: import garlicsim_py3 as garlicsim But I would prefer not to make the developers of these modules do this. Is there a way that garlicsim_py3 will install itself under the alias garlicsim? What I want is for a Python 3 user to be able to import garlicsim and refer to the module all the time as garlicsim, but that it will really be garlicsim_py3. I know that the Distribute project does something like this: They make it so you can import setuptools and it will be redirected into their code. I have no idea how they do it. Any ideas? (1) I've reached the decision to support Python 3 on a fork instead of in the same code base; It's important for me that the code base will be clean, and I would really not want to introduce compatibilty hacks.

    Read the article

  • virtualenv macosX --no-site-package ignored

    - by Tristram Gräbener
    Hello, I'm having problems with macOSX and virtualenv. It seems to ignore --no-site-package. Using exactly the same commands with linux (archlinux) it works. It it macOSX 10.5 with python 2.5 curl -o virtualenv.py 'http://bitbucket.org/ianb/virtualenv/raw/tip/virtualenv.py Create a new environment python virtualenv.py --no-site-packages foo New python executable in foo/bin/python Installing setuptools...........................done. Activate it source foo/bin/activate Try to install something in it. Despite virtualenv it looks for the system-wide install easy_install cherrypy Searching for cherrypy Best match: CherryPy 3.1.2 Adding CherryPy 3.1.2 to easy-install.pth file Using /Library/Python/2.5/site-packages Processing dependencies for cherrypy Finished processing dependencies for cherrypy Yet it doesn't find the module (foo)guidage-multimodal:~ tristram$ python Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import cherrypy Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named cherrypy I tried PIP after looking at http://stackoverflow.com/questions/1382925/virtualenv-no-site-packages-and-pip-still-finding-global-packages However it fails installing psycopg2 (some problems with gcc). Also I would like to be able to have a setup.py (from distribute) that does the whole woork

    Read the article

  • Debugging Django project problem.

    - by Wasim
    Hi all, I asked this question before, but had no replies, maybe I wasn't so clear. I'm trying to debug a django project using MySQL database. If I run the admin or trying to use the shell to communicate to the data base every thing is well and I can do every thing. I installed MySQLdb for Python 2.6. I installed PyDev on my Apatana studio. Configured the Debugging with runserver 8001 --noreload. When I start debugging , When I arrive to the following code in C:\Python26\Lib\site-packages\django\db\backends\mysql\base.py try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) I get an import error : django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: DLL load failed: The specified module could not be found. I trying to ge more deeply with the import MySQLdb as Database line , it goes to the C:\Python26\Lib\site-packages\MySQLdb__init__.py and fail in the line import _mysql. I can't understand the problem. When running the Django admin every thing is ok, but with debugging it fails to work. Any help please. Thanks in advance.

    Read the article

  • Django and Google App Engine Helper not finding the ipaddr module.

    - by Phil
    I'm trying to get Django running on GAE using this tutorial. When I run python manage.py runserver I get the stacktrace below. I'm new to both django and python so I don't know what my next steps are (This is Ubuntu Jaunty btw). It seems django isn't finding the GAE module ipaddr which comes with SDK 1.3.1. How do I get django to find this module? /home/username/bin/google_appengine/google/appengine/api/datastore_file_stub.py:40: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5 /home/username/bin/google_appengine/google/appengine/api/memcache/__init__.py:31: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha Traceback (most recent call last): File "manage.py", line 18, in <module> InstallAppengineHelperForDjango() File "/home/username/Development/GAE/myapp/appengine_django/__init__.py", line 543, in InstallAppengineHelperForDjango InstallDjangoModuleReplacements() File "/home/username/Development/GAE/myapp/appengine_django/__init__.py", line 260, in InstallDjangoModuleReplacements import django.db File "/home/username/Development/GAE/myapp/django/db/__init__.py", line 57, in <module> 'TIME_ZONE': settings.TIME_ZONE, File "/home/username/Development/GAE/myapp/appengine_django/db/base.py", line 117, in __init__ self._setup_stubs() File "/home/username/Development/GAE/myapp/appengine_django/db/base.py", line 128, in _setup_stubs from google.appengine.tools import dev_appserver_main File "/home/username/bin/google_appengine/google/appengine/tools/dev_appserver_main.py", line 82, in <module> from google.appengine.tools import appcfg File "/home/username/bin/google_appengine/google/appengine/tools/appcfg.py", line 53, in <module> from google.appengine.api import dosinfo File "/home/username/bin/google_appengine/google/appengine/api/dosinfo.py", line 25, in <module> import ipaddr ImportError: No module named ipaddr

    Read the article

  • gevent install on x86_64 fails: "undefined symbol: evhttp_accept_socket"

    - by digitala
    I'm trying to install gevent on a fresh EC2 CentOS 5.3 64-bit system. Since the libevent version available in yum was too old for another package (beanstalkd) I compiled/installed libevent-1.4.13-stable manually using the following command: ./configure --prefix=/usr && make && make install This is the output from installing gevent: [gevent-0.12.2]# python setup.py build --libevent /usr/lib Using libevent 1.4.13-stable: libevent.so running build running build_py running build_ext Linking /usr/src/gevent-0.12.2/build/lib.linux-x86_64-2.6/gevent/core.so to /usr/src/gevent-0.12.2/gevent/core.so [gevent-0.12.2]# cd /path/to/my/project [project]# python myscript.py Traceback (most recent call last): File "myscript.py", line 9, in <module> from gevent.wsgi import WSGIServer as GeventServer File "/usr/lib/python2.6/site-packages/gevent/__init__.py", line 32, in <module> from gevent.core import reinit ImportError: /usr/lib/python2.6/site-packages/gevent/core.so: undefined symbol: evhttp_accept_socket I've followed exactly the same steps on a local VirtualBox instance (32-bit) and I'm not seeing any errors. How would I fix this?

    Read the article

  • python __import__() imports from 2 different directories when same module exists in 2 locations

    - by programer_gramer
    Hi, I have a python application , which has directory structure like this. -pythonapp -mainpython.py -module1 -submodule1 -file1.py -file2.py -submodule2 -file3.py -file3.py -submodule3 -file1.py -file2.py -file5.py -file6.py -file7.py when I try to import the python utilities(from mainpython.py) under submodule3 , I get the initial 2 files from submodule1.(please note that submodule1 and 3 have 2 different files with the same name). However the same import works fine when there is no conflict i.e it correctly imports file 5,6,7 from submodule3. Here is the code : name=os.path.splitext(os.path.split("module1\submodule3\file1.py")[1])[0] -- file1.py name here is passed dynamically. module = import(name) //Here is name is like "file1" it works(but with the above said issue, though, when passes the name of the file dynamically), but if I pass complete package as "module1.submodule1.file1" it fails with an ImportError saying that "no module with name file1" Now the question is how do we tell the interpreter to use only the ones under "module1.submodule3.file2"? I am using python This is really urgent one and I have run out of all the tries. Hope some experienced python developers can solve this for me?

    Read the article

  • Python import error: Symbol not found, but the symbol is present in the file

    - by Autopulated
    I get this error when I try to import ssrc.spread: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ssrc/_spread.so, 2): Symbol not found: __ZN17ssrcspread_v1_0_67Mailbox11ZeroTimeoutE The file in question (_spread.so) includes the symbol: $ nm _spread.so | grep _ZN17ssrcspread_v1_0_67Mailbox11ZeroTimeoutE U __ZN17ssrcspread_v1_0_67Mailbox11ZeroTimeoutE U __ZN17ssrcspread_v1_0_67Mailbox11ZeroTimeoutE (twice because the file is a fat ppc/x86 binary) The archive header information of _spread.so is: $ otool -fahv _spread.so Fat headers fat_magic FAT_MAGIC nfat_arch 2 architecture ppc7400 cputype CPU_TYPE_POWERPC cpusubtype CPU_SUBTYPE_POWERPC_7400 capabilities 0x0 offset 4096 size 235272 align 2^12 (4096) architecture i386 cputype CPU_TYPE_I386 cpusubtype CPU_SUBTYPE_I386_ALL capabilities 0x0 offset 241664 size 229360 align 2^12 (4096) /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ssrc/_spread.so (architecture ppc7400): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC PPC ppc7400 0x00 BUNDLE 10 1420 NOUNDEFS DYLDLINK BINDATLOAD TWOLEVEL WEAK_DEFINES BINDS_TO_WEAK /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ssrc/_spread.so (architecture i386): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC I386 ALL 0x00 BUNDLE 11 1604 NOUNDEFS DYLDLINK BINDATLOAD TWOLEVEL WEAK_DEFINES BINDS_TO_WEAK And my python is python 2.6.4: $ which python | xargs otool -fahv Fat headers fat_magic FAT_MAGIC nfat_arch 2 architecture ppc cputype CPU_TYPE_POWERPC cpusubtype CPU_SUBTYPE_POWERPC_ALL capabilities 0x0 offset 4096 size 9648 align 2^12 (4096) architecture i386 cputype CPU_TYPE_I386 cpusubtype CPU_SUBTYPE_I386_ALL capabilities 0x0 offset 16384 size 13176 align 2^12 (4096) /Library/Frameworks/Python.framework/Versions/2.6/bin/python (architecture ppc): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC PPC ALL 0x00 EXECUTE 11 1268 NOUNDEFS DYLDLINK TWOLEVEL /Library/Frameworks/Python.framework/Versions/2.6/bin/python (architecture i386): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC I386 ALL 0x00 EXECUTE 11 1044 NOUNDEFS DYLDLINK TWOLEVEL There seems to be a difference in the ppc architecture in the files, but I'm running on an intel, so I don't see why this should cause a problem. So why might the symbol not be found?

    Read the article

  • Django 'ImproperlyConfigured' error after deployment on google app engine

    - by oreon
    Hello, I'm currently trying to get my first django project running on Google App Engine. I followed the instructions given here http://www.allbuttonspressed.com/projects/djangoappengine as best I could. Unfortunately I have run into some issues. Locally everything runs fine, no problems. I then tried to deploy my project to the cloud. This is where I'm totally stuck. I always receive 500 Server Errors coupled with google.appengine.runtime.DeadlineExceededError's. Every now and then I get the following error message in my logs, which I think is the root of the problem : <class 'django.core.exceptions.ImproperlyConfigured'>: ImportError projectyalanda.pricecompare: No module named projectyalanda.pricecompare Obviously something is wrong in the way I reference my django app. Why this is only an issue in the cloud is a mystery to me. The interesting part in the settings.py file is setup as following: INSTALLED_APPS = ( 'djangotoolbox', # 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'projectyalanda.pricecompare', ) I absolutely can't figure out why django/appengine wouldn't be able to find the module, especially since everything works perfectly locally. So where else can I look? The local folder structure is of course also correct as automatically done by django, so maybe something is messed up during deployment? How would I be able to find out? Please help me ;-) Thanks

    Read the article

< Previous Page | 6 7 8 9 10 11 12  | Next Page >