ImportError: No module named exceptions - exception

i'm trying to install kitsune in the ubuntu terminal. I am not able to initialize the database. When i give the command ./manage.py syncdb --migrate , i get the following error
Error: Tried importing 'settings_local.py' and 'settings.py' but neither could be found (or they're throwing an ImportError). Please come back and try again later.Traceback (most recent call last):
File "./manage.py", line 30, in <module>
from kitsune import settings # Assumed to be in the same directory.
File "/home/user/kitsune/kitsune/settings.py", line 740, in <module>
import djcelery
File "/usr/local/lib/python2.7/dist-packages/djcelery/__init__.py", line 22, in <module>
from celery import current_app as celery # noqa
File "/usr/local/lib/python2.7/dist-packages/celery/five.py", line 307, in __getattr__
module = __import__(self._object_origins[name], None, None, [name])
File "/usr/local/lib/python2.7/dist-packages/celery/_state.py", line 20, in <module>
from celery.utils.threads import LocalStack
File "/usr/local/lib/python2.7/dist-packages/celery/utils/__init__.py", line 24, in
<module>
from celery.exceptions import CPendingDeprecationWarning, CDeprecationWarning
File "/usr/local/lib/python2.7/dist-packages/celery/exceptions.py", line 13, in <module>
from billiard.exceptions import ( # noqa
ImportError: No module named exceptions
I can't find the exceptions file in billiard. How do I fix this error?

I had this error with fabric. The error message was the same:
ImportError: No module named exceptions
It turned out to be my fabric was out of date. The error was resolved by upgrading fabric to the latest version (1.10) with:
$ sudo pip install fabric --upgrade
For your information, I am running Ubuntu 12.04 64-bit with Python 2.7.3

Exceptions should be a python file in a directory called billiard, for example, you create a file called exceptions.py and add the classes and methods that you need .. this can work around the problem.

You should follow kitsune installation process described in http://kitsune.readthedocs.org/en/latest/hacking_howto.html
There is a link to separate chapter on vendor-packages http://kitsune.readthedocs.org/en/latest/vendor.html#vendor-chapter. You should install all the vendor packages needed by kitsune including billiard and celery (your errors).

Related

I am encountering module loading problem in mysql

I will work with mysql, but it gives this error anyway. I did delete the module but it did not change, I loaded it differently, I could not solve the modules.
Traceback (most recent call last):
File "C:\Users\INAL\Desktop\Son Scriptler\mysql\mysql.py", line 1, in <module>
import mysql.connector
File "C:\Users\INAL\Desktop\Son Scriptler\mysql\mysql.py", line 1, in <module>
import mysql.connector
ModuleNotFoundError: No module named 'mysql.connector'; 'mysql' is not a package
You might not have the mysql-connector did you try installing it using pip?
pip3 install mysql-connector
The problem was that my project name was mysql.py and I solved the problem by changing the project name.

falcon gunicorn ImportError: No module named hparams

I have already been working on a source that I have already created using gunicorn and nginx so that multiple people can access it without any problems.
Previously, falcon was running as a .py, but https://www.digitalocean.com/community/tutorials/how-to-deploy-falcon-web-applications-with-gunicorn-and-nginx-on-ubuntu-16-04
There was a problem while referring to site
my program's name is demo_server.py
and that code includes
import argparse
import falcon
from hparams import hparams, hparams_debug_string
import os
from synthesizer import Synthesizer // model (train model)
and when I type like these
gunicorn -b localhost: 5000 demo: app --reload
, The following error appears.
Failed to read config file: demo_server.py Traceback (most recent call
last):   File
"/data/falcon_app/venv/lib/python3.5/site-packages/gunicorn/app/base.py",
line 93, in get_config_from_filename
    execfile_ (filename, cfg, cfg)   File "/data/falcon_app/venv/lib/python3.5/site-packages/gunicorn/compat.py",
line 72, in execfile
    return six.exec_ (code, * args)   File "demo_server.py", line 3, in
    from hparams import hparams, hparams_debug_string ImportError: No module named 'hparams'
How do I resolve this ImportError?
Thanks..
Most probably you have installed gunicorn which corresponds to python2.7 on your local machine and you had to use python3.x which contains site-packages to run your falcon application.
Try install gunicorn3
sudo apt install gunicorn3
and then
gunicorn3 demo_server:app
worked for me

Fiware keyrock installation

I have trouble installing and setting up keyrock development environment.
We have set up virtualenv and installed requirements according to this guide.
Everything seemed to be ok, but none of the fabric commands are working. Every time we try to run a fab command within cloned idm directory, this error appears:
Traceback (most recent call last):
File "/root/.virtualenvs/idm_tools/lib/python2.7/site-packages/fabric/main.py", line 658, in main docstring, callables, default = load_fabfile(fabfile)
File "/root/.virtualenvs/idm_tools/lib/python2.7/site-packages/fabric/main.py", line 165, in load_fabfile imported = importer(os.path.splitext(fabfile)[0])
File "/root/idm/fabfile.py", line 17, in <module> from deployment import keystone
File "/root/idm/deployment/keystone.py", line 25, in <module> from keystoneclient.v3 import client
File "/root/.virtualenvs/idm_tools/src/fiwareclient/keystoneclient/__init__.py", line 34, in <module> from keystoneclient import client
File "/root/.virtualenvs/idm_tools/src/fiwareclient/keystoneclient/client.py", line 13, in <module> from keystoneclient import discover
File "/root/.virtualenvs/idm_tools/src/fiwareclient/keystoneclient/discover.py", line 22, in <module> from keystoneclient.v2_0 import client as v2_client
File "/root/.virtualenvs/idm_tools/src/fiwareclient/keystoneclient/v2_0/__init__.py", line 1, in <module> from keystoneclient.v2_0.client import Client # noqa
File "/root/.virtualenvs/idm_tools/src/fiwareclient/keystoneclient/v2_0/client.py", line 23, in <module> from keystoneclient.v2_0 import ec2
File "/root/.virtualenvs/idm_tools/src/fiwareclient/keystoneclient/v2_0/ec2.py", line 16, in <module> from keystoneclient import base
File "/root/.virtualenvs/idm_tools/src/fiwareclient/keystoneclient/base.py", line 31, in <module> from keystoneclient.openstack.common.apiclient import base
File "/root/.virtualenvs/idm_tools/src/fiwareclient/keystoneclient/openstack/common/apiclient/base.py", line 29, in <module> from oslo.utils import strutils
ImportError: No module named oslo.utils
As far as I can see, oslo.utils is installed in /root/.virtualenvs/idm_tools/lib/python2.7/site-packages
A fix was committed on KeyRock's Github account fixing the package's namespace.
If you pull changes from github and run:
sudo python tools/install_venv.py
it should fix it.
You can check out the github issue here

ImportError: No module named google.appengine.ext

I have just got the release pipeline working with Google's push to deploy on App Engine.
I released that some of my unit tests were failing.
======================================================================
ERROR: Failure: ImportError (No module named google.appengine.ext)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 414, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/var/jenkins/workspace/deployment_5175583809994752_1410355681821/tests.py", line 9, in <module>
from cfc.search.nosqlhelper import set_meeting_date
File "/var/jenkins/workspace/deployment_5175583809994752_1410355681821/cfc/search/nosqlhelper.py", line 3, in <module>
from cfc.models.event import Event
File "/var/jenkins/workspace/deployment_5175583809994752_1410355681821/cfc/models/event.py", line 3, in <module>
from google.appengine.ext import ndb
ImportError: No module named google.appengine.ext
----------------------------------------------------------------------
Ran 1 test in 0.270s
I tried to run the following from python REPL in the VM containing Jenkins provisioned automatically via release pipeline in Google Developer Console.
from google.appengine.ext import ndb
I got the following error.
ImportError: No module named google.appengine.ext
I logged into the VM and noticed that the files are located at for instance:
var/lib/docker/aufs/mnt/bbc6deda44e4806c5c0e377df6f1109733e382e8531c1c9ed440084d8e98e3fe/google-cloud-sdk/platform/google_
appengine/google/appengine/ext/ndb/utils.py
How do I se the path universally in the VM ?

Error installing NLTK in Python 3.4

I'm transitioning to python 3.4 and trying to install NLTK.
Pyyaml and numpy are installed, setuptools and pip as well - all in the newest version- Win 7 64bit.
However, NLTK puzzles me with an error no matter how I try to install it. Here is the cmd-output of my last try. Btw, haven't changed the files in any way ;)
Does anyone know what I could do to get NLTK up and running?
C:\Python34\Scripts\nltk-3.0a4>python setup.py install
running install
Traceback (most recent call last):
File "setup.py", line 81, in <module>
zip_safe=True, # since normal files will be present too?
File "C:\Python34\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 65, i
n run
self.do_egg_install()
File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 101,
in do_egg_install
cmd.ensure_finalized() # finalize before bdist_egg munges install cmd
File "C:\Python34\lib\distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "C:\Python34\lib\site-packages\setuptools\command\easy_install.py", line
304, in finalize_options
self.index_url, search_path = self.shadow_path, hosts=hosts,
File "C:\Python34\lib\site-packages\setuptools\package_index.py", line 269, in
__init__
Environment.__init__(self,*args,**kw)
File "C:\Python34\lib\site-packages\pkg_resources.py", line 799, in __init__
self.scan(search_path)
File "C:\Python34\lib\site-packages\pkg_resources.py", line 829, in scan
self.add(dist)
File "C:\Python34\lib\site-packages\pkg_resources.py", line 849, in add
dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: str() < NoneType()
Sorry, sometimes its the most obvious things that work...
In this case, simply double clicking the setup.py file from the nltk folder, allowing windows to execute it with python and its installed beautifully.
Try to install it using the following command
C:\Python34\Scripts\nltk-3.0a4>setup.py install
Open Command Prompt (Run as Administrator). Use cd to navigate to the folder in which your downloaded nltk package is present. Then run the command python setup.py install. That's all.
Did you try updating the setuptools package:
pip3 install --upgrade setuptools