How to setup odoo 10 for development in macOS - odoo

I have installed all the pre-requests as in the tutorials.
When I tried to run odoo by using the following command,
./odoo.py --addons-path=addons,../mymodules --db-filter=mydb$
I am getting the following error message.
-bash: ./odoo.py: No such file or directory
Jinn-MacBook-Air:odoo juasoft$ ./odoo-bin
Traceback (most recent call last):
File "./odoo-bin", line 9, in <module>
odoo.cli.main()
File "/Users/juasoft/git/odoo/odoo/cli/command.py", line 64, in main
o.run(args)
File "/Users/juasoft/git/odoo/odoo/cli/server.py", line 164, in run
main(args)
File "/Users/juasoft/git/odoo/odoo/cli/server.py", line 122, in main
odoo.tools.config.parse_config(args)
File "/Users/juasoft/git/odoo/odoo/tools/config.py", line 315, in parse_config
odoo.netsvc.init_logger()
File "/Users/juasoft/git/odoo/odoo/netsvc.py", line 120, in init_logger
resetlocale()
File "/Users/juasoft/git/odoo/odoo/tools/translate.py", line 1185, in resetlocale
for ln in get_locales():
File "/Users/juasoft/git/odoo/odoo/tools/translate.py", line 1154, in get_locales
lang = locale.getdefaultlocale()[0]
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 545, in getdefaultlocale
return _parse_localename(localename)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 477, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
Jinn-MacBook-Air:odoo juasoft$

change to your home directory
cd ~
Edit .bash_profile (with vim or any text editor)
vim .bash_profile
Add the following lines to it
export LC_ALL=es_US.UTF-8
export LANG=en_US.UTF-8
And then finally source the file to make the changes take effect immediately (without this you'll have to logout and login again as .bash_profile is executed only on login)
source .bash_profile

Related

Cannot run dask-mpi with Python 3.7 -- timeout when connecting client to dask-mpi scheduler

I'm attempting to run the Dask-MPI "Getting Started" (http://mpi.dask.org/en/latest/) example in a fresh Anaconda environment.
I set up an environment using
conda create -n dask-mpi -c conda-forge python=3.7 dask-mpi
conda activate dask-mpi
Inside the environment, I run
mpirun -np 4 dask-mpi --scheduler-file ./scheduler.json
Then, from a python interpreter on the same machine (and in the same folder), I run
from dask.distributed import Client
client = Client(scheduler_file='/path/to/scheduler.json')
This results in the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/distributed/client.py", line 712, in __init__
self.start(timeout=timeout)
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/distributed/client.py", line 858, in start
sync(self.loop, self._start, **kwargs)
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/distributed/utils.py", line 331, in sync
six.reraise(*error[0])
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/six.py", line 693, in reraise
raise value
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/distributed/utils.py", line 316, in f
result[0] = yield future
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/distributed/client.py", line 954, in _start
yield self._ensure_connected(timeout=timeout)
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/distributed/client.py", line 1015, in _ensure_connected
timedelta(seconds=timeout), self._update_scheduler_info()
File "/home/nleaf/anaconda3/envs/dask-mpi/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
tornado.util.TimeoutError: Timeout
The terminal that I ran dask-mpi from does not have any output which would indicate that something is trying to connect. I have verified that the port in question, 8786, is open. I've also verified via debugger that the client is getting the correct address from the scheduler file.
I've tried this in quite a few different environments and on a few different machines, including a fresh Ubuntu 18.04 docker container. I'm completely at a loss for what steps I might be missing.
It turns out this was due to an error in newer versions of dask.distributed (1.25.3) which broke the behavior of dask-mpi. This seems to be fixed as of dask-mpi 1.0.3 (https://github.com/dask/dask-mpi/releases/tag/1.0.3).

Cannot import name 'wrap_module'

Im setting up an odoo community server and after adding and removing an addon, i am getting an error.
I have tried copying the odoo addons files back to the default install ones with no success.
Exception in thread odoo.service.cron.cron0:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/opt/odoo/odoo/odoo/service/server.py", line 244, in target
self.cron_thread(i)
File "/opt/odoo/odoo/odoo/service/server.py", line 218, in cron_thread
from odoo.addons.base.ir.ir_cron import ir_cron
File "/opt/odoo/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/odoo/odoo/addons/base/ir/__init__.py", line 8, in
<module>
from . import ir_actions
File "/opt/odoo/odoo/odoo/addons/base/ir/ir_actions.py", line 8, in
<module>
from odoo.tools import pycompat, wrap_module
ImportError: cannot import name 'wrap_module'
That is the error i am getting, ive tried using pip3 to install pycompat but it still dosnt work.
Make sure you running Odoo on python3,
on terminal python3 path_to_odoo/./odoo-bin
and clear the browser cache and try again.

LetsEncrypt Certbot-Auto freezes when trying to run any command on Apache

I am trying to get LetsEncrypt SSL certificates installed on a Centos 6 server using Cerbot-Auto, however no matter what I try, it just hangs on:
Apache version is 2.2.15
Command
./certbot-auto -v
When I press CTRL + C to exit the program, it takes about 15 seconds and then exits with a stack trace:
Exiting abnormally:
Traceback (most recent call last):
File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 9, in <module>
load_entry_point('letsencrypt==0.7.0', 'console_scripts', 'letsencrypt')()
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/main.py", line 1240, in main
return config.func(config, plugins)
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/main.py", line 981, in run
installer, authenticator = plug_sel.choose_configurator_plugins(config, plugins, "run")
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/plugins/selection.py", line 189, in choose_configurator_plugins
authenticator = installer = pick_configurator(config, req_inst, plugins)
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/plugins/selection.py", line 25, in pick_configurator
(interfaces.IAuthenticator, interfaces.IInstaller))
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/plugins/selection.py", line 77, in pick_plugin
verified.prepare()
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/plugins/disco.py", line 248, in prepare
return [plugin_ep.prepare() for plugin_ep in six.itervalues(self._plugins)]
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/plugins/disco.py", line 248, in <listcomp>
return [plugin_ep.prepare() for plugin_ep in six.itervalues(self._plugins)]
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/plugins/disco.py", line 130, in prepare
self._initialized.prepare()
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/configurator.py", line 225, in prepare
self.parser = self.get_parser()
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/override_centos.py", line 39, in get_parser
self.version, configurator=self)
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/override_centos.py", line 47, in __init__
super(CentOSParser, self).__init__(*args, **kwargs)
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/parser.py", line 74, in __init__
if self.find_dir("Define", exclude=False):
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/parser.py", line 401, in find_dir
"%s//*[self::directive=~regexp('%s')]" % (start, regex))
File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/augeas.py", line 413, in match
ctypes.byref(array))
KeyboardInterrupt
Please see the logfiles in /var/log/letsencrypt for more details.
I thought it may be a python version issue but when checked, the server is running Python 2.6.6, which, according to the Certbot System Requirements is acceptable.
Letsencrypt.log
When I checked the log, it is exactly the same stacktrace as was reported by the script previously.
Any ideas?

