Freezing beer gives me this git related error

I work with python and git in a simple Turbogears2 project that I created for fun. At some point I want to deploy it to Heroku, so I do the usual pip freeze > requirements.txt , and I get this error:

 Error when trying to get requirement for VCS system Command /usr/bin/git config remote.origin.url failed with error code 1 in /home/ricardo/myprojs/hellotg22/example, falling back to uneditable format 

And in the requirements.txt that it creates, indicated between all the dependencies, I find this line that does not look good:

 ... decorator==3.4.0 ## !! Could not determine repository location example==0.1dev ... 

Does anyone know what the problem is?

In any case, I managed to get the requirements.txt file, but I would like to know what happens with this error.

+6
source share
3 answers

There is no โ€œsourceโ€ in your git repository, so pip cannot detect the remote repository URL. This should have been fixed in PIP, as stated at https://github.com/pypa/pip/issues/58

Try updating pip or adding remote start to git repository

+9
source

I was getting this error while working on the editable installation ( pip install -e . ) Of my project. So I added localhost remote ( git remote add origin git@localhost :the_project_name ), and now pip freeze no longer complains. I got the idea from https://linuxprograms.wordpress.com/2010/05/10/how-to-set-up-a-git-repository-locally/

+5
source

Try using pip freeze -l , as it also works in a virtual environment. So your command will be pip freeze -l > requirements.txt . I use this and it works great.

In the help menu:

 Freeze Options: -l, --local If in a virtualenv that has global access, do not output globally- installed packages. 
0
source

Source: https://habr.com/ru/post/956903/


All Articles