Tag: python

No module named ib.message

I am trying to set up IBPY and Python on my Mac to run with Interactive Brokers. I have installed Git. I created a subdirectory ibapi under Home. I downloaded IBPy using git clone https://github.com/blampe/IbPy from the ibapi directory. I am now trying to run the Demo.py program in Spyder. When I choose Run, I […]

Updating application to heroku

I have running app on heroku server. I cloned it make some changes and I want push it back. I added remote heroku repo to my local repository but when i want to push it: Fetching repository, done. Counting objects: 5, done. Delta compression using up to 2 threads. Compressing objects: 100% (3/3), done. Writing […]

How to include matplotlib into a C++ project

I have a project that is coded entirely in C++, in which users code in Python (front-end) to use the package. And since the back-end is using C++, in order to show graphs other developers have used VTK. Now since the front-end language is Python, implementing plotting to ipython notebook, using matplotlib is definitely a […]

pip install from a subdirectory of git repo in non-editable mode

The following works fine: user@host ~/test> pip install -e ‘git+http://git.mydomain.com/project.git#egg=project-sdk&subdirectory=sdk/python’ But the following fails: user@host ~/test> pip install ‘git+http://git.mydomain.com/project.git#egg=project-sdk&subdirectory=sdk/python’ Collecting project from git+http://git.mydomain.com/project.git#egg=project-sdk&subdirectory=sdk/python Cloning git+http://git.mydomain.com/project.git to /tmp/160806751.tmpdir/pip-build-XR8vJn/project-sdk remote: Counting objects: 180, done. remote: Compressing objects: 100% (135/135), done. remote: Total 180 (delta 46), reused 0 (delta 0) Receiving objects: 100% (180/180), 52.71 KiB | 0 […]

How to check my git commit code quality using pylint?

I want to figure want the score for my code is using pylint. I can do this for all the files that were changed in the commit using the following script #!/bin/sh # Auto-check for pep8 so I don’t check in bad code FILES=$(git show –name-only | grep -e ‘\.py$’) if [ -n “$FILES” ]; […]

installing django apps on ubuntu server gives an AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'

i am having hard time installing a django apps on a server using mod_wsgi, i follow this tutorial. I am using django 1.8, python 3.4.3, mysql as SGBD, pip, virtualenv and ubuntu 14.04. The only change is that i used git to install the project (git clone), manage.py call a different setting files used for […]

git show/log without shell escape sequences, for use with python sh

I’m using python‘s sh to script git commands. For example, I do things like import sh git = sh.git.bake(_cwd=’/some/dir/’) project_hash = git(‘rev-parse’, ‘HEAD’).stdout.strip() project_branch = git(‘rev-parse’, ‘–abbrev-ref’, ‘HEAD’).stdout.strip() project_date = git(‘log’, ‘-1’, ‘–pretty=format:%ci’).stdout.strip() and then I write the project_hash, project_branch and project_date into a database, etc. The trouble is git sometimes adds shell escape sequences […]

Installing dependent Github-based packages with pip

I have a Python repo on Github with a setup.py and requirements.txt. Originally, the setup.py contained something this: setup( … install_requires=[x for x in open(“requirements.txt”).read().splitlines() if “://” not in x], dependency_links=[x for x in open(“requirements.txt”).read().splitlines() if “://” in x] ) When I did pip install git+https://github.com/foo/bar.git@branch#egg=foo for this repo, it correctly installs the install_requires dependencies, […]

Can't get specific file version from git repository using Python

I am trying to get specific version of the file from the git repository. In the folder which contains local copy of the repo I am executing following command (using Python script): subprocess.call(“C:\Program Files\Git\bin\git.exe show 34f97c9 folder\file.py > D:\file.py”) Sadly all I get is: fatal: >: no such path in the working tree. Use ‘git […]

have git track changes on a renamed file (with new file to complicate matters)

We have a file that contains models that live in root_dir/model/__init__.py. This is obviously not ideal and it is preferable that this code lives in root_dir/models.py. The problem is that there are older versions of this that need to be maintained, and I expect that there will be changes to the older models that need […]

Git Baby is a git and github fan, let's start git clone.