Redownloaded custom built tensorflow wheel wont install

I've built Tensorflow with custom SIMD extensions and created a wheel for it. If I simply do pip install /tmp/tensorflow_pkg/tensorflow-1.0.0-cp27-cp27mu-linux_x86_64.wh on the box that I built it on, that works. However if I upload the whl file to cloud storage, and do pip install https://storage.cloud.google.com/path/to/tensorflow-1.0.0-cp27-cp27mu-linux_x86_64.whl I get this error:
Collecting tensorflow==1.0.0 from https://storage.cloud.google.com/path/to/tensorflow-1.0.0-cp27-cp27mu-linux_x86_64.whl
Downloading https://storage.cloud.google.com/path/to/tensorflow-1.0.0-cp27-cp27mu-linux_x86_64.whl
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/local/lib/python2.7/site-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/usr/local/lib/python2.7/site-packages/pip/download.py", line 663, in unpack_http_url
unpack_file(from_path, location, content_type, link)
File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 484, in unzip_file
zip = zipfile.ZipFile(zipfp, allowZip64=True)
File "/usr/local/lib/python2.7/zipfile.py", line 770, in __init__
self._RealGetContents()
File "/usr/local/lib/python2.7/zipfile.py", line 811, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
Do I need to configure my build differently somehow?
(capturing the solution as an answer)
The URL used for the download is not correct. The base url needed to be storage.googleapis.com

Error setup powerline for bash shell on Yosemite

