0

Please i need help, i try to run odoo from pycharm, i have installed odoo 12 in ubuntu 18.04 machine, i have opened odoo folder in pycharm and i add configuration in pycharm ( i use pycharm communoty edition) to this opend project, after that i run odoo but odoo can't be run from pycharm and i get this error :

/usr/bin/python3.6 /usr/bin/odoo
/usr/local/lib/python3.6/dist-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 32, in <module>
    from werkzeug.datastructures import CallbackDict
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/datastructures.py", line 2759, in <module>
    from werkzeug.http import dump_options_header, dump_header, generate_etag, \
ImportError: cannot import name 'dump_options_header'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/odoo", line 5, in <module>
    import odoo
  File "/usr/lib/python3/dist-packages/odoo/__init__.py", line 89, in <module>
    from . import modules
  File "/usr/lib/python3/dist-packages/odoo/modules/__init__.py", line 8, in <module>
    from . import db, graph, loading, migration, module, registry
  File "/usr/lib/python3/dist-packages/odoo/modules/graph.py", line 10, in <module>
    import odoo.tools as tools
  File "/usr/lib/python3/dist-packages/odoo/tools/__init__.py", line 9, in <module>
    import werkzeug.utils
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/__init__.py", line 151, in <module>
    __import__('werkzeug.exceptions')
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/wrappers.py", line 27, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/http.py", line 30, in <module>
    from urllib2 import parse_http_list as _parse_list_header, \
ModuleNotFoundError: No module named 'urllib2'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/http.py", line 27, in <module>
    from urllib.request import parse_http_list as _parse_list_header
ImportError: cannot import name 'parse_http_list'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 21, in <module>
    from urllib.request import urlopen
  File "/usr/lib/python3.6/urllib/request.py", line 88, in <module>
    import http.client
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 32, in <module>
    import werkzeug.contrib.sessions
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/contrib/sessions.py", line 63, in <module>
    from werkzeug.datastructures import CallbackDict
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/__init__.py", line 151, in <module>
    __import__('werkzeug.exceptions')
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/wrappers.py", line 27, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/http.py", line 30, in <module>
    from urllib2 import parse_http_list as _parse_list_header, \
ModuleNotFoundError: No module named 'urllib2'

Original exception was:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/http.py", line 27, in <module>
    from urllib.request import parse_http_list as _parse_list_header
  File "/usr/lib/python3.6/urllib/request.py", line 88, in <module>
    import http.client
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 32, in <module>
    import werkzeug.contrib.sessions
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/contrib/sessions.py", line 63, in <module>
    from werkzeug.datastructures import CallbackDict
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/datastructures.py", line 2759, in <module>
    from werkzeug.http import dump_options_header, dump_header, generate_etag, \
ImportError: cannot import name 'dump_options_header'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/odoo", line 5, in <module>
    import odoo
  File "/usr/lib/python3/dist-packages/odoo/__init__.py", line 89, in <module>
    from . import modules
  File "/usr/lib/python3/dist-packages/odoo/modules/__init__.py", line 8, in <module>
    from . import db, graph, loading, migration, module, registry
  File "/usr/lib/python3/dist-packages/odoo/modules/graph.py", line 10, in <module>
    import odoo.tools as tools
  File "/usr/lib/python3/dist-packages/odoo/tools/__init__.py", line 9, in <module>
    from .misc import *
  File "/usr/lib/python3/dist-packages/odoo/tools/misc.py", line 26, in <module>
    import werkzeug.utils
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/__init__.py", line 151, in <module>
    __import__('werkzeug.exceptions')
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/wrappers.py", line 27, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/http.py", line 30, in <module>
    from urllib2 import parse_http_list as _parse_list_header, \
ModuleNotFoundError: No module named 'urllib2'

Process finished with exit code 1
Programmer LiLi
  • 147
  • 5
  • 27

1 Answers1

0

The pycharm odoo instance is using /usr/bin/python3.6 as it's python interpreter, this python environment doesn't contain necessary packages run odoo-12 instance. Using virtual environment is strongly suggested, instead the systemwide environment.

To install packages required for running odoo-12, use pip and requirements.txt from odoo git. Just download the text file and run following command:

python3.6 -m pip install -r requirements.txt

if pip package is not found, you can install it from apt repository using following command

sudo apt-get install python3-pip

arryph
  • 2,725
  • 10
  • 15