简体   繁体   中英

I cannot download tar.gz and .zip files with Python pip

I am writing python -m pip install kivy == 1.11.1 starts loading and when it is time to download the file below :

Collecting Kivy-Garden>=0.1.4 Using cached kivy-garden-0.1.4.tar.gz (6.8 kB)

    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\FATİH\AppData\Local\Programs\Python\Python37\python.exe'
 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\FATH~1\\App
Data\\Local\\Temp\\pip-install-v6bgxyb_\\Kivy-Garden\\setup.py'"'"'; __file__='"
'"'C:\\Users\\FATH~1\\AppData\\Local\\Temp\\pip-install-v6bgxyb_\\Kivy-Garden\\s
etup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().r
eplace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"
'exec'"'"'))' egg_info --egg-base 'C:\Users\FATH~1\AppData\Local\Temp\pip-instal
l-v6bgxyb_\Kivy-Garden\pip-egg-info'
         cwd: C:\Users\FATH~1\AppData\Local\Temp\pip-install-v6bgxyb_\Kivy-Garde
n\
    Complete output (36 lines):
    Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-
1.1.6.tar.gz
    Exception calling "DownloadFile" with "2" argument(s): "Temel alınan bağlant
ı k
    apatıldı: Gönderme işleminde beklenmeyen hata oluştu."
    At line:1 char:47
    + (new-object System.Net.WebClient).DownloadFile <<<< ('https://pypi.python.
org
    /packages/source/s/setuptools/setuptools-1.1.6.tar.gz', 'C:\\Users\\FATH~1\\
App
    Data\\Local\\Temp\\pip-install-v6bgxyb_\\Kivy-Garden\\setuptools-1.1.6.tar.g
z')
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationExceptio
n
        + FullyQualifiedErrorId : DotNetMethodException

    Traceback (most recent call last):
      File "C:\Users\FATH~1\AppData\Local\Temp\pip-install-v6bgxyb_\Kivy-Garden\
ez_setup.py", line 134, in use_setuptools
        pkg_resources.require("setuptools>=" + version)
      File "C:\Users\FATİH\AppData\Local\Programs\Python\Python37\lib\site-packa
ges\pkg_resources\__init__.py", line 901, in require
        needed = self.resolve(parse_requirements(requirements))
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\FATH~1\AppData\Local\Temp\pip-install-v6bgxyb_\Kivy-Garden\
setup.py", line 2, in <module>
        use_setuptools()
      File "C:\Users\FATH~1\AppData\Local\Temp\pip-install-v6bgxyb_\Kivy-Garden\
ez_setup.py", line 152, in use_setuptools
        download_delay)
      File "C:\Users\FATH~1\AppData\Local\Temp\pip-install-v6bgxyb_\Kivy-Garden\
ez_setup.py", line 278, in download_setuptools
        downloader(url, saveto)
      File "C:\Users\FATH~1\AppData\Local\Temp\pip-install-v6bgxyb_\Kivy-Garden\
ez_setup.py", line 165, in download_file_powershell
        subprocess.check_call(cmd)
      File "C:\Users\FATİH\AppData\Local\Programs\Python\Python37\lib\subprocess
.py", line 363, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['powershell', '-Command', "(new-obj
ect System.Net.WebClient).DownloadFile('https://pypi.python.org/packages/source/
s/setuptools/setuptools-1.1.6.tar.gz', 'C:\\\\Users\\\\FATH~1\\\\AppData\\\\Loca
l\\\\Temp\\\\pip-install-v6bgxyb_\\\\Kivy-Garden\\\\setuptools-1.1.6.tar.gz')"]'
 returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
e logs for full command output.

I get this error. I wonder where is the problem ? Can you help me ?

Try to use a virtualenv with recent versions of pip/setuptools/wheel.

With Python 3.7 on Windows, you can do:

C:\Users\FATİH\AppData\Local\Programs\Python\Python37\python.exe -m venv yourenv
yourenv\Scripts\activate
pip install kivy==1.11.1

With a recent version of setuptools, Kivy-Garden installation script should not install an old version of setuptools.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM