OpenERP trunk server gives import Error psutil - python

I download trunk version of OpenERP from lauchpad. When i start server it's gives following error
Traceback (most recent call last):
File "./openerp-server", line 2, in
import openerp
File "/home/jack/trunk/trunk-server/openerp/init.py", line 72, in
import http
File "/home/jack/trunk/trunk-server/openerp/http.py", line 37, in
from openerp.service import security, model as service_model
File "/home/jack/trunk/trunk-server/openerp/service/init.py", line 28, in
import server
File "/home/jack/trunk/trunk-server/openerp/service/server.py", line 10, in
import psutil
ImportError: No module named psutil

Getting this error because psutil is not installed. you have to install psutil using this command.
sudo apt-get install python-psutil in terminal. after this restart server. This will solve your error.

Related

Python "cannot import 'ssl' from 'urllib3.util.ssl_'" error

I'm trying to set up a Python script to run through a batch file for Windows Task Scheduler and I'm running into an error when running the file.
The code works in both my Jupyter Notebook and PyCharm, but fails when trying to run through a batch file.
Modules imported within the script:
from pyathena import connect
import pandas as pd
import numpy as np
import win32com.client as win32
import datetime
from IPython.display import HTML
Error Message:
C:\Users\jraines\Desktop>"C:\Users\jraines\AppData\Local\Continuum\anaconda3\python.exe" "C:\Users\jraines\Downloads\Partners Email New.py"
Traceback (most recent call last):
File "C:\Users\jraines\Downloads\Partners Email New.py", line 27, in <module>
region_name='us-east-1')
File "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\pyathena\__init__.py", line 54, in connect
from pyathena.connection import Connection
File "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\pyathena\connection.py", line 9, in <module>
from boto3.session import Session
File "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\boto3\__init__.py", line 16, in <module>
from boto3.session import Session
File "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\boto3\session.py", line 17, in <module>
import botocore.session
File "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\botocore\session.py", line 30, in <module>
import botocore.credentials
File "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\botocore\credentials.py", line 42, in <module>
from botocore.utils import InstanceMetadataFetcher, parse_key_val_file
File "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\botocore\utils.py", line 31, in <module>
import botocore.httpsession
File "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\botocore\httpsession.py", line 7, in <module>
from urllib3.util.ssl_ import (
ImportError: cannot import name 'ssl' from 'urllib3.util.ssl_' (C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\urllib3\util\ssl_.py)
When I run my script in my Jupyter Notebook and PyCharm I don't see this error message, but when I run it on the command line I get the error above. I do have the "C:\Users\jraines\AppData\Local\Continuum\anaconda3\lib\site-packages\urllib3\ssl_.py" file installed as well.
I use this steps solved the issue. my python version is 3.7.4.
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
reinstall python3.7.4
import ssl is ok

Import error while trying to run jupyter notebook

An import error occurs when trying to run jupyter notebook
I'm trying to run jupyter notebook using anaconda (git bash platform), and as I type in jupyter notebook, an import error occurs every time. I tried to lauch it inside an environment, but the same error occured.
$ jupyter notebook
Traceback (most recent call last):
File "C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
<module>
from notebook.notebookapp import main
File "C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 47, in <module>
from zmq.eventloop import ioloop
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
EDITED
After reinstalling pyzmq (and I tried reinstalling conda too), the following error occurs:
$ jupyter notebook
Traceback (most recent call last): File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",
line 10, in
import sqlite3
File "C:\Users\User\Anaconda3\lib\sqlite3__init__.py", line 23, in
from sqlite3.dbapi2 import *
File "C:\Users\User\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6,
in
from notebook.notebookapp import main
File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py",
line 86, in
from .services.sessions.sessionmanager import SessionManager
File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",
line 13, in
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'
I found a similar issue open on GitHub for zmq. The recommendation by GitHub user harsh23tyagi that seems to work for most is to run the following:
pip uninstall pyzmq
pip install pyzmq
Working with conda env, jupyter notebook worked in (base) env but gave the .libzmq error in (my_env).
To be able to run notebooks from my_env, this worked for me :
pip uninstall pyzmq
pip install pyzmq==20 (no version for pyzmq didn't fix the issue for me)
It seems that updating pyzmq to the latest version fixes this problem for me.
conda install pyzmq=22

how to run google assistant sdk with sudo

I'm having this problem where I need to run google assistant sdk with sudo command because I'm trying to integrate the action after receiving the instruction using Grovepi library from https://github.com/emutex/GrovePi .
Error I get if I didn't run with the google assistant sdk using sudo
```
(env) ubilinux#ubilinux4:~/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/library$ python project.py --device_model_id **************
Traceback (most recent call last):
File "project.py", line 26, in <module>
from grovepi import *
File "/home/ubilinux/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/library/grovepi.py", line 98, in <module>
import RPi.GPIO as GPIO
ImportError: No module named 'RPi'
```
and this is the error I get if i run the command with sudo
```
(env) ubilinux#ubilinux4:~/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/library$ sudo python project.py --device_model_id *****************************
[sudo] password for ubilinux:
Traceback (most recent call last):
File "project.py", line 23, in <module>
import google.auth.transport.requests
ImportError: No module named google.auth.transport.requests
```
The project.py code is the same with the default hotwords.py source code but I just add up from grovepi import * inside the code to import the grovepi library.
Please help me :(
Thanks in advance

py2exe, paramiko error, ImportError

I am programming server-client App using python.
I need to run client side App on windows so I tried to compile script to exe with py2exe.
In head of client app:
import paramiko
import threading
import subprocess
so in setup I import paramiko
from distutils.core import setup
import py2exe, os, paramiko
setup(console=['client.py'])
when I tried to run compiled file:
Traceback (most recent call last): File "client.py", line 3, in
File "paramiko__init__.pyc", line 30, in
File "paramiko\transport.pyc", line 32, in
s♥ File "cryptography\hazmat\backends__init__.pyc", line 7, in
File "pkg_resources__init__.pyc", line 68, in
☻☺t File "pkg_resources\extern__init__.pyc", line 60, in load_module
ImportError: The 'packaging' package is required; normally this is
bundled with this package so if you get this warning, consult the
packager of your distribution.
Does anyone have a solution?
Try running pip install packaging and recompiling.

Python ImportError: cannot import name utils

I'm having this issue running a script and it looks like it missed some dependencies, but as you can see below. After installing the missing libraries, it doesn't make any sense.
[ericfoss#maverick-fossum-ddns-net packages]$ python -c "import utils"
[ericfoss#maverick-fossum-ddns-net packages]$ python -c "import requests"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 64, in <module>
from . import utils
ImportError: cannot import name utils
[ericfoss#maverick-fossum-ddns-net packages]$
Any idea why utils can be imported, but requests can't?
Check if Requests requirements are satisfied:
$ pip show requests
...
Requires: certifi, idna, chardet, urllib3
I hit the same error but I was missing idna. After installing it the issue resolved.
Well, after pip uninstall requests and reinstalling, it no longer would work at all. Luckily, dnf install python-requests fixed the whole thing...
We may see the unable to import utils error in multiple contexts.
I got this error message when I was migrating scripts from python 2 to 3.
I used the inbuilt python migration automated tool to change the file that is causing the import error using the command 2to3 -w filename
This has resolved the error because the import utils is not back supported by python 3 and we have to convert that code to python 3.
I ran into a similar problem when running Jupyter Lab:
$ jupyter-lab --ip 0.0.0.0
Traceback (most recent call last):
File "/Users/gtholpadi/opt/anaconda3/bin/jupyter-lab", line 6, in <module>
from jupyterlab.labapp import main
File "/Users/gtholpadi/opt/anaconda3/lib/python3.8/site-packages/jupyterlab/labapp.py", line 14, in <module>
from jupyterlab_server import slugify, WORKSPACE_EXTENSION
File "/Users/gtholpadi/opt/anaconda3/lib/python3.8/site-packages/jupyterlab_server/__init__.py", line 4, in <module>
from .app import LabServerApp
File "/Users/gtholpadi/opt/anaconda3/lib/python3.8/site-packages/jupyterlab_server/app.py", line 10, in <module>
from .handlers import add_handlers, LabConfig
File "/Users/gtholpadi/opt/anaconda3/lib/python3.8/site-packages/jupyterlab_server/handlers.py", line 18, in <module>
from .listings_handler import ListingsHandler, fetch_listings
File "/Users/gtholpadi/opt/anaconda3/lib/python3.8/site-packages/jupyterlab_server/listings_handler.py", line 17, in <module>
import requests
File "/Users/gtholpadi/opt/anaconda3/lib/python3.8/site-packages/requests/__init__.py", line 120, in <module>
from . import utils
ImportError: cannot import name 'utils' from partially initialized module 'requests' (most likely due to a circular import) (/Users/gtholpadi/opt/anaconda3/lib/python3.8/site-packages/requests/__init__.py)
requests was already installed when I got this error. I tried pip install -U requests and that solved the problem.
utils package is not installed
You can install package using
sudo pip install utils

Categories