problem pushing changes to GitHub because of file that's not really there - python

I have been trying to push changes to my GitHub repo but been facing this problem:
Uploading LFS objects: 100% (164/164), 153 MB | 0 B/s, done.
Enumerating objects: 25977, done.
Counting objects: 100% (25968/25968), done.
Delta compression using up to 4 threads
Compressing objects: 100% (18133/18133), done.
Writing objects: 100% (25955/25955), 146.83 MiB | 232.00 KiB/s, done.
Total 25955 (delta 6561), reused 25816 (delta 6463)
remote: Resolving deltas: 100% (6561/6561), completed with 4 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 9f797e9b5f7a1c01fca6706ad62e21ba
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File venv/lib/python3.6/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so is 225.31 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/yovelcohen/nba-stats.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/yovelcohen/nba-stats.git'
(base) yovel#the-beastpad:~$ cd venv/lib/python3.6/site-packages/tensorflow_core/python/
bash: cd: venv/lib/python3.6/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so: No such file or directory
I imported TensorFlow to the project but then removed it, when trying to delete it from the terminal it's not there (and when looking for it manually).
any help would be appreactied!

Since you should not push any generated binary file anyway, start first by removing them locally, commit and push:
git rm -r '*.so' -f
echo '*.so' >> .gitignore
But if that still fails, it means you are trying to push past commits (not just the latest one) with *.so files, even though the last commit no longer includes any such files.
If that is the case, since git filter-branch is soon deprecated, consider newren/git-filter-repo to remove any large files like those *.so ones, before pushing (or force pushing of that rewrites the content of past commits previously pushed).

Related

Build on Heroku , Git issue with Push Failed, error in message :)

me again...can I please have some help, going a little bonkers here..
I have a simple Python script that I would like to connect to a scheduler task in Heroku...Its all going fine until I try deploy to Heroku. Its super simple script and its doing my mind in trying to work out why I cant deploy it.
Followed the instructions exactly from here..
https://dashboard.heroku.com/apps/*********/deploy/heroku-git
Getting this error:
(base) simon#Simons-Air ********** % git push heroku master
Enumerating objects: 47, done.
Counting objects: 100% (47/47), done.
Delta compression using up to 8 threads
Compressing objects: 100% (47/47), done.
Writing objects: 100% (47/47), 4.11 MiB | 581.00 KiB/s, done.
Total 47 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to **********.
remote:
To https://git.heroku.com/**********.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/**********.git'
Ive been into Heroku web interface and selected buildpack of Python (hoping that might be it), but still no luck.
Im on a Mac, using Visual Studio Code, with embedded terminal.
Any thoughts people?
Would be so grateful for any help.
Thanks again
Simon

There is a problem with the code, I can not find a solution

There is a problem with the code, I can not find a solution
C:\Users\sphe\justeat>git push heroku master
Enumerating objects: 61, done.
Counting objects: 100% (61/61), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (54/54), done.
Writing objects: 100% (61/61), 1015.17 KiB | 647.00 KIS/s, done.
Total 61 (delta 4), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: -----> Python app detected
remote:Requested runtime (python-3.5.2) is not available for this stack (heroku-18)
remote: More info: https://devcenter.heroku.co...
remote: ! Push failed
remote: Verifying deploy...
remote: ! Push rejected to enigmatic-spire-63168.
To https://git.heroku.com/enigm...
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/enigm...
Your Problem
remote:Requested runtime (python-3.5.2) is not available for this stack (heroku-18)
Solution:
by the official website of heroku, your python version (3.5.2) isn't compatible with heroku version 18.
From Developer Webpage:
Specifying a Python version
By default, newly created Python apps use the python-3.6.8 runtime. You can also specify a different supported Python version.
Supported runtimes
python-3.7.3 on all (heroku-16, and heroku-18) runtime stacks
python-3.6.8 on all (heroku-16, and heroku-18) runtime stacks
python-2.7.16 on all (heroku-16, and heroku-18) runtime stacks

git production , development environment

