pip install github存储库失败:没有文件/目录

时间:2015-07-20 20:54:24

标签: python git pip

我正在使用python模块,我将它托管在Github上。

对于测试,我尝试使用pip安装它。

我尝试了一些我在this questionthis question中看到过的方法。

每次我从运行中收到错误:

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

输出:

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)

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

输出:

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

或者再次:

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

输出:

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

修改

我有一个新的错误。我已经安装了模块,它可以工作。

但是当我尝试导入它时,我已经No module named error

当我尝试pip freeze时,我可以看到列表中的模块。

1 个答案:

答案 0 :(得分:8)

那是因为Github存储库不是Python包。 setup.py说:

  print ('install i2c')

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

相关问题