I would like to use powerline with bash (not zsh if possible) but I have faced some errors, below are steps I have been through
I recently install python using homebrew
I have also executed brew linkapps python
I have installed powerline-statys using pip install powerline-status
I have extended my ~/.bash_profile
if [ -f /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh
fi
I also have installed patched fonts from https://github.com/powerline/fonts using it's install.sh
After Opennig new tab in iTerm2 I have faced this error, I think it's about python but I have no ideas how to fix it, so please help
traceback (most recent call last):
File "/usr/local/bin/powerline-config", line 6, in <module>
from powerline.commands.config import get_argparser
File "/usr/local/lib/python2.7/site-packages/powerline/commands/config.py", line 6, in <module>
import powerline.bindings.config as config
File "/usr/local/lib/python2.7/site-packages/powerline/bindings/config.py", line 19, in <module>
from powerline.commands.main import finish_args
File "/usr/local/lib/python2.7/site-packages/powerline/commands/main.py", line 17, in <module>
encoding = get_preferred_arguments_encoding()
File "/usr/local/lib/python2.7/site-packages/powerline/lib/encoding.py", line 77, in get_preferred_arguments_encoding
locale.getdefaultlocale()[1]
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
return _parse_localename(localename)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
Traceback (most recent call last):
File "/usr/local/bin/powerline-config", line 6, in <module>
from powerline.commands.config import get_argparser
File "/usr/local/lib/python2.7/site-packages/powerline/commands/config.py", line 6, in <module>
import powerline.bindings.config as config
File "/usr/local/lib/python2.7/site-packages/powerline/bindings/config.py", line 19, in <module>
from powerline.commands.main import finish_args
File "/usr/local/lib/python2.7/site-packages/powerline/commands/main.py", line 17, in <module>
encoding = get_preferred_arguments_encoding()
File "/usr/local/lib/python2.7/site-packages/powerline/lib/encoding.py", line 77, in get_preferred_arguments_encoding
locale.getdefaultlocale()[1]
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
return _parse_localename(localename)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
My Environment
python --version
Python 2.7.6
brew list python
/usr/local/Cellar/python/2.7.10_2/bin/2to3
/usr/local/Cellar/python/2.7.10_2/bin/2to3-2
/usr/local/Cellar/python/2.7.10_2/bin/2to3-2.7
/usr/local/Cellar/python/2.7.10_2/bin/easy_install
/usr/local/Cellar/python/2.7.10_2/bin/easy_install-2.7
/usr/local/Cellar/python/2.7.10_2/bin/idle
/usr/local/Cellar/python/2.7.10_2/bin/idle2
/usr/local/Cellar/python/2.7.10_2/bin/idle2.7
/usr/local/Cellar/python/2.7.10_2/bin/pip
/usr/local/Cellar/python/2.7.10_2/bin/pip2
/usr/local/Cellar/python/2.7.10_2/bin/pip2.7
/usr/local/Cellar/python/2.7.10_2/bin/pydoc
/usr/local/Cellar/python/2.7.10_2/bin/pydoc2
/usr/local/Cellar/python/2.7.10_2/bin/pydoc2.7
/usr/local/Cellar/python/2.7.10_2/bin/python
/usr/local/Cellar/python/2.7.10_2/bin/python-config
/usr/local/Cellar/python/2.7.10_2/bin/python2
/usr/local/Cellar/python/2.7.10_2/bin/python2-config
/usr/local/Cellar/python/2.7.10_2/bin/python2.7
/usr/local/Cellar/python/2.7.10_2/bin/python2.7-config
/usr/local/Cellar/python/2.7.10_2/bin/pythonw
/usr/local/Cellar/python/2.7.10_2/bin/pythonw2
/usr/local/Cellar/python/2.7.10_2/bin/pythonw2.7
/usr/local/Cellar/python/2.7.10_2/bin/smtpd.py
/usr/local/Cellar/python/2.7.10_2/bin/smtpd2.7.py
/usr/local/Cellar/python/2.7.10_2/bin/smtpd2.py
/usr/local/Cellar/python/2.7.10_2/bin/wheel
/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/ (3761 files)
/usr/local/Cellar/python/2.7.10_2/IDLE.app/Contents/ (8 files)
/usr/local/Cellar/python/2.7.10_2/lib/pkgconfig/ (3 files)
/usr/local/Cellar/python/2.7.10_2/libexec/pip/ (499 files)
/usr/local/Cellar/python/2.7.10_2/libexec/setuptools/ (227 files)
/usr/local/Cellar/python/2.7.10_2/libexec/wheel/ (92 files)
/usr/local/Cellar/python/2.7.10_2/Python Launcher.app/Contents/ (17 files)
/usr/local/Cellar/python/2.7.10_2/share/man/ (3 files)
/usr/local/Cellar/python/2.7.10_2/share/python/ (315 files)
Your python complains about the unknown locale UTF-8. Searching the net gives the following solution. Add these lines to your ~/.bash_profile:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8