pythonanywhere wsgi module not found error - pythonanywhere

I´m trying to host a django web site on the pythonanywhere hosting service, but I´m getting the following error message:
2018-10-21 20:56:14,359: Error running WSGI application
2018-10-21 20:56:14,365: ModuleNotFoundError: No module named 'energiasc'
2018-10-21 20:56:14,365: File "/var/www/adrielw_pythonanywhere_com_wsgi.py", line 24, in <module>
2018-10-21 20:56:14,365: application = get_wsgi_application()
2018-10-21 20:56:14,365:
2018-10-21 20:56:14,365: File "/home/adrielw/.virtualenvs/my_env_django/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2018-10-21 20:56:14,366: django.setup(set_prefix=False)
2018-10-21 20:56:14,366:
2018-10-21 20:56:14,366: File "/home/adrielw/.virtualenvs/my_env_django/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
2018-10-21 20:56:14,366: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2018-10-21 20:56:14,366:
2018-10-21 20:56:14,366: File "/home/adrielw/.virtualenvs/my_env_django/lib/python3.6/site-packages/django/conf/__init__.py", line 57, in __getattr__
2018-10-21 20:56:14,366: self._setup(name)
2018-10-21 20:56:14,367:
2018-10-21 20:56:14,367: File "/home/adrielw/.virtualenvs/my_env_django/lib/python3.6/site-packages/django/conf/__init__.py", line 44, in _setup
2018-10-21 20:56:14,367: self._wrapped = Settings(settings_module)
2018-10-21 20:56:14,367:
2018-10-21 20:56:14,367: File "/home/adrielw/.virtualenvs/my_env_django/lib/python3.6/site-packages/django/conf/__init__.py", line 107, in __init__
2018-10-21 20:56:14,368: mod = importlib.import_module(self.SETTINGS_MODULE)
2018-10-21 20:56:14,368: ***************************************************
2018-10-21 20:56:14,368: If you're seeing an import error and don't know why,
2018-10-21 20:56:14,368: we have a dedicated help page to help you debug:
2018-10-21 20:56:14,368: https://help.pythonanywhere.com/pages/DebuggingImportError/
My settings.py file goes like this>>>
import os
import sys
# add your project directory to the sys.path
project_home = '/home/adrielw/energsc/energiasc'
if project_home not in sys.path:
sys.path.insert(0, project_home)
# set environment variable to tell django where your settings.py is
os.environ['DJANGO_SETTINGS_MODULE'] = 'energiasc.settings'
# serve django via WSGI
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
my files structure is like this >>>
first level
next level of file directory structure
I´m bewildered!! Any ideas?
But the way there was a similar problem in this post, but that doesnt helped me(Error running WSGI application , ModuleNotFoundError: No module named 'mysite')!!

It should be
project_home = '/home/adrielw/energsc'
With your current code it is trying to find a settings file at
/home/adrielw/energsc/energiasc/energiasc/settings.py

Related

Airflow webserver No module named 'airflow.www.fab_security'

I am running Airflow 1.10.12 on Ubuntu. Airflow was running fine using local executor and MySql.
In order to conduct some tests, I have moved to Celery executer with RabbitMQ.
Based on a tutorial, here is my config file:
[core]
executor = CeleryExecutor
[celery]
broker_url = pyamqp://rabbitmq:rabbitmq#localhost/
result_backend = db+mysql+pymysql://airflow:airflow#localhost:3306/airflow_db
But when I run:
airflow webserver
The following error is thrown:
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 37, in <module>
args.func(args)
File "/usr/local/lib/python3.8/dist-packages/airflow/utils/cli.py", line 76, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/airflow/bin/cli.py", line 1076, in webserver
app = cached_app_rbac(None) if settings.RBAC else cached_app(None)
File "/usr/local/lib/python3.8/dist-packages/airflow/www_rbac/app.py", line 300, in cached_app
app, _ = create_app(config, session, testing)
File "/usr/local/lib/python3.8/dist-packages/airflow/www_rbac/app.py", line 65, in create_app
app.config.from_pyfile(settings.WEBSERVER_CONFIG, silent=True)
File "/usr/local/lib/python3.8/dist-packages/flask/config.py", line 132, in from_pyfile
exec(compile(config_file.read(), filename, "exec"), d.__dict__)
File "/home/helia/airflow/webserver_config.py", line 21, in <module>
from airflow.www.fab_security.manager import AUTH_DB
ModuleNotFoundError: No module named 'airflow.www.fab_security'

