thebjorn/pydeps

can't find directory?

Closed this issue · 9 comments

Hi, I just installed pydeps, and i'm now trying to run it.

ask@Garsy:~/Git$ ls
archAnalysis  devops-21  Indistinguishables  raven-reader  tweeda  Zeeguu-API

I want to make a graph from the project called Zeegu-API:
ask@Garsy:~/Git$ pydeps Zeeguu-API

which gives me:
`

ERROR: [Errno 2] No such file or directory: 'Zeeguu-API'

`

I try with some of the flags from examples in the readme:

ask@Garsy:~/Git$ pydeps -x os sys -- Zeeguu-API
This has same issue. It persist when I give the fill path. What do I do? How can I actually use this tool?

Zeeguu-API is not an importable name.

but it's a directory? shouldnt Isnt the idea with this tool that I should be able to give it a folder with a python project, and then graph dependencies inside?

pydeps does so by examining the bytecodes, looking for imports, it can only do that if it can import your code. For a normal package structure you would have a directory structure that looks something like:

(dev35) go|c:\srv\tmp\issue90> tree Zeeguu-API
Zeeguu-API
|   `-- LICENSE
|   `-- README.rst
|   `-- setup.py
    `-- zeeguu_api
    |-- __init__.py
    |-- source1.py
    `-- source2.py

where your package/project can be imported as import zeeguu_api after you run pip install -e . from the directory containing setup.py.

hmm, allright. So now I cd'ed into the Zeegu lib, and ran the install:

ask@Garsy:~/Git/Zeeguu-API$ pip3 install -e .

which worked, fine, so now running:

ask@Garsy:~/Git/Zeeguu-API$ pydeps Zeeguu-API
   No such file or directory: 'Zeeguu-API'

and also:

ask@Garsy:~/Git/Zeeguu-API$ pydeps .

	ERROR: [Errno 2] No such file or directory: 'Zeeguu-API'

So the issue remains. What are the specific steps I should take before I can use this tool?

Then you need to call pydeps on the source directory zeeguu_api in my example, ie. a directory that has an importable name.

So I need to call in with lowecercase letters? but, I have no directory of that name? it does not exist?

Meaning, if I write:

ask@Garsy:~/Git$ pydeps zeeguu-api
No such file or directory: 'zeeguu-api'

The problem is the hyphen... You must be able to import x where x is your module.

yes but how do I do that? The module has a hyphen, I how do I import a module that has a hyphen, without using a hyphen?

You can't. Modules cannot have hyphens in Python, it is a SyntaxError. You need to rename your module to something that is importable.