Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install github repository fails: No files/directories

Tags:

git

python

pip

I'm working on python module, I host it on Github.

For a test, I tried to install it with pip.

I tried several ways that I've seen in this question and this question.

Everytime I get an error from running:

pip install git+git://github.com/amiceli/i2c-module

And the output :

Collecting git+git://github.com/amiceli/i2c-module
Cloning git://github.com/amiceli/i2c-module to /tmp/pip-HbjLru-build
No files/directories in /tmp/pip-HbjLru-build/pip-egg-info (from PKG-INFO)

Or

pip install https://github.com/amiceli/i2c-module

Output :

Collecting https://github.com/amiceli/i2c-module
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90:      

InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. 
For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
 InsecurePlatformWarning
 Downloading https://github.com/amiceli/i2c-module
 - 36kB 328kB/s
Cannot unpack file /tmp/pip-3Qo8KK-unpack/i2c-module (downloaded from /tmp/pip-KnZ537-build, content-type: text/html; charset=utf-8); cannot detect archive format
Cannot determine archive format of /tmp/pip-KnZ537-build

Or again :

pip install git+git://github.com:amiceli/i2c-module.git

Output :

Collecting git+git://github.com:amiceli/i2c-module.git
Cloning git://github.com:amiceli/i2c-module.git to /tmp/pip-d7KPkA-build
fatal: unable to connect to github.com:
github.com: Servname() n'est pas support?e pour ai_socktype

Complete output from command git clone -q git://github.com:amiceli/i2c-module.git /tmp/pip-d7KPkA-build:

 ----------------------------------------
Command "git clone -q git://github.com:amiceli/i2c-module.git /tmp/pip-d7KPkA-build" failed with error code 128 in None

EDIT

I've a new bug. I've installed the module, it works.

But when I try to import it, I've a No module named error.

When I try pip freeze I can see the module in the list.

like image 528
amiceli Avatar asked Feb 10 '23 12:02

amiceli


1 Answers

That's because the Github repository is not a Python package. setup.py says:

  print ('install i2c')

Please read official packaging guide how to create a proper Python package.

like image 167
Mikko Ohtamaa Avatar answered Feb 12 '23 03:02

Mikko Ohtamaa