Python Forum
How to get pyreverse to work
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get pyreverse to work
#1
Good day. I want to get pyreverse to work on my windows 7 so I can use it to study code and its relation to modeling. I am using vs code as my ide. Fortunately, I checked my command line in order to install pylint and it tells me that my pylint is up to date. I then tried running pylint as a command but it returned false, that it is not recognized as a command. I also tried running pyreverse and got the same message. I have already installed graphviz on my system as I read on the internet. I still cannot know how to make pyreverse to work. Please, can someone help me. My system is windows 7.
Reply
#2
pyreverse
Quote:Pyreverse has now been integrated to pylint : http://pypi.python.org/pypi/pylint/
So you install pylint with pip.
Check that all working from command line with pip -V and python -V
The path that pip -V show is the interpreter you choose in VS Code(down in left corner).
pip install pylint
Check these:
Python 3.8 (3.6-3.7) and pip installation under Windows
VS Code from start

Example:
# Test pip
C:\>pip -V
pip 20.0.2 from c:\python37\lib\site-packages\pip (python 3.7)

# Install
C:\>pip install pylint --upgrade
Collecting pylint .....
Successfully uninstalled pylint-2.1.1
Successfully installed astroid-2.4.1 lazy-object-proxy-1.4.3 pylint-2.5.2 wrapt-
1.12.1

# Test that it work
C:\>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Inte
l)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylint
>>>
>>> pylint.__version__
'2.5.2'
>>> exit()

C:\>
Reply
#3
(Jun-02-2020, 04:44 PM)snippsat Wrote: pyreverse
Quote:Pyreverse has now been integrated to pylint : http://pypi.python.org/pypi/pylint/
So you install pylint with pip.
Check that all working from command line with pip -V and python -V
The path that pip -V show is the interpreter you choose in VS Code(down in left corner).
pip install pylint
Check these:
Python 3.8 (3.6-3.7) and pip installation under Windows
VS Code from start

Example:
# Test pip
C:\>pip -V
pip 20.0.2 from c:\python37\lib\site-packages\pip (python 3.7)

# Install
C:\>pip install pylint --upgrade
Collecting pylint .....
Successfully uninstalled pylint-2.1.1
Successfully installed astroid-2.4.1 lazy-object-proxy-1.4.3 pylint-2.5.2 wrapt-
1.12.1

# Test that it work
C:\>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Inte
l)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylint
>>>
>>> pylint.__version__
'2.5.2'
>>> exit()

C:\>
Thanks. I tried the commandline input above it worked. But my question is about calling pyreverse. I still got the error message that pyreverse is not recognized. How do I call up pyreverse, please.Python saw pylint but could not see pyreverse and I need to work with pyreverse.
Reply
#4
If python is in environment variables path,then eg pyreverse --help shall work from command line(from any place).
It get installed in Scripts(pyreverse.exe) folder root python.
Quick test.
Output:
E:\div_code\class λ pyreverse --help Usage: pyreverse [options] <packages> create UML diagrams for classes and modules in <packages> Options: -h, --help show this help message and exit -f <mode>, --filter-mode=<mode> filter attributes and functions according to <mode>. Correct modes are : 'PUB_ONLY' filter all non public attributes [DEFAULT], equivalent to PRIVATE+SPECIAL_A 'ALL' no filter 'SPECIAL' filter Python special functions except constructor 'OTHER' filter protected and private attributes [current: PUB_ONLY] -c <class>, --class=<class> create a class diagram with all classes related to <class>; this uses by default the options -ASmy [current: none] -a <ancestor>, --show-ancestors=<ancestor> show <ancestor> generations of ancestor classes not in <projects> -A, --all-ancestors show all ancestors off all classes in <projects> -s <association_level>, --show-associated=<association_level> show <association_level> levels of associated classes not in <projects> -S, --all-associated show recursively all associated off all associated classes -b, --show-builtin include builtin objects in representation of classes -m [yn], --module-names=[yn] include module name in representation of classes -k, --only-classnames don't show attributes and methods in the class boxes; this disables -f values -o <format>, --output=<format> create a *.<format> output file if format available. [current: dot] --ignore=<file[,file...]> Add files or directories to the blacklist. They should be base names, not paths. [current: CVS] -p <project name>, --project=<project name> set the project name. [current: none]
Usage:
# Install graphviz
E:\div_code\class
λ choco install graphviz
Chocolatey v0.10.15
Installing the following packages:
graphviz
By installing you accept licenses for the packages.
Progress: Downloading Graphviz 2.38.0.20190211... 100%
.....
Added C:\ProgramData\chocolatey\bin\dot.exe shim pointed to 'c:\program files (x86)\graphviz2.38\bin\dot.exe'.
The install of graphviz was successful.

# Test pyreverse
E:\div_code\class
λ pyreverse dog_pet.py -a1 -s1
parsing dog_pet.py...

# Use .dot file generated bye pyreverse
E:\div_code\class
λ dot -Tpdf classes.dot -o output.pdf
   
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020