Code Monkey home page Code Monkey logo

Comments (6)

5demayo avatar 5demayo commented on May 27, 2024 1

I came across the same issue on MacOSX that uses python version 2 by default. You need to make sure you are running version 3+ by default. After you get past this error you will have to install PyYaml.

from swagger_to_uml.

fenollp avatar fenollp commented on May 27, 2024 1

apt search python3-yaml

from swagger_to_uml.

nlohmann avatar nlohmann commented on May 27, 2024

Which Python version are you using? What is the error actual message (your message only indicates a file position)?

from swagger_to_uml.

Lolek1978 avatar Lolek1978 commented on May 27, 2024

@nlohmann Sorry, I didn't notice :( - I got exactly this message

  File "swagger_to_uml.py", line 376
    print(sw.uml, end='', flush=True)
                     ^
SyntaxError: invalid syntax

I use a 2.7.12 version of Python - however I upgrade Python to 3.6 version and i got the same the new error message :-)

/opt/repos/swagger_to_uml# python3.6 swagger_to_uml.py petstore_example/swagger.json >petstore_example/swagger.puml
Traceback (most recent call last):
  File "swagger_to_uml.py", line 24, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

I tried to install python-yaml and i got


apt-get install python-yaml
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-yaml is already the newest version (3.11-3build1).
0 upgraded, 0 newly installed, 0 to remove and 138 not upgraded.

So probably i doing something wrong again :( :]

from swagger_to_uml.

nlohmann avatar nlohmann commented on May 27, 2024

Note you do not need to install all packages globally. This should work:

python3 -mvenv venv
venv/bin/pip3 install yaml
venv/bin/python3 swagger_to_uml.py

from swagger_to_uml.

Lolek1978 avatar Lolek1978 commented on May 27, 2024

@fenollp Thanks ;) for a hint :). It's alive ;).

@nlohmann I tried to call script thats way but i got a lot more of errors ;) - so I stay with @fenollp sollution :). Thanks for a great job :). I have a fresh new sandbox for swagger conversion ;).

from swagger_to_uml.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.