odoo.service.server: Failed to load server-wide module `web`

I am getting this error during starting the server after installation of odoo 11.
I am using ubuntu 18.04
my config file is like this
*
[options]
; This is the password that allows database operations:
;admin_passwd = admin
db_host = 127.0.0.1
db_port = 8069
db_user = odoo
db_password = 123
addons_path = /opt/odoo/addons,/opt/odoo/odoo/addons
logfile = /var/log/odoo/odoo-server.log
*
Full error is something like this
2020-02-07 05:12:33,809 12706 CRITICAL ? odoo.modules.module: Couldn't load module web
2020-02-07 05:12:33,809 12706 CRITICAL ? odoo.modules.module: The 'odoo.addons.web' package was not installed in a way that PackageLoader understands.
2020-02-07 05:12:33,809 12706 ERROR ? odoo.service.server: Failed to load server-wide module `web`.
The `web` module is provided by the addons found in the `openerp-web` project.
Maybe you forgot to add those addons in your addons_path configuration.
Traceback (most recent call last):
File "/opt/odoo/odoo/service/server.py", line 984, in load_server_wide_modules
odoo.modules.module.load_openerp_module(m)
File "/opt/odoo/odoo/modules/module.py", line 368, in load_openerp_module
__import__('odoo.addons.' + module_name)
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/opt/odoo/odoo/modules/module.py", line 82, in load_module
exec(open(modfile, 'rb').read(), new_mod.__dict__)
File "<string>", line 4, in <module>
File "/opt/odoo/addons/web/controllers/__init__.py", line 4, in <module>
from . import main, pivot
File "/opt/odoo/addons/web/controllers/main.py", line 56, in <module>
loader = jinja2.PackageLoader('odoo.addons.web', "views")
File "/home/sandip/.local/lib/python3.6/site-packages/jinja2/loaders.py", line 290, in __init__
" PackageLoader understands." % package_name
ValueError: The 'odoo.addons.web' package was not installed in a way that PackageLoader understands.
It's actually a bug inside Jinja2. Update it to version 2.11.2
You might be blocked by a missing parameter in your config file.
Try to add the following parameter in the file:
server_wide_modules = web
It is a requirement for the installation to go through peacefully.
Hope it helps
Please check your jinja version
maybe wrong with your version jinja
uninstall them
sudo pip3 uninstall Jinja2
then install with right version
sudo pip3 install Jinja2==2.10.1

google-cloud-storage library from nosetests using testbed

I have google-cloud-storage pip installed into a lib directory and vendored in. It's running just fine locally during development of my python appengine app. However, when trying to run unit tests via nose and testbed I'm getting "The 'google-cloud-core' distribution was not found and is required by the application". Here is the stack:
Traceback (most recent call last):
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Users/jason/dev/gain-data/data/storage/__init__.py", line 4, in <module>
from google.cloud.storage import Blob, Client
File "/Users/jason/dev/gain-data/lib/google/cloud/storage/__init__.py", line 42, in <module>
from google.cloud.storage.batch import Batch
File "/Users/jason/dev/gain-data/lib/google/cloud/storage/batch.py", line 30, in <module>
from google.cloud.storage.connection import Connection
File "/Users/jason/dev/gain-data/lib/google/cloud/storage/connection.py", line 17, in <module>
from google.cloud import connection as base_connection
File "/Users/jason/dev/gain-data/lib/google/cloud/connection.py", line 31, in <module>
get_distribution('google-cloud-core').version)
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 557, in get_distribution
dist = get_provider(dist)
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 431, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 968, in require
needed = self.resolve(parse_requirements(requirements))
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
DistributionNotFound: The 'google-cloud-core' distribution was not found and is required by the application
Any thoughts?
I had the same issue with google-cloud-translate, I was forced to also install the package "globally", i.e. pip install google-cloud-translate.
After struggling a lot with this same issue I found out that the error was because the vendor pip lib wasn't in the PYTHONPATH before calling the nosetests.
Try adding the vendor lib to the PYTHONPATH and then run the tests.
export PYTHONPATH="$(HOME)/Projects/myproject/pip_lib:$$PYTHONPATH"; \
nosetests .

