aeroo install under odoo 8 ImportError - reporting

I've installed the aeroolib on my LinuxMint (maybe Ubuntu clone).
I've downloaded the aeroo module, put it on the odoo addons.
I get the ImportError when I restart the openerp server.
I need to change:
"from osv import osv" to "from openerp.osv import osv"
and so on with netsvc, tools ..... etc.
On OpenErp7 this works fine!
IMHO this is maybe some PYTHONPATH problem, but I'm a greenhorn to solve it!
Any help would be appreciated!
Cheers! Janos

In odoo v8 to import osv, netsvc and tools do the following:
To import osv, do the following:
from openerp.osv import osv, fields
To import netsvc do the following:
from openerp import netsvc
To import tools do the following:
from openerp import tools
Hope this helps !!

Related

How do I resolve "name 'aiplatform' is not defined" error when running predictions from a notebook?

Running predictions from a notebook failing with
'NameError: name 'aiplatform' is not defined'
You need to install and import the aiplatform SDK
Here is the installation guide
Import it like this:
from google.cloud import aiplatform
Here is an example notebook

Get and install requirements.txt for python file into virtualenv

I have the following packages I need to install into my virtual environment for an app deployment. This is how they read at the top of my app's file:
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from scipy import stats
from sklearn import metrics
import plotly.express as px
import plotly.graph_objects as go
import plotly.figure_factory as ff
import statsmodels.api as sm
I'm not sure how to install the ones that say "from x import y, z". I'd also much prefer to do something more global(?) than install each thing one by one into the virtualenv.
As I understand it, the pip freeze > requirements.txt command only generates a requirements file based on what's manually been installed into the virtualenv. I'd rather get something together that looks at my app file and generates a requirements.txt based on that, and then install the contents of the requirements.txt into the virtualenv directly, as opposed to installing each package one by one.
from foo import bar is essentially equivalent to:
import foo
bar = foo.bar
It just imports the module then loads some of its variables into scope. So, from scipy import stats would be in the scipy module. As for automatically generating a requirements.txt, this is what pipreqs is made for.
I installed pipreqs and then used
pipreqs .
from command line while in the directory of the folder with the app in it. This generated a requirements.txt with all the proper packages. Still working on installing the requirements.txt into the virtualenv, but thats been answered many times elsewhere.
EDIT: install requirements.txt into virtualenv using:
pip install -r requirements.txt

Importing gensim

I've installed gensim, however I keep getting an error when I try to import it
from gensim.models import Word2Vec
ImportError: cannot import name 'open'
I'm using the updated version of gensim 3.8.0 and smart_open 2.1.0.
I have reinstalled several times but still can't get it to work.
I also have the same problem, after that I found a solution:
pip install --upgrade gensim
You can install first , then you can import:
import gensim.downloader as gensim_api
import gensim
Works for Mac.

import error in wxPython: import wx.animate on windows7(64bit OS) with python3.5.1 in Anaconda 4.2.0(32bit)

I am working on Windows7(64 bit OS) with Anaconda's python 3.5.1(32bit).
I have installed wxPython for GUI.
I keep getting the below import error
ImportError: No module named 'wx.animate'
import wx is working fine.
import wx
wx.version()
gives
'3.0.3.dev2752+8304ec1 msw (phoenix)''
I have installed wxPython from
https://wxpython.org/Phoenix/snapshot-builds/
the version is,
wxPython_Phoenix-3.0.3.dev2752+8304ec1-cp35-cp35m-win32.whl
I have checked the path and don't see any problem there..
Can anyone guide me on where this is going wrong?
Thanks.
The classes formerly in wx.animate in wxPython Classic are now in wx.adv in wxPython Phoenix. See https://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html#modules-which-have-moved

Py2exe enchant error

Hi i compiled my python script that includes enchant and when i try to execute my program i get the following error
ImportError: The 'enchant' C library was not found. Please install it via your OS package manager, or use a pre-built binary wheel from PyPI.
I run 64bit Windows.
My setup.py file looks like this
from distutils.core import setup
from glob import glob
from PyQt4 import QtCore, QtGui
import numpy as np
import sys
import os, os.path
import time
import exifread
import logging
import re
import datetime
import hashlib
import sqlite3
import MySQLdb as msql
import jsbeautifier
import enchant
import sys
import py2exe
import six
Mydata_files = []
for files in os.listdir('C:\\Users\\agis\\Dropbox\\PyWall\\Files'):
f1 = 'C:\\Users\\agis\\Dropbox\\PyWall\\Files\\' + files
if os.path.isfile(f1): # skip directories
f2 = 'Files', [f1]
Mydata_files.append(f2)
sys.path.append('C:\\Windows\\WinSxS\\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada')
sys.path.append("C:\\Python27\\Lib\\site-packages")
setup(windows=['pywall.py'],
data_files = Mydata_files)
If i remove enchant from my script the executable run perfect.How i can include enchant to my exe.
Please see the documentation http://pythonhosted.org/pyenchant/tutorial.html#packaging-pyenchant-with-py2exe
"PyEnchant depends on a large number of auxilliary files such as plugin libraries, dictionary files, etc. While py2exe does an excellent job of detecting static file dependencies, it cannot detect these files which are located at runtime.
To successfully package an application that uses PyEnchant, these auxilliary files must be explicitly included in the “data_files” argument to the setup function. The function enchant.utils.win32_data_files returns a list of files which can be used for this purpose."
For this issue:----> Py2exe enchant error.
You can use the alternative solution, by downloading "language_check 2.x" which can be used to check the grammatical mistakes of your English. Also, can be used in Py2 & Py3.
https://pypi.org/project/language-check/

Resources