Search Results

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

Page 12/12 | < Previous Page | 8 9 10 11 12 

  • python/pip error on osx

    - by Ibrahim Chawa
    I've recently purchased a new hard drive and installed a clean copy of OS X Mavericks. I installed python using homebrew and i need to create a python virtual environment. But when ever i try to run any command using pip, I get this error. I haven't been able to find a solution online for this problem. Any reference would be appreciated. Here is the error I'm getting. ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha1 ERROR:root:code for hash sha224 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha384 ERROR:root:code for hash sha512 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha512 Traceback (most recent call last): File "/usr/local/bin/pip", line 9, in <module> load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 356, in load_entry_point File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2439, in load_entry_point File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2155, in load File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py", line 10, in <module> from pip.util import get_installed_distributions, get_prog File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 18, in <module> from pip._vendor.distlib import version File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/distlib/version.py", line 14, in <module> from .compat import string_types File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in <module> from urllib2 import (Request, urlopen, URLError, HTTPError, ImportError: cannot import name HTTPSHandler If you need any extra information from me let me know, this is my first time posting a question here. Thanks.

    Read the article

  • Python bindings for a vala library

    - by celil
    I am trying to create python bindings to a vala library using the following IBM tutorial as a reference. My initial directory has the following two files: test.vala using GLib; namespace Test { public class Test : Object { public int sum(int x, int y) { return x + y; } } } test.override %% headers #include <Python.h> #include "pygobject.h" #include "test.h" %% modulename test %% import gobject.GObject as PyGObject_Type %% ignore-glob *_get_type %% and try to build the python module source test_wrap.c using the following code build.sh #/usr/bin/env bash valac test.vala -CH test.h python /usr/share/pygobject/2.0/codegen/h2def.py test.h > test.defs pygobject-codegen-2.0 -o test.override -p test test.defs > test_wrap.c However, the last command fails with an error $ ./build.sh Traceback (most recent call last): File "/usr/share/pygobject/2.0/codegen/codegen.py", line 1720, in <module> sys.exit(main(sys.argv)) File "/usr/share/pygobject/2.0/codegen/codegen.py", line 1672, in main o = override.Overrides(arg) File "/usr/share/pygobject/2.0/codegen/override.py", line 52, in __init__ self.handle_file(filename) File "/usr/share/pygobject/2.0/codegen/override.py", line 84, in handle_file self.__parse_override(buf, startline, filename) File "/usr/share/pygobject/2.0/codegen/override.py", line 96, in __parse_override command = words[0] IndexError: list index out of range Is this a bug in pygobject, or is something wrong with my setup? What is the best way to call code written in vala from python? EDIT: Removing the extra line fixed the current problem, but now as I proceed to build the python module, I am facing another problem. Adding the following C file to the existing two in the directory: test_module.c #include <Python.h> void test_register_classes (PyObject *d); extern PyMethodDef test_functions[]; DL_EXPORT(void) inittest(void) { PyObject *m, *d; init_pygobject(); m = Py_InitModule("test", test_functions); d = PyModule_GetDict(m); test_register_classes(d); if (PyErr_Occurred ()) { Py_FatalError ("can't initialise module test"); } } and building with the following script build.sh #/usr/bin/env bash valac test.vala -CH test.h python /usr/share/pygobject/2.0/codegen/h2def.py test.h > test.defs pygobject-codegen-2.0 -o test.override -p test test.defs > test_wrap.c CFLAGS="`pkg-config --cflags pygobject-2.0` -I/usr/include/python2.6/ -I." LDFLAGS="`pkg-config --libs pygobject-2.0`" gcc $CFLAGS -fPIC -c test.c gcc $CFLAGS -fPIC -c test_wrap.c gcc $CFLAGS -fPIC -c test_module.c gcc $LDFLAGS -shared test.o test_wrap.o test_module.o -o test.so python -c 'import test; exit()' results in an error: $ ./build.sh ***INFO*** The coverage of global functions is 100.00% (1/1) ***INFO*** The coverage of methods is 100.00% (1/1) ***INFO*** There are no declared virtual proxies. ***INFO*** There are no declared virtual accessors. ***INFO*** There are no declared interface proxies. Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: ./test.so: undefined symbol: init_pygobject Where is the init_pygobject symbol defined? What have I missed linking to?

    Read the article

  • Accessing Python module fails although its package is imported

    - by codethief
    Hey Stackers! :) My Django project's directory hierarchy looks like this: + pybsd |---+ devices |---+ templates |---+ views |---+ interaction |---- __init__.py |---- geraete.py |---- geraetemodelle.py |---- geraetegruppen.py |---- __init__.py |---- ajax.py |---- html.py |---- misc.py |---- __init__.py |---- urls.py |---- __init__.py |---- urls.py (Please excuse the German names. I preferred not to replace them here since it would add yet another possible error source when trying out the solutions you'll hopefully suggest and answering your questions.) Every request to http://URL/devices/.* is dispatched to the urls.py file living in /devices: # ... from views import html, ajax, misc, interaction urlpatterns = patterns('', # ... (r'^ajax/update/(?P<table>[a-z_]+)$', ajax.update), (r'^ajax/delete/(?P<table>[a-z_]+)$', ajax.delete), (r'^ajax/select_options/(?P<table>[a-z_]+)$', ajax.select_options), (r'^interaction/geraete/info/(?P<geraet>\d+)$', interaction.geraete.info), (r'^interaction/geraete/delete/(?P<geraet>\d+)?$', interaction.geraete.delete), (r'^interaction/geraetemodelle/delete/(?P<geraetemodell>\d+)?$', interaction.geraetemodelle.delete), (r'^interaction/geraetegruppen/delete/(?P<geraetegruppe>\d+)?$', interaction.geraetegruppen.delete), # ... ) All URL definitions work except for those referencing the interaction package. I'm constantly getting the following error: File "/home/simon/projekte/pybsd/../pybsd/devices/urls.py", line 33, in `<module>` (r'^interaction/geraete/info/(?P<geraet>\d+)$', interaction.geraete.info), AttributeError: 'module' object has no attribute 'geraete' I double-checked that the __init__.py files don't contain anything. Maybe you've already found the (Python- or Django-related?) mistake I made and am apparently unable to see. If not, read on. In any case, thanks for reading this long post! Isolating the problem 1st test It works if I provide the view functions as strings: (r'^interaction/geraete/info/(?P<geraet>\d+)$', 'devices.views.interaction.geraete.info'), (r'^interaction/geraete/delete/(?P<geraet>\d+)?$', 'devices.views.interaction.geraete.delete'), (r'^interaction/geraetemodelle/delete/(?P<geraetemodell>\d+)?$', 'devices.views.interaction.geraetemodelle.delete'), (r'^interaction/geraetegruppen/delete/(?P<geraetegruppe>\d+)?$', 'devices.views.interaction.geraetegruppen.delete'), ... or add yet another line to the imports: from views.interaction import geraete, geraetemodelle, geraetegruppen Using from views.interaction import *, however, doesn't work either and results in the same error message. 2nd test I created a file test.py in /devices: from views import interaction print dir(interaction) Output: simon@bsd-simon:~/projekte/pybsd/devices$ python test.py ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__'] Again, no sign of the modules I created in the interaction package (geraete.py, geraetemodelle.py, geraetegruppen.py). Unlike in urls.py, trying from view.interaction import geraete, geraetegruppen, geraetemodelle in test.py results in ImportError: No module named view.interaction this time. 3rd test I started the Django shell: $ python manage.py shell >>> import devices.views.interaction.geraete >>> dir(devices.views.interaction.geraete) ['Abteilung', 'Auftrag', 'Auftragsvorlage', 'Geraet', 'Geraetegruppe', 'Geraetemodell', 'HttpResponse', 'HttpResponseBadRequest', 'HttpResponseRedirect', 'Raum', 'Standort', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'delete', 'info', 'models', 'move', 'render_to_response'] >>> $ python manage.py shell >>> from devices.views.interaction import geraete >>> dir(geraete) ['Abteilung', 'Auftrag', 'Auftragsvorlage', 'Geraet', 'Geraetegruppe', 'Geraetemodell', 'HttpResponse', 'HttpResponseBadRequest', 'HttpResponseRedirect', 'Raum', 'Standort', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'delete', 'info', 'models', 'move', 'render_to_response'] >>> $ python manage.py shell >>> import devices.views.interaction >>> devices.views.interaction.geraete Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'module' object has no attribute 'geraete' >>> dir(devices.views.interaction) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']

    Read the article

  • Can't import my module when start my twisted application under root

    - by kepkin
    Here is absolutely minimal application so you could try to reproduce it on your machine. Having two files for example in /home/aln/tmp/tw_test: server.tac MyLib.py MyLib.py class Solver(object): def solve(self): """ do extremely complex stuff here """ print "Hello from solve" server.tac #!/usr/bin/python import MyLib from twisted.application import internet, service from twisted.internet import protocol, reactor, defer, utils, threads from twisted.protocols import basic class MyProtocol(basic.LineReceiver): def lineReceived(self, line): if line=="new job": self.transport.write("started a job" + '\r\n') self.factory.run_defered() class MyFactory(protocol.ServerFactory, MyLib.Solver): protocol = MyProtocol def run_defered_helper(self): self.solve() def run_defered(self): d = threads.deferToThread(self.run_defered_helper) application = service.Application('MyApplication') factory = MyFactory() internet.TCPServer(1079, factory).setServiceParent(service.IServiceCollection(application)) Everything works fine when I start it under non-root user. aln@aln-laptop:tw_test$ twistd -ny server.tac 2010-03-03 22:42:55+0300 [-] Log opened. 2010-03-03 22:42:55+0300 [-] twistd 8.2.0 (/usr/bin/python 2.6.4) starting up. 2010-03-03 22:42:55+0300 [-] reactor class: twisted.internet.selectreactor.SelectReactor. 2010-03-03 22:42:55+0300 [-] <class 'MyFactory'> starting on 1079 2010-03-03 22:42:55+0300 [-] Starting factory <MyFactory object at 0x2d5ea50> 2010-03-03 22:42:59+0300 [MyProtocol,0,127.0.0.1] Hello from solve ^C2010-03-03 22:43:01+0300 [-] Received SIGINT, shutting down. 2010-03-03 22:43:01+0300 [-] (Port 1079 Closed) 2010-03-03 22:43:01+0300 [-] Stopping factory <MyFactory object at 0x2d5ea50> 2010-03-03 22:43:01+0300 [-] Main loop terminated. 2010-03-03 22:43:02+0300 [-] Server Shut Down. But if try to start it under root (which is going to happen in my real application) I receive the following exception: aln@aln-laptop:tw_test$ sudo twistd -ny server.tac [sudo] password for aln: Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 694, in run runApp(config) File "/usr/lib/python2.6/dist-packages/twisted/scripts/twistd.py", line 23, in runApp _SomeApplicationRunner(config).run() File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 411, in run self.application = self.createOrGetApplication() File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 494, in createOrGetApplication application = getApplication(self.config, passphrase) --- <exception caught here> --- File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 505, in getApplication application = service.loadApplication(filename, style, passphrase) File "/usr/lib/python2.6/dist-packages/twisted/application/service.py", line 390, in loadApplication application = sob.loadValueFromFile(filename, 'application', passphrase) File "/usr/lib/python2.6/dist-packages/twisted/persisted/sob.py", line 215, in loadValueFromFile exec fileObj in d, d File "server.tac", line 2, in <module> import MyLib exceptions.ImportError: No module named MyLib Failed to load application: No module named MyLib If I try to load MyLib module in the python intepreter under root, it works fine: aln@aln-laptop:tw_test$ sudo python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MyLib >>> import sys >>> print(sys.path) ['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/local/lib/python2.6/dist-packages'] >>> sys.path is absolutely the same for aln user. I tried sudo -E too. Any suggestions?

    Read the article

  • Dynamically loading modules in Python (+ multi processing question)

    - by morpheous
    I am writing a Python package which reads the list of modules (along with ancillary data) from a configuration file. I then want to iterate through each of the dynamically loaded modules and invoke a do_work() function in it which will spawn a new process, so that the code runs ASYNCHRONOUSLY in a separate process. At the moment, I am importing the list of all known modules at the beginning of my main script - this is a nasty hack I feel, and is not very flexible, as well as being a maintenance pain. This is the function that spawns the processes. I will like to modify it to dynamically load the module when it is encountered. The key in the dictionary is the name of the module containing the code: def do_work(work_info): for (worker, dataset) in work_info.items(): #import the module defined by variable worker here... # [Edit] NOT using threads anymore, want to spawn processes asynchronously here... #t = threading.Thread(target=worker.do_work, args=[dataset]) # I'll NOT dameonize since spawned children need to clean up on shutdown # Since the threads will be holding resources #t.daemon = True #t.start() Question 1 When I call the function in my script (as written above), I get the following error: AttributeError: 'str' object has no attribute 'do_work' Which makes sense, since the dictionary key is a string (name of the module to be imported). When I add the statement: import worker before spawning the thread, I get the error: ImportError: No module named worker This is strange, since the variable name rather than the value it holds are being used - when I print the variable, I get the value (as I expect) whats going on? Question 2 As I mentioned in the comments section, I realize that the do_work() function written in the spawned children needs to cleanup after itself. My understanding is to write a clean_up function that is called when do_work() has completed successfully, or an unhandled exception is caught - is there anything more I need to do to ensure resources don't leak or leave the OS in an unstable state? Question 3 If I comment out the t.daemon flag statement, will the code stil run ASYNCHRONOUSLY?. The work carried out by the spawned children are pretty intensive, and I don't want to have to be waiting for one child to finish before spawning another child. BTW, I am aware that threading in Python is in reality, a kind of time sharing/slicing - thats ok Lastly is there a better (more Pythonic) way of doing what I'm trying to do? [Edit] After reading a little more about Pythons GIL and the threading (ahem - hack) in Python, I think its best to use separate processes instead (at least IIUC, the script can take advantage of multiple processes if they are available), so I will be spawning new processes instead of threads. I have some sample code for spawning processes, but it is a bit trivial (using lambad functions). I would like to know how to expand it, so that it can deal with running functions in a loaded module (like I am doing above). This is a snippet of what I have: def do_mp_bench(): q = mp.Queue() # Not only thread safe, but "process safe" p1 = mp.Process(target=lambda: q.put(sum(range(10000000)))) p2 = mp.Process(target=lambda: q.put(sum(range(10000000)))) p1.start() p2.start() r1 = q.get() r2 = q.get() return r1 + r2 How may I modify this to process a dictionary of modules and run a do_work() function in each loaded module in a new process?

    Read the article

  • Deploying Django on EC2 using Bitnami Djangostack: WSGI script cannot be loadded

    - by Arman
    I've been struggling to deploy Django application on Amazon EC2 using Bitnami Djangostack for the last couple of days. When I go to http://dewey.io I see the default bitnami page (/opt/bitnami/apache2/htdocs/index.html), however, when I open http://dewey.io/portnoy, I get 'Internal Server Error'. But it's known that if mod_wsgi is setup correctly, the DocumentRoot value from httpd.conf is ignored, thus, I should see my Django application when accessing http://dewey.io. Essentially, the main error is this - 'Target WSGI script cannot be loaded as Python module'. Two questions: 1) any ideas how to fix these mod_wsgi errors (the Apache logs are below)? 2) how to disable the default /opt/bitnami/apache2/htdocs/index.html page and show my homepage from django application when accessing http://dewey.io? Thank you in advance! The details On my EC2 instance I"m running 64-bit Ubuntu 12.04 with DjangoStack 1.4-1. My Django project is located here - /opt/bitnami/apps/django/django_projects/portnoy. root@dewey:/opt/bitnami/apps/django/django_projects/portnoy# ls manage.py README.md settings.py site_media users Procfile sandbox static test.py topics urls.py views.py __init__.pyc templates testviews.py Apache error logs (/opt/bitnami/apache2/logs/error_log): [Wed Jul 04 02:29:00 2012] [error] [client 140.180.6.212] File does not exist: /opt/bitnami/apache2/htdocs/favicon.ico [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] mod_wsgi (pid=3990): Target WSGI script '/opt/bitnami/apps/django/scripts/django.wsgi' cannot be loaded as Python module. [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] mod_wsgi (pid=3990): Exception occurred processing WSGI script '/opt/bitnami/apps/django/scripts/django.wsgi'. [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] Traceback (most recent call last): [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] File "/opt/bitnami/apps/django/scripts/django.wsgi", line 8, in <module> [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] import django.core.handlers.wsgi [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] File "/opt/bitnami/apps/django/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 8, in <module> [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] from django import http [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] File "/opt/bitnami/apps/django/lib/python2.7/site-packages/django/http/__init__.py", line 119, in <module> [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] from django.http.multipartparser import MultiPartParser [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] File "/opt/bitnami/apps/django/lib/python2.7/site-packages/django/http/multipartparser.py", line 13, in <module> [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] from django.utils.text import unescape_entities [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] File "/opt/bitnami/apps/django/lib/python2.7/site-packages/django/utils/text.py", line 4, in <module> [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] from gzip import GzipFile [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] File "/opt/bitnami/python/lib/python2.7/gzip.py", line 10, in <module> [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] import io [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] File "/opt/bitnami/python/lib/python2.7/io.py", line 60, in <module> [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] import _io [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] ImportError: /opt/bitnami/python/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyUnicodeUCS2_AsEncodedString [Wed Jul 04 02:29:15 2012] [error] [client 140.180.6.212] File does not exist: /opt/bitnami/apache2/htdocs/favicon.ico [Wed Jul 04 02:44:00 2012] [error] [client 140.180.6.212] File does not exist: /opt/bitnami/apache2/htdocs/favicon.ico Let me quickly introduce the contents of the files to make the case more concrete. This is my /etc/apache2/sites-available/default file <VirtualHost *:80> ServerAdmin [email protected] ServerName dewey.io Alias /site_media/ /opt/bitnami/apps/django/django_projects/portnoy/site_media/ Alias /static/ /opt/bitnami/apps/django/lib/python2.7/site-packages/django/contrib/admin/static/ Alias /robots.txt /opt/bitnami/apps/django/django_projects/portnoy/site_media/robots.txt Alias /favicon.ico /opt/bitnami/apps/django/django_projects/portnoy/site_media/favicon.ico CustomLog "|/usr/sbin/rotatelogs /opt/bitnami/apps/django/django_projects/logs/access.log.%Y%m%d-%H%M%S 5M" combined ErrorLog "|/usr/sbin/rotatelogs /opt/bitnami/apps/django/django_projects/logs/error.log.%Y%m%d-%H%M%S 5M" LogLevel warn WSGIProcessGroup dewey.io WSGIScriptAlias / /opt/bitnami/apps/django/scripts/django.wsgi <Directory /opt/bitnami/apps/django/django_projects/portnoy/site_media> Order deny,allow Allow from all Options -Indexes FollowSymLinks </Directory> <Directory /opt/bitnami/apps/django/django_projects/portnoy/conf/apache> Order deny,allow Allow from all </Directory> </VirtualHost> This is my /opt/bitnami/apps/django/scripts/django.wsgi file import os, sys sys.path.append('/opt/bitnami/apps/django/lib/python2.7/site-packages/') sys.path.append('/opt/bitnami/apps/django/django_projects') sys.path.append('/opt/bitnami/apps/django/django_projects/portnoy') os.environ['DJANGO_SETTINGS_MODULE'] = 'portnoy.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() Here is the relevant portion of /opt/bitnami/apache2/conf/httpd.conf file: ServerRoot "/opt/bitnami/apache2" Listen 80 ServerName dewey.io DocumentRoot "/opt/bitnami/apache2/htdocs" LoadModule wsgi_module modules/mod_wsgi.so WSGIPythonHome /opt/bitnami/python Include "/opt/bitnami/apache2/conf/ssi.conf" Include "/opt/bitnami/apps/django/conf/django.conf" Include "/opt/bitnami/apache2/conf/bitnami/httpd.conf"

    Read the article

  • No module named sqlalchemy when installing ckanext-viewhelpers

    - by kean23
    I'm using CKAN as my open data portal and am trying to install the ckanext-viewhelpers Extension by following the instructions at https://github.com/ckan/ckanext-viewhelpers. /usr/lib/ckan/default/src/ckanext-viewhelpers-master$ sudo python setup.py installChecking .pth file support in /usr/local/lib/python2.7/dist-packages/ /usr/bin/python -E -c pass TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files running bdist_egg running egg_info writing ckanext_viewhelpers.egg-info/PKG-INFO writing namespace_packages to ckanext_viewhelpers.egg-info/namespace_packages.txt writing top-level names to ckanext_viewhelpers.egg-info/top_level.txt writing dependency_links to ckanext_viewhelpers.egg-info/dependency_links.txt writing entry points to ckanext_viewhelpers.egg-info/entry_points.txt reading manifest file 'ckanext_viewhelpers.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'ckanext_viewhelpers.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/ckanext copying build/lib.linux-x86_64-2.7/ckanext/__init__.py -> build/bdist.linux-x86_64/egg/ckanext creating build/bdist.linux-x86_64/egg/ckanext/viewhelpers copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/plugin.py -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/__init__.py -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers creating build/bdist.linux-x86_64/egg/ckanext/viewhelpers/tests copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/tests/__init__.py -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers/tests copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/tests/test_view.py -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers/tests creating build/bdist.linux-x86_64/egg/ckanext/viewhelpers/public creating build/bdist.linux-x86_64/egg/ckanext/viewhelpers/public/vendor copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/public/vendor/queryStringToJSON.js -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers/public/vendor copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/public/resource.config -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers/public copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/public/filters_form.css -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers/public copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/public/filters.js -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers/public copying build/lib.linux-x86_64-2.7/ckanext/viewhelpers/public/filters_form.js -> build/bdist.linux-x86_64/egg/ckanext/viewhelpers/public byte-compiling build/bdist.linux-x86_64/egg/ckanext/__init__.py to __init__.pyc byte-compiling build/bdist.linux-x86_64/egg/ckanext/viewhelpers/plugin.py to plugin.pyc byte-compiling build/bdist.linux-x86_64/egg/ckanext/viewhelpers/__init__.py to __init__.pyc byte-compiling build/bdist.linux-x86_64/egg/ckanext/viewhelpers/tests/__init__.py to __init__.pyc byte-compiling build/bdist.linux-x86_64/egg/ckanext/viewhelpers/tests/test_view.py to test_view.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying ckanext_viewhelpers.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying ckanext_viewhelpers.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying ckanext_viewhelpers.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying ckanext_viewhelpers.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying ckanext_viewhelpers.egg-info/namespace_packages.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying ckanext_viewhelpers.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO copying ckanext_viewhelpers.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO creating 'dist/ckanext_viewhelpers-0.1-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing ckanext_viewhelpers-0.1-py2.7.egg removing '/usr/local/lib/python2.7/dist-packages/ckanext_viewhelpers-0.1-py2.7.egg' (and everything under it) creating /usr/local/lib/python2.7/dist-packages/ckanext_viewhelpers-0.1-py2.7.egg Extracting ckanext_viewhelpers-0.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages ckanext-viewhelpers 0.1 is already the active version in easy-install.pth Installed /usr/local/lib/python2.7/dist-packages/ckanext_viewhelpers-0.1-py2.7.egg Processing dependencies for ckanext-viewhelpers==0.1 Finished processing dependencies for ckanext-viewhelpers==0.1 However I am faced with this error which I could not solve after adding viewhelpers in my CKAN config file. paster serve /etc/ckan/default/development.ini Traceback (most recent call last): File "/usr/bin/paster", line 4, in <module> command.run() File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line 104, in run invoke(command, command_name, options, args[1:]) File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line 143, in invoke exit_code = runner.run(args) File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line 238, in run result = self.command() File "/usr/lib/python2.7/dist-packages/paste/script/serve.py", line 284, in command relative_to=base, global_conf=vars) File "/usr/lib/python2.7/dist-packages/paste/script/serve.py", line 321, in loadapp **kw) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp return loadobj(APP, uri, name=name, **kw) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 271, in loadobj global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig return loader.get_context(object_type, name, global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 454, in get_context section) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 476, in _context_from_use object_type, name=use, global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 406, in get_context global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg return loader.get_context(object_type, name, global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 620, in get_context object_type, name=name) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 646, in find_egg_entry_point possible.append((entry.load(), protocol, entry.name)) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 9, in <module> import sqlalchemy as sa ImportError: No module named sqlalchemyckanext-viewhelpers

    Read the article

< Previous Page | 8 9 10 11 12