Partage
  • Partager sur Facebook
  • Partager sur Twitter

Problème déploiement application sous Heroku

error: src refspec master does not match any

    22 juillet 2021 à 16:12:04

    Bonjour,
    J'ai tenté de déployer une application qui fonctionnait très bien en serveur local pour la mettre en ligne grâce à Heroku.
    Hélas, en suivant ces tutos à la lettre :
    https://www.youtube.com/watch?v=b-M2KQ6_bM4 ou celui-ci https://www.youtube.com/watch?v=j3VvVaNnDH4 , j'ai une erreur à la toute dernière étape (visible à la dernière ligne du code ci-dessous), au moment de push le travail.
    J'ai suivi scrupuleusement les tutos à la lettre, le fichier python s'exécute toujours très bien en local dans le dossier créé pour ce déploiement.
    Microsoft Windows [version 10.0.19042.1083]
    (c) Microsoft Corporation. Tous droits réservés.
    (env) C:\Users\levog\Simplon\dashapp>git init
    Initialized empty Git repository in C:/Users/levog/Simplon/dashapp/.git/
    
    (env) C:\Users\levog\Simplon\dashapp>pip install pandas
    Collecting pandas
      Downloading pandas-1.3.0-cp39-cp39-win_amd64.whl (10.2 MB)
         |████████████████████████████████| 10.2 MB 1.7 MB/s
    Collecting numpy>=1.17.3
      Downloading numpy-1.21.1-cp39-cp39-win_amd64.whl (14.0 MB)
         |████████████████████████████████| 14.0 MB 1.7 MB/s
    Collecting python-dateutil>=2.7.3
      Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
         |████████████████████████████████| 247 kB 2.2 MB/s
    Collecting pytz>=2017.3
      Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB)
    Collecting six>=1.5
      Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
    Installing collected packages: six, pytz, python-dateutil, numpy, pandas
    Successfully installed numpy-1.21.1 pandas-1.3.0 python-dateutil-2.8.2 pytz-2021.1 six-1.1
    6.0
    
    (env) C:\Users\levog\Simplon\dashapp>pip install poltly
    ERROR: Could not find a version that satisfies the requirement poltly (from versions: none
    )
    ERROR: No matching distribution found for poltly
    
    (env) C:\Users\levog\Simplon\dashapp>pip install plotly
    Collecting plotly
      Downloading plotly-5.1.0-py2.py3-none-any.whl (20.6 MB)
         |████████████████████████████████| 20.6 MB 328 kB/s
    Requirement already satisfied: six in c:\users\levog\simplon\dashapp\env\lib\site-packages
     (from plotly) (1.16.0)
    Collecting tenacity>=6.2.0
      Downloading tenacity-8.0.1-py3-none-any.whl (24 kB)
    Installing collected packages: tenacity, plotly
    Successfully installed plotly-5.1.0 tenacity-8.0.1
    
    (env) C:\Users\levog\Simplon\dashapp>pip install dash
    Collecting dash
      Downloading dash-1.21.0.tar.gz (1.1 MB)
         |████████████████████████████████| 1.1 MB 939 kB/s
    Collecting Flask>=1.0.4
      Downloading Flask-2.0.1-py3-none-any.whl (94 kB)
         |████████████████████████████████| 94 kB 972 kB/s
    Collecting flask-compress
      Downloading Flask_Compress-1.10.1-py3-none-any.whl (7.9 kB)
    Requirement already satisfied: plotly in c:\users\levog\simplon\dashapp\env\lib\site-packa
    ges (from dash) (5.1.0)
    Collecting dash-core-components==1.17.1
      Downloading dash_core_components-1.17.1.tar.gz (3.7 MB)
         |████████████████████████████████| 3.7 MB 1.6 MB/s
    Collecting dash-html-components==1.1.4
      Downloading dash_html_components-1.1.4.tar.gz (83 kB)
         |████████████████████████████████| 83 kB 784 kB/s
    Collecting dash-table==4.12.0
      Downloading dash_table-4.12.0.tar.gz (1.8 MB)
         |████████████████████████████████| 1.8 MB 1.1 MB/s
    Collecting future
      Using cached future-0.18.2.tar.gz (829 kB)
    Collecting click>=7.1.2
      Downloading click-8.0.1-py3-none-any.whl (97 kB)
         |████████████████████████████████| 97 kB 1.1 MB/s
    Collecting Werkzeug>=2.0
      Downloading Werkzeug-2.0.1-py3-none-any.whl (288 kB)
         |████████████████████████████████| 288 kB 1.7 MB/s
    Collecting Jinja2>=3.0
      Using cached Jinja2-3.0.1-py3-none-any.whl (133 kB)
    Collecting itsdangerous>=2.0
      Downloading itsdangerous-2.0.1-py3-none-any.whl (18 kB)
    Collecting colorama
      Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
    Collecting MarkupSafe>=2.0
      Downloading MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl (14 kB)
    Collecting brotli
      Downloading Brotli-1.0.9-cp39-cp39-win_amd64.whl (383 kB)
         |████████████████████████████████| 383 kB 501 kB/s
    Requirement already satisfied: tenacity>=6.2.0 in c:\users\levog\simplon\dashapp\env\lib\s
    ite-packages (from plotly->dash) (8.0.1)
    Requirement already satisfied: six in c:\users\levog\simplon\dashapp\env\lib\site-packages
     (from plotly->dash) (1.16.0)
    Using legacy 'setup.py install' for dash, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for dash-core-components, since package 'wheel' is not ins
    talled.
    Using legacy 'setup.py install' for dash-html-components, since package 'wheel' is not ins
    talled.
    Using legacy 'setup.py install' for dash-table, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
    Installing collected packages: MarkupSafe, colorama, Werkzeug, Jinja2, itsdangerous, click
    , Flask, brotli, future, flask-compress, dash-table, dash-html-components, dash-core-compo
    nents, dash
        Running setup.py install for future ... done
        Running setup.py install for dash-table ... done
        Running setup.py install for dash-html-components ... done
        Running setup.py install for dash-core-components ... done
        Running setup.py install for dash ... done
    Successfully installed Flask-2.0.1 Jinja2-3.0.1 MarkupSafe-2.0.1 Werkzeug-2.0.1 brotli-1.0
    .9 click-8.0.1 colorama-0.4.4 dash-1.21.0 dash-core-components-1.17.1 dash-html-components
    -1.1.4 dash-table-4.12.0 flask-compress-1.10.1 future-0.18.2 itsdangerous-2.0.1
    
    (env) C:\Users\levog\Simplon\dashapp>pip install gunicorn
    Collecting gunicorn
      Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
         |████████████████████████████████| 79 kB 988 kB/s
    Requirement already satisfied: setuptools>=3.0 in c:\users\levog\simplon\dashapp\env\lib\s
    ite-packages (from gunicorn) (57.4.0)
    Installing collected packages: gunicorn
    Successfully installed gunicorn-20.1.0
    
    (env) C:\Users\levog\Simplon\dashapp>pip freeze > requirements.txt
    
    (env) C:\Users\levog\Simplon\dashapp>heroku login
     »   Warning: heroku update available from 7.53.0 to 7.56.1.
    heroku: Press any key to open up the browser to login or q to exit:
    Opening browser to https://cli-auth.heroku.com/auth/cli/browser/50343df9-c8bf-4a60-8658-64
    9f9b78ea33?requestor=SFMyNTY.g2gDbQAAAAw5My4yOC4yNDEuMTNuBgA4KHjOegFiAAFRgA.tbJKRa2xFU89VW
    QE_Q8PCK8e7Oa6xJCaFrGtmkdTUjw
    Logging in... done
    Logged in as ***@hotmail.fr
    
    (env) C:\Users\levog\Simplon\dashapp>heroku create velos-nantesmetropole
     »   Warning: heroku update available from 7.53.0 to 7.56.1.
    Creating ⬢ velos-nantesmetropole... done
    https://velos-nantesmetropole.herokuapp.com/ | https://git.heroku.com/velos-nantesmetropol
    e.git
    
    (env) C:\Users\levog\Simplon\dashapp>git add .
    warning: LF will be replaced by CRLF in .idea/inspectionProfiles/profiles_settings.xml.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in app.py.
    The file will have its original line endings in your working directory
    
    (env) C:\Users\levog\Simplon\dashapp>git commit -m "initial launch"
    [main (root-commit) 78aaefa] initial launch
     20 files changed, 1013 insertions(+)
     create mode 100644 .gitignore
     create mode 100644 .idea/.gitignore
     create mode 100644 .idea/dashapp.iml
     create mode 100644 .idea/inspectionProfiles/profiles_settings.xml
     create mode 100644 .idea/misc.xml
     create mode 100644 .idea/modules.xml
     create mode 100644 .idea/vcs.xml
     create mode 100644 BackupBDD.py
     create mode 100644 Create_bdd.py
     create mode 100644 Creation_fichier_types.py
     create mode 100644 Nettoyage_mesures.py
     create mode 100644 Nettoyage_meteo.py
     create mode 100644 Nettoyage_stations.py
     create mode 100644 Procfile
     create mode 100644 app.py
     create mode 100644 carto.py
     create mode 100644 data.py
     create mode 100644 meta.py
     create mode 100644 requirements.txt
     create mode 100644 "v\303\251los_nantesmetropole.db"
    
    (env) C:\Users\levog\Simplon\dashapp>git push heroku master
    error: src refspec master does not match any
    error: failed to push some refs to 'https://git.heroku.com/velos-nantesmetropole.git'
    Merci beaucoup !
    • Partager sur Facebook
    • Partager sur Twitter
      23 juillet 2021 à 13:15:04

      il semblerait que la branche master n'utilise plus ce nom, mais est remplacer par main, ce qu'indique aussi la page d'aide de déploiement d'heroku => https://devcenter.heroku.com/articles/git#deploying-code 

      Dans la 1ère vidéo, le youtubeur indique (à partir de 15 minutes 10 secondes quand il se logue sur heroku) que dans la partie deploy du projet sur heroku, les commandes à utiliser sont indiquées; donc vérifie celles-ci, ça devrait être main au lieu de master

      • Partager sur Facebook
      • Partager sur Twitter

      Problème déploiement application sous Heroku

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      • Editeur
      • Markdown