Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run python setup.py android. #1

Closed
RatanShreshtha opened this issue Sep 25, 2017 · 9 comments
Closed

Unable to run python setup.py android. #1

RatanShreshtha opened this issue Sep 25, 2017 · 9 comments

Comments

@RatanShreshtha
Copy link

I am following the README.md to the line but when I run python setup.py android I am getting following error.

running android
 * Writing application template...
Template Python-Android-template succesfully updated.
Project template: /home/ratan/.cookiecutters/Python-Android-template
Traceback (most recent call last):
  File "setup.py", line 24, in <module>
    'bundle': 'com.example'
  File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/briefcase/app.py", line 336, in run
    self.generate_app_template()
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/briefcase/app.py", line 195, in generate_app_template
    'secret_key': self.secret_key,
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/cookiecutter/main.py", line 63, in cookiecutter
    no_input=no_input,
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/cookiecutter/repository.py", line 101, in determine_repo_dir
    '\n'.join(repository_candidates)
cookiecutter.exceptions.RepositoryNotFound: A valid repository for "/home/ratan/.cookiecutters/Python-Android-template" could not be found in the following locations:
/home/ratan/.cookiecutters/Python-Android-template
/home/ratan/.cookiecutters/Python-Android-template

I am using Fedora 26 and python 3.6.

@eliasdorneles
Copy link
Owner

Interesting, several people are having that problem.
Can you delete that /home/ratan/.cookiecutters/Python-Android-template directory and then try again?
Thanks!

@RatanShreshtha
Copy link
Author

I have tried that already and it didn't work.

@eliasdorneles
Copy link
Owner

Oh, can you try using Python 3.5 then?

@eliasdorneles
Copy link
Owner

Nvm, I just tried with Python 3.6 and it worked.
So, can you please attach here the contents of that directory in a Zip file?
Also, it might be worth trying again deleting that directory and re-run the commands, just in case it was a flaky issue.

@RatanShreshtha
Copy link
Author

After removing /home/ratan/.cookiecutters/Python-Android-template I am getting a new error

running android
 * Writing application template...
Project template: https://github.com/pybee/Python-Android-template.git
Traceback (most recent call last):
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/cookiecutter/vcs.py", line 129, in clone
    stderr=subprocess.STDOUT,
  File "/usr/lib64/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/lib64/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'checkout', '3.6']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 24, in <module>
    'bundle': 'com.example'
  File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/briefcase/app.py", line 336, in run
    self.generate_app_template()
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/briefcase/app.py", line 195, in generate_app_template
    'secret_key': self.secret_key,
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/cookiecutter/main.py", line 63, in cookiecutter
    no_input=no_input,
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/cookiecutter/repository.py", line 84, in determine_repo_dir
    no_input=no_input,
  File "/home/ratan/.virtualenvs/vocenv/lib64/python3.6/site-packages/cookiecutter/vcs.py", line 132, in clone
    if 'not found' in clone_error.output.lower():
TypeError: a bytes-like object is required, not 'str'

And here is the zip file

appname.zip

@eliasdorneles
Copy link
Owner

Thanks @RatanShreshtha , I think I understand better the problem now.

First thing, make sure you have the most recent briefcase in the virtualenv with:

pip install -U briefcase

Then, try entering that directory:

cd /home/ratan/.cookiecutters/Python-Android-template

And check out the 3.5 branch:

git checkout 3.5

And then try running python setup.py android again.

Let me know how it goes!

@RatanShreshtha
Copy link
Author

Thanks @eliasdorneles it is now working, can you suggest me how can I learn more beeware project and I love this concept so I also want to contribute but I am not sure how can I do that ?

@eliasdorneles
Copy link
Owner

Great to hear, @RatanShreshtha !
Closing this, since your problem was solved! 👍

As for suggestions on learning an contributing, the main piece behind this template is the VOC compiler: https://github.com/pybee/voc
It would definitely benefit from your help! =)
There is a guide for first-time contributions here: https://pybee.org/contributing/how/first-time/what/voc/

Another way of finding things to do in VOC is to search the codebase for NotImplementedError being thrown: https://github.com/pybee/voc/search?utf8=%E2%9C%93&q=throw+new+org.python.exceptions.NotImplementedError&type=
Then you can try to implement one of those functions and send a pull-request. =)

@BlockWaving
Copy link

Hi @eliasdorneles. I am new to cookiecutter and briefcase and followed https://briefcase.readthedocs.io/en/latest/tutorial/tutorial-0.html . I am on Windows 10, and encountered the same issue as above.

(BeeEnv) D:\bee_proj>cookiecutter https://github.com/pybee/Python-Android-template
Traceback (most recent call last):
File "d:\anaconda3_5.3.1\envs\beeenv\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "d:\anaconda3_5.3.1\envs\beeenv\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\Anaconda3_5.3.1\envs\BeeEnv\Scripts\cookiecutter.exe_main
.py", line 9, in
File "d:\anaconda3_5.3.1\envs\beeenv\lib\site-packages\click\core.py", line 764, in call
return self.main(*args, **kwargs)
File "d:\anaconda3_5.3.1\envs\beeenv\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "d:\anaconda3_5.3.1\envs\beeenv\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "d:\anaconda3_5.3.1\envs\beeenv\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "d:\anaconda3_5.3.1\envs\beeenv\lib\site-packages\cookiecutter\cli.py", line 120, in main
password=os.environ.get('COOKIECUTTER_REPO_PASSWORD')
File "d:\anaconda3_5.3.1\envs\beeenv\lib\site-packages\cookiecutter\main.py", line 63, in cookiecutter
password=password
File "d:\anaconda3_5.3.1\envs\beeenv\lib\site-packages\cookiecutter\repository.py", line 103, in determine_repo_dir
no_input=no_input,
File "d:\anaconda3_5.3.1\envs\beeenv\lib\site-packages\cookiecutter\vcs.py", line 99, in clone
stderr=subprocess.STDOUT,
File "d:\anaconda3_5.3.1\envs\beeenv\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "d:\anaconda3_5.3.1\envs\beeenv\lib\subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/pybee/Python-Android-template']' returned non-zero exit status 128.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants