我不能用Pip安装任何github项目

时间:2017-11-21 11:14:29

标签: python git github cmd pip

我必须在Windows上重新安装很多库。当我想从github安装pycdc时

在Windows上安装pycdc。

pip install git + https://github.com/zrax/pycdc.git

我明白了:

FileNotFoundError:[Errno 2]没有这样的文件或目录:' C:\ Users \ TT \ AppData \ Local \ Temp \ pip-ashu2b4z-build \ setup.py

C:\Users\TT\unroll>pycdc .py
'pycdc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\TT\unroll>pip install git+https://github.com/zrax/pycdc.git
Collecting git+https://github.com/zrax/pycdc.git
  Cloning https://github.com/zrax/pycdc.git to c:\users\TT\appdata\local\temp\pip-ashu2b4z-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\TT\Anaconda3\lib\tokenize.py", line 452, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\TT\\AppData\\Local\\Temp\\pip-ashu2b4z-build\\setup.py'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\TT\AppData\Local\Temp\pip-ashu2b4z-build\

C:\Users\TT\unroll>pip install git+https://github.com/zrax/pycdc.git

我觉得我错过了一些依赖文件

男孩我是否后悔重新安装。 python可能很好用,但设置噩梦

此外:

C:\Users\TT>pip install git+ssh://git@github.com/BlahCo/search/tree/prod_release_branch/ProductName
Collecting git+ssh://git@github.com/BlahCo/search/tree/prod_release_branch/ProductName
  Cloning ssh://git@github.com/BlahCo/search/tree/prod_release_branch/ProductName to c:\users\TT\appdata\local\temp\pip-6x2kywme-build
The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

Command "git clone -q ssh://git@github.com/BlahCo/search/tree/prod_release_branch/ProductName C:\Users\TT\AppData\Local\Temp\pip-6x2kywme-build" failed with error code 128 in None

2 个答案:

答案 0 :(得分:0)

看来你面临着两个不同的问题。 首先,对于pycdc: Pycdc似乎不是一个python包,所以用pip安装它是有意义的(但是没有找到setup.py是合乎逻辑的) 在那里检查github(https://github.com/zrax/pycdc),你需要在那里下载源代码并构建它。

第二,BlahCo: 您正尝试通过ssh代替https安装下载源代码(就像您尝试使用pycdc一样)。如果您尝试使用ssh,则需要使用ssh公钥配置github帐户。 错误git@github.com: Permission denied (publickey)表示您未正确配置帐户 有关详细信息,请参阅:https://help.github.com/articles/connecting-to-github-with-ssh/

答案 1 :(得分:0)

在您的要求中,将带有个人令牌的URL添加到github存储库。

munch
pprint
coloredlogs
git+https://104360bcf4d8a00198bd355d73110ba75866c3e8:@github.company.com/kubernetes-paas/paas-shared-modules.git@master

安装将使用https API而不是ssh,因为您无法提供密钥。

$ pip3 install -r requirements.txt
Collecting git+https://104360bcf4d8a00198bd355d73110ba75866c3e8:@github.company.com/kubernetes-paas/paas-shared-modules.git@master (from -r requirements.txt (line 6))
  Cloning https://104360bcf4d8a00198bd355d73110ba75866c3e8:@github.company.com/kubernetes-paas/paas-shared-modules.git (to master) to /private/var/folders/c8/p20lpvwn1kl7cyk7b282s3x1j2r82f/T/pip-2py7sl6t-build