ClimenteA/pyvan

excution interrupted on pyvan van.py completion with flask app having bokeh 1.4

Closed this issue · 7 comments

Getting issue with running van.py with error as below. The flask app (using bokeh 1.4.0 under a python virtual environment) run fine on web/desktop version but when I run python van.py to convert the app into executable version, I get following issue.

Collecting bokeh==1.4.0
Downloading https://files.pythonhosted.org/packages/de/70/fdd4b186d8570a737372487cc5547aac885a1270626e3ebf03db1808e4ed/bokeh-1.4.0.tar.gz (32.4MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\dnsingh\pycharmprojects\newtrial\dist\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\DNSingh\AppData\Local\Temp\pip-install-ymn122fy\bokeh\setup.py'"'
"'; file='"'"'C:\Users\DNSingh\AppData\Local\Temp\pip-install-ymn122fy\bokeh\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.clos
e();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\DNSingh\AppData\Local\Temp\pip-install-ymn122fy\bokeh\pip-egg-info'
cwd: C:\Users\DNSingh\AppData\Local\Temp\pip-install-ymn122fy\bokeh
Complete output (5 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\DNSingh\AppData\Local\Temp\pip-install-ymn122fy\bokeh\setup.py", line 68, in
from _setup_support import (
ModuleNotFoundError: No module named '_setup_support'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
###########
2020-01-19 14:40:52.260516
ERROR:
('pip3.exe install -r ../requirements.txt --no-cache-dir --no-warn-script-location', 1, b'')

Details:
Traceback (most recent call last):
File "van.py", line 13, in
"embeded_python_location": "https://www.python.org/ftp/python/3.6.8/python-3.6.8-embed-amd64.zip",
File "C:\Users\DNSingh\Newtrial2\lib\site-packages\pyvan.py", line 293, in build
get_modules(modules_to_install)
File "C:\Users\DNSingh\Newtrial2\lib\site-packages\pyvan.py", line 219, in get_modules
run_cmd(cmd)
File "C:\Users\DNSingh\Newtrial2\lib\site-packages\pyvan.py", line 48, in run_cmd
raise Exception(command, exitCode, output)
Exception: ('pip3.exe install -r ../requirements.txt --no-cache-dir --no-warn-script-location', 1, b'')

###########
Press enter to exit..


Is there any other way to add all library like copying lib folder directly from virtual environment to dist->Lib folder and completing the van.py execution?

Something happend on installing bokeh it seems..

File "C:\Users\DNSingh\AppData\Local\Temp\pip-install-ymn122fy\bokeh\setup.py", line 68, in
from _setup_support import (
ModuleNotFoundError: No module named '_setup_support'

To debug pyvan:

  • Enter in the dist folder there you have the embeded version of python with the scripts you wrote.
  • try to run your script file from there python myscript.py and see where it fails (most probably at installing additional modules)
  • then install them manually go in the dist/Scripts folder (there you have pip.exe) and install the modules needed to run the script

Adding support for pipenv will be I think more realible, I'll see what i can do.

Can you provide a link to your github repo to test it on my side and see if I can fix it?

If not feel free to make a pull request.

Thanks for replying. I worked on your proposed solutions but it didn't work. I have shared the github repo with you.
click here
https://github.com/dns4code/ZPlan/invitations

The issue is either with .tar files pip can't install them properly..

I found an awesome article which shows step by step what needs to be done (I will update pyvan soon)

Folow the steps presented in the article and it will work.

Thanks!

Uploaded a new version 0.0.5 !

Now if a module fails to install it will be skipped and the execution will run to the end.
Modules that failed to install will be found in dist/Scripts/FAILED_TO_INSTALL_MODULES.txt
Added the option to manually specify the modules you need (RECOMMENDED)

i tried but same error!

Traceback (most recent call last):
File "d:/PROJECT/engine/api_example/van.py", line 14, in
pyvan.build(OPTIONS)
File "C:\Users\pronixx\AppData\Local\Programs\Python\Python38\lib\site-packages\pyvan.py", line 261, in build
GET_PIP_PATH, PYTHON_EMBEDED_PATH, pth_file, zip_pyfile = process_options(OPTIONS)
File "C:\Users\pronixx\AppData\Local\Programs\Python\Python38\lib\site-packages\pyvan.py", line 225, in process_options
if OPTIONS['path_to_get_pip_and_python_embeded_zip'] == "":
KeyError: 'path_to_get_pip_and_python_embeded_zip'

Make sure bellow key is available in option dict
KeyError: 'path_to_get_pip_and_python_embeded_zip'

import pyvan 

OPTIONS = {"main_file_name": "main.py", #entry point of your scripts
            "show_console": False,
            "use_pipreqs": True,
            "install_only_these_modules": [],
            "exclude_modules":[],
            "include_modules":[],
            "path_to_get_pip_and_python_embeded_zip": ""  # this if left empty will look into downloads folder for python embeded zip + get_pip.py
            }

pyvan.build(OPTIONS)