简体   繁体   中英

Can't publish using Visual studio 2017 (community version)

I have a small project with python finished and ready to publish (transforming everything into one executable); but, when I disposed to do so, I realized that the "publish" button was disabled. I tried looking explanations in the internet, but didn't get anything. Then, I searched for a publish alternative, but the ones I found seemed to be overcomplicated and untrusty.

Because of that, now I come here to ask for your knowledge/help on this matter that troubles me.

I stay tuned to your answers and wish you a great day :)

Update: tried with PyInstaller and cx_freeze. PyInstaller gives me the:

RecursionError: maximum recursion depth exceeded

And cx_freeze creates everything, but, when I run the executable, it closes inmediatly (and yes, I tried adding an input("promt...") at the end, without success).

By chance, you will not know how to solve any of these problems? :/

I finally solved it. I used pyintaller (cx_freeze didn't work), but in the .spec added this at the start:

import sys
sys.setrecursionlimit(5000)

And in the Analysis added:

hiddenimports=['sklearn.neighbors',
        'sklearn.neighbors.typedefs',
        'sklearn.neighbors.quad_tree',
        'sklearn.utils.sparsetools._graph_validation',
        'sklearn.utils.sparsetools._graph_tools',
        'sklearn.utils.lgamma',
        'sklearn.utils.weight_vector',
        'sklearn.utils.fixes',
        'sklearn.tree._utils',
        'sklearn.utils.extmath',
        'sklearn.metrics.ranking']

Hope it helps someone so they don't lose all day searching for the solution like I did :P

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM