beeware / voc

A transpiler that converts Python code into Java bytecode

Home Page:http://beeware.org/voc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tutorial0: Installation seems to be fine - still: "The command "voc" is either wrong or could not be found"

Sammeeey opened this issue · comments

Hi,
I am working on Windows 10 Pro 64 bit.

I installed python, JDK and Apache ANT:

>python --version
Python 3.7.2
>javac -version
javac 12
>ant -version
Apache Ant(TM) version 1.10.5 compiled on July 10 2018

Then I created the virtual environment and installed voc into it:

C:\>mkdir tutorial

C:\>cd tutorial

C:\tutorial>git clone https://github.com/pybee/voc.git
Cloning into 'voc'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 23847 (delta 0), reused 0 (delta 0), pack-reused 23841 eceiving objects: 100% (23847/23847Receiving objects: 100% (23847/23847), 14.32 MiB | 87.00 KiB/s, done.

Resolving deltas: 100% (15787/15787), done.

Afterwards I used cmd under Administrator permisson (and yes, I am admin):

C:\>cd tutorial

C:\tutorial>py -3 -m venv env

C:\tutorial>env\Scripts\activate.bat
Parameterformat falsch - 850.

(env) C:\tutorial>cd voc

(env) C:\tutorial\voc>pip install -e .
Obtaining file:///C:/tutorial/voc
Installing collected packages: voc
  Running setup.py develop for voc
Successfully installed voc

First possible issue

As you can see I got a Parameterformat falsch - 850. (english probably: "parameter format wrong - 850.")
In this case it seemed still to work for their problem (even with this error)

So I went on building the support JAR file, which seems to be successful.
It ends with:

BUILD SUCCESSFUL
Total time: 10 seconds

But this always builds a "ouroboros" directory in my "tutorial" directory.
So that my directory structure looks like this:

tutorial
├── env
├── ouroboros
└── voc

Then I started with the Tutorial 0
After creating the tutorial0 directory (accidently "tutorial10" in my case) the "tutorial" directory looks like this:

tutorial
├── env
├── ouroboros
├── tutorial10
└── voc

I created the "example.py" file in my tutorial10 directory.

Actual issue

And at this point I finally get the voc command error:

C:\tutorial>voc -v example.py
Der Befehl "voc" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

english probably:

The command "voc" is either wrong or could not be found

I also tried to call "voc -v example.py" from all the directories in the tutorial directory, but it does not make a difference.

Then I finally tried the following:

C:\tutorial\voc>py voc -v example.py
Traceback (most recent call last):
  File "C:\Users\[ComputersName]\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\[ComputersName]\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "voc\__main__.py", line 1, in <module>
    import voc
ModuleNotFoundError: No module named 'voc'

So do you spot the issue (or better the solution)?
How should I go on?
Or what should I make differen?

Thanks for the report.

From the look of the logs you've provided, somewhere between installing voc and running it, you started a new shell. When you activate the virtual environment, you get a (voc) prefix on your terminal prompt. That tells you that the virtual environment is active, and the tools installed into the virtual environment (including voc) are available.

If the virtual environment isn't active, then windows won't be able to find the voc executable, which is exactly the error you're reporting.

This problem only occurs if you restart the terminal session in the middle of the tutorial - if you do it all in one, you won't get this problem.

If you do need to restart the terminal, all you need to do is re-activate the virtual environment by running env\Scripts\activate.bat (from a directory location where that path makes sense).