question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: unsupported operand type(s) for /: 'tuple' and 'str'

See original GitHub issue

I have just discovered this library. But the example is not even running and there seems to be a problem which may be related to the issue reported here. What is the work-around just to get the library going - any older versions which would work?

We use poetry for package management

[tool.poetry.dependencies]
python = "^3.10"
fastapi-code-generator = "^0.3.4"
fastapi = "^0.74.1"
path = root / "pyproject.toml"

TypeError: unsupported operand type(s) for /: ‘tuple’ and ‘str’

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
asik03commented, Mar 4, 2022

Quick fix:

In the source code /python3.9/site-packages/datamodel_code_generator/format.py:

I have changed manually in line 45

path = root / "pyproject.toml"

to

path = root[0] / "pyproject.toml"

The project was generated automatically after this change.

2reactions
jayvdbcommented, Sep 6, 2022

I think this issue should be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'
You're trying to substract two tuples (with RGB values), and arithmetic operations on tuples like * and - are not defined.
Read more >
TypeError: unsupported operand type(s) for -: tuple and int
The Python "TypeError: unsupported operand type(s) for -: 'tuple' and 'int'" occurs when we try to use the subtraction operator with a tuple...
Read more >
unsupported operand type(s) for /: 'int' and 'tuple' mean in ...
As the message indicates it means you are trying to add an int to a str. It is impossible to say exactly what...
Read more >
TypeError: unsupported operand type(s) for &: 'str' and 'tuple'
I am stuck at this exercise: https://www.codecademy.com/courses/python-beginner-sRXwR/3/4?curriculum_id=4f89dab3d788890003000096# Error message is ...
Read more >
TypeError: unsupported operand type(s) for -: 'str' and 'str'
The python error TypeError: unsupported operand type(s) for -: 'str' and 'str' occurs when you try to subtract a string from another that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found