I have a project of python files on a network drive called "Development".
I create branches off Development for new features and then merge back into Development once finished. Others in future will also do this.
I want to push "Development" into another separate folder called "Production" and for the life of me cannot figure out how to do this.
Please any suggests? How to do this?
Thanks.
I get this error when attempting.
Pushing to G:\03 GIS RESOURCES\05 GIS PROGRAMMING\Production
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To G:\03 GIS RESOURCES\05 GIS PROGRAMMING\Production
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'G:\03 GIS RESOURCES\05 GIS PROGRAMMING\Production'
Option A
You can clone your Development project into another folder.
Synopsis:
git clone <repository> <directory>
Example:
git clone <path/to/Development> Production
Option B
Copy the content of folder Development (including .git folder) to folder Production.

Deploy pure python to heroku

I "finished" a little python project and I want to deploy it on heroku
GitHub page.
I want to execute: python2 main.py -i json-rpc
in order to have the json-rpc server listening for connections
but I get the following error when pushing to heroku:
$ git push heroku master Counting objects: 153, done. Delta
compression using up to 8 threads. Compressing objects: 100% (87/87),
done. Writing objects: 100% (153/153), 43.42 KiB, done. Total 153
(delta 61), reused 153 (delta 61)
-----> Heroku receiving push ! Heroku push rejected, no Cedar-supported app detected
To git#heroku.com:panager.git ! [remote rejected] master -> master
(pre-receive hook declined) error: failed to push some refs to
'git#heroku.com:panager.git'
What you might want to try doing is creating a Procfile. The full filename is Procfile, no extension, and it goes in the main directory of your project folder.
The content of that file would be:
web: python main.py -i json-rpc
Give that a shot and see if it works.
Alternatively, you may have forgotten to create a virtualenv for your app.
You should follow the instructions in Heroku's guide Getting Started with Python on Heroku
Update:
Having finally tested this myself on a fresh Heroku app, what you're missing is a requirements.txt. Even though you don't have any dependencies, you still need it. Within your virtualenv in the main project folder, run pip freeze > requirements.txt, and then git add . then git commit -m "added requirements.txt", and then push to Heroku and it should work.
Also, make sure that requirements.txt is saved with ANSI encoding, not Unicode or UTF-8! If you're a total n00b like me you can simply open requirements.txt in Notepad, choose SAVE AS and change the "Encoding" from the drop down. I tried all of the recommendations above but my error was due to this simple encoding problem.

How to download the Enthought Tool Suite python script?

I have Python downloaded already, but want to contribute code to the Enthought Tool Suite (ETS). According to this site (http://code.enthought.com/source/):
it says to download the following python script: https://raw.github.com/enthought/ets/master/ets.py
I put the ets.py into the python script, save as...and in the Python Shell, I typed in "import ets"
However, nothing happens.
Also, the site says to run the following commands:
$ mkdir ets
$ cd ets # and copy ets.py here
$ python ets.py clone
Typing those lines in Python Shell gives me the message: "SyntaxError: invalid syntax"
As you can see, I'm new to Python, and I don't know what I'm doing. How do I download the ETS script and run the commands??
Those last commands aren't meant to be entered into the Python console, they're meant to be entered at the terminal shell.
localhost-2:tmp $ mkdir ets
localhost-2:tmp $ cd ets
localhost-2:ets $ cp ../ets.py .
This last command assumes that ets.py was in the original directory. Now we can run it [edit: make sure you have git installed, or this won't work]:
localhost-2:ets $ python ets.py clone
Cloning package encore
URL: https://github.com/enthought/encore.git
Cloning into encore...
remote: Counting objects: 1081, done.
remote: Compressing objects: 100% (483/483), done.
remote: Total 1081 (delta 729), reused 942 (delta 592)
Receiving objects: 100% (1081/1081), 981.12 KiB | 1.80 MiB/s, done.
Resolving deltas: 100% (729/729), done.
Cloning package traits
URL: https://github.com/enthought/traits.git
Cloning into traits...
[etc.]
Cloning package etsproxy
URL: https://github.com/enthought/etsproxy.git
Cloning into etsproxy...
remote: Counting objects: 3577, done.
remote: Compressing objects: 100% (2243/2243), done.
remote: Total 3577 (delta 1053), reused 3571 (delta 1047)
Receiving objects: 100% (3577/3577), 369.81 KiB, done.
Resolving deltas: 100% (1053/1053), done.
After this, you need to install everything (this will look different depending on your operating system):
localhost-2:ets $ python ets.py develop
Running command ['/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', 'setup.py', 'develop'] in package encore
running develop
running egg_info
creating encore.egg-info
writing encore.egg-info/PKG-INFO
[long build process removed]

Categories

Resources