Technical mailing list archives

technical@mail.odoo.com

Avatar

Re: Debug Odoo in Visual Studio

by
Segrey Software BVBA, Steven Segers
- 29/06/2018 08:02:03
Hello Manuel

Thank you for your assistance. In the end I gave up trying to use Visual Studio. I switched to Visual Studio Code. There's it's working fine.

Best regards

Steven



On Fri, Jun 22, 2018 at 2:11 PM Manuel Pagani <mpagani@nexapp.it> wrote:

Hi,

dump_option_header can be found if you install urllib2, the problem is: that package is used in python2.7, when instead you are using a >3.0 version.

This means that there are some of your modules, I think, of version 10 in your Odoo11 addons folder.

Let me know if that solve, at least in part, your problem.

 

Thanks and regards,

 

Manuel Pagani

Odoo & Python Developer

 

O 0354935483

 

cid:image001.png@01D2E9D5.F9296070cid:image002.png@01D2E9D5.F9296070cid:image003.png@01D2E9D5.F9296070

Nexapp S.r.l. 

Via A. Manzoni,33 - 24030 Medolago BG – PI/CF 04061840163 – www.nexapp.it  

 

Subject to local law, communications with Nexapp and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Nexapp policy.  

P Before printing, think about the environment

 

Da: Steven Segers <steven.segers@segrey.com>
Inviato: venerdì 22 giugno 2018 13:44
A: Technical <technical@mail.odoo.com>
Oggetto: Debug Odoo in Visual Studio

 

Hello

 

I'm trying to set up Visual Studio (not Visual Studio Code) to debug Odoo. (I know, I'm a bit strange). I want to take this route because VS is my most used IDE, so it would be convenient to be able to use that for Odoo as well. Since VS supports Python development, I figured there should be no particular reason this should not work. But perhaps there is?

 

So, I imported Odoo 11 into a Visual Studio project (using Create project from existing code), set up a virtual environment based on Python 3.6 and let VS import all the dependencies based on requirements.txt. I then added the psycopg2 dependency. Why I try to start Odoo, I get the following exception:

 

Standard library module invoked user code during import; breakpoints disabled for invoked code.

The thread 'MainThread' (0x4160) has exited with code 0 (0x0).

Traceback (most recent call last):

  File "C:\Projects\Odoo\odoo\odoo-bin", line 5, in <module>

    import odoo

  File "C:\Projects\Odoo\odoo\odoo\__init__.py", line 84, in <module>

    from . import modules

  File "C:\Projects\Odoo\odoo\odoo\modules\__init__.py", line 8, in <module>

    from . import db, graph, loading, migration, module, registry

  File "C:\Projects\Odoo\odoo\odoo\modules\graph.py", line 10, in <module>

    import odoo.tools as tools

  File "C:\Projects\Odoo\odoo\odoo\tools\__init__.py", line 9, in <module>

    from .misc import *

  File "C:\Projects\Odoo\odoo\odoo\tools\misc.py", line 25, in <module>

    import werkzeug.utils

  File "C:\Projects\Odoo\odoo\Odoo 11 Python 3.6 32bit\lib\site-packages\werkzeug\__init__.py", line 152, in <module>

    __import__('werkzeug.exceptions')

  File "C:\Projects\Odoo\odoo\Odoo 11 Python 3.6 32bit\lib\site-packages\werkzeug\exceptions.py", line 71, in <module>

    from werkzeug.wrappers import Response

  File "C:\Projects\Odoo\odoo\Odoo 11 Python 3.6 32bit\lib\site-packages\werkzeug\wrappers.py", line 26, in <module>

    from werkzeug.http import HTTP_STATUS_CODES, \

  File "C:\Projects\Odoo\odoo\Odoo 11 Python 3.6 32bit\lib\site-packages\werkzeug\http.py", line 28, in <module>

    from urllib.request import parse_http_list as _parse_list_header

  File "C:\apps\Python36\lib\urllib\request.py", line 88, in <module>

    import http.client

  File "C:\Projects\Odoo\odoo\odoo\http.py", line 31, in <module>

    import werkzeug.contrib.sessions

  File "C:\Projects\Odoo\odoo\Odoo 11 Python 3.6 32bit\lib\site-packages\werkzeug\contrib\sessions.py", line 63, in <module>

    from werkzeug.datastructures import CallbackDict

  File "C:\Projects\Odoo\odoo\Odoo 11 Python 3.6 32bit\lib\site-packages\werkzeug\datastructures.py", line 2700, in <module>

    from werkzeug.http import dump_options_header, dump_header, generate_etag, \

ImportError: cannot import name 'dump_options_header'

The program '[23900] python.exe' has exited with code 1 (0x1).

 

This is the piece of code from Werkzeug where it falls-over (those are the last lines in the file):

 

# circular dependencies

from werkzeug.http import dump_options_header, dump_header, generate_etag, \

    quote_header_value, parse_set_header, unquote_etag, quote_etag, \

    parse_options_header, http_date, is_byte_range_valid

from werkzeug import exceptions

 

Unfortunately my knowledge of Python doesn't go very deep, so I'm stuck at this point. Any help would be appreciated.

 

Steven

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


--
Questo messaggio e' stato analizzato con EASY ESVA ed e' risultato non infetto.
Clicca qui per segnalarlo come spam.

Clicca qui per metterlo in blacklist

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



--

Steven Segers | Managing Partner
 steven.segers@segrey.com   +32 474 984 390
  Jonkheer Paul Coppietersdreef 30, 8200 Brugge, Belgium
  https://www.segrey.com   +32 50 969 955

Reference