h5py installation - ImportError: DLL load failed

I am having trouble in installing h5py on my Windows machine. I am getting an error message that says: "ImportError: DLL load failed: The specified module could not be found.". I would greatly appreciate if someone could explain how to fix this issue.
Here is the complete log:
Downloading/unpacking h5py
Running setup.py egg_info for package h5py
running egg_info
writing requirements to pip-egg-info\h5py.egg-info\requires.txt
writing pip-egg-info\h5py.egg-info\PKG-INFO
writing top-level names to pip-egg-info\h5py.egg-info\top_level.txt
writing dependency_links to pip-egg-info\h5py.egg-info\dependency_links.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info\h5py.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pip-egg-info\h5py.egg-info\SOURCES.txt'
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.1 in c:\program files (x86)\enthought\canopy32\app\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages (from h5py)
Requirement already satisfied (use --upgrade to upgrade): Cython>=0.17 in c:\program files (x86)\enthought\canopy32\app\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages (from h5py)
Downloading/unpacking six (from h5py)
Running setup.py egg_info for package six
running egg_info
writing pip-egg-info\six.egg-info\PKG-INFO
writing top-level names to pip-egg-info\six.egg-info\top_level.txt
writing dependency_links to pip-egg-info\six.egg-info\dependency_links.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info\six.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'documentation\_build'
writing manifest file 'pip-egg-info\six.egg-info\SOURCES.txt'
Source in c:\users\ibm_admin\build\six has version 1.9.0, which satisfies requirement six (from h5py)
Installing collected packages: h5py, six
Running setup.py install for h5py
Running command C:\Users\IBM_ADMIN\AppData\Local\Enthought\Canopy32\User\Scripts\python.exe -c "import setuptools;__file__='C:\\Users\\IBM_ADMIN\\build\\h5py\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\ibm_ad~1\appdata\local\temp\pip-05nf1z-record\install-record.txt
running install
running build
running build_py
running build_ext
********************************************************************************
Summary of the h5py configuration
Path to HDF5: None
HDF5 Version: '1.8.4'
MPI Enabled: False
Rebuild Required: False
********************************************************************************
Executing cythonize()
Autodetection skipped [[Error 126] The specified module could not be found]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\IBM_ADMIN\build\h5py\setup.py", line 140, in <module>
cmdclass = CMDCLASS,
File "C:\Python27\Lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Python27\Lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\Lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "setup_build.py", line 172, in run
self.extensions = cythonize(self._make_extensions(config),
File "setup_build.py", line 72, in _make_extensions
import numpy
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\__init__.py", line 168, in <module>
from . import add_newdocs
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\lib\__init__.py", line 18, in <module>
from .polynomial import *
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\lib\polynomial.py", line 19, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\linalg\__init__.py", line 50, in <module>
from .linalg import *
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\linalg\linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: DLL load failed: The specified module could not be found.
Complete output from command C:\Users\IBM_ADMIN\AppData\Local\Enthought\Canopy32\User\Scripts\python.exe -c "import setuptools;__file__='C:\\Users\\IBM_ADMIN\\build\\h5py\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\ibm_ad~1\appdata\local\temp\pip-05nf1z-record\install-record.txt:
running install
running build
running build_py
running build_ext
Summary of the h5py configuration
Path to HDF5: None
HDF5 Version: '1.8.4'
MPI Enabled: False
Rebuild Required: False
Executing cythonize()
Autodetection skipped [[Error 126] The specified module could not be found]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\IBM_ADMIN\build\h5py\setup.py", line 140, in <module>
cmdclass = CMDCLASS,
File "C:\Python27\Lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Python27\Lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\Lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "setup_build.py", line 172, in run
self.extensions = cythonize(self._make_extensions(config),
File "setup_build.py", line 72, in _make_extensions
import numpy
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\__init__.py", line 168, in <module>
from . import add_newdocs
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\lib\__init__.py", line 18, in <module>
from .polynomial import *
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\lib\polynomial.py", line 19, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\linalg\__init__.py", line 50, in <module>
from .linalg import *
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\numpy\linalg\linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: DLL load failed: The specified module could not be found.
----------------------------------------
Command C:\Users\IBM_ADMIN\AppData\Local\Enthought\Canopy32\User\Scripts\python.exe -c "import setuptools;__file__='C:\\Users\\IBM_ADMIN\\build\\h5py\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\ibm_ad~1\appdata\local\temp\pip-05nf1z-record\install-record.txt failed with error code 1
Exception information:
Traceback (most recent call last):
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\pip\basecommand.py", line 126, in main
self.run(options, args)
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\pip\commands\install.py", line 228, in run
requirement_set.install(install_options, global_options)
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\pip\req.py", line 1100, in install
requirement.install(install_options, global_options)
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\pip\req.py", line 572, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "C:\Program Files (x86)\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\lib\site-packages\pip\__init__.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command C:\Users\IBM_ADMIN\AppData\Local\Enthought\Canopy32\User\Scripts\python.exe -c "import setuptools;__file__='C:\\Users\\IBM_ADMIN\\build\\h5py\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\ibm_ad~1\appdata\local\temp\pip-05nf1z-record\install-record.txt failed with error code 1

Openerp 7.0 server not getting started

I have downloaded fresh copy of the 7.0 branch of odoo from the github, I have changed all the necessary things like user, password, port and I tried to start the server but getting this error,
2015-03-12 06:47:50,735 7260 CRITICAL ? openerp.modules.module: Couldn't load module web
2015-03-12 06:47:50,736 7260 CRITICAL ? openerp.modules.module: cannot import name models
2015-03-12 06:47:50,736 7260 ERROR ? openerp.service: Failed to load server-wide module `web`.
The `web` module is provided by the addons found in the `openerp-web` project.
Maybe you forgot to add those addons in your addons_path configuration.
Traceback (most recent call last):
File "/home/viraj/workspace/v7_development/odoo_v7/openerp/service/__init__.py", line 60, in load_server_wide_modules
openerp.modules.module.load_openerp_module(m)
File "/home/viraj/workspace/v7_development/odoo_v7/openerp/modules/module.py", line 415, in load_openerp_module
getattr(sys.modules['openerp.addons.' + module_name], info['post_load'])()
File "/home/viraj/workspace/v7_development/odoo_v7/addons/web/http.py", line 628, in wsgi_postload
openerp.wsgi.register_wsgi_handler(Root())
File "/home/viraj/workspace/v7_development/odoo_v7/addons/web/http.py", line 517, in __init__
self.load_addons()
File "/home/viraj/workspace/v7_development/odoo_v7/addons/web/http.py", line 580, in load_addons
m = __import__('openerp.addons.' + module)
File "/home/viraj/workspace/v7_development/odoo_v7/openerp/modules/module.py", line 133, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/home/viraj/workspace/v7_development/emipro_addons/quotation_split/__init__.py", line 1, in <module>
import py
File "/home/viraj/workspace/v7_development/emipro_addons/quotation_split/py/__init__.py", line 1, in <module>
import sale_order
File "/home/viraj/workspace/v7_development/emipro_addons/quotation_split/py/sale_order.py", line 1, in <module>
from openerp import models, fields, api, _
ImportError: cannot import name models
If anyone know this please help me.
Thanks in advance.