NASA-DEVELOP / dnppy

DEVELOP National Program Python package for use with NASA data and GIS!
https://nasa-develop.github.io/dnppy/
Other
81 stars 40 forks source link

pip_install.py gets truncated on dowload #49

Closed Jwely closed 9 years ago

Jwely commented 9 years ago

laptop on wifi seems to truncate the pip install script on download. not sure why yet.

Syntaf commented 9 years ago

I'm running WIFI on my desktop at home and the pip_install.py seems to have downloaded correctly, am I looking at the wrong piece of code?

def get_pip():
    """ ensures pip is installed"""

    try:
        import pip

    except ImportError:
        with open("install_pip.py", 'wb+') as f:
            connection = urllib.urlopen("https://bootstrap.pypa.io/get-pip.py")
            page = connection.read()
            f.write(page)
            f.close()
            del connection

        # run pip and clean up.
        import install_pip
        os.system("install_pip.py")
        os.remove("install_pip.py")
    return
Jwely commented 9 years ago

this is the right piece of code. Only on doctor Ross's laptop in the conference room did this occur. It didn't download that entire string of text characters that contains the pip binary information. That means it missed the tripple double quotes at the end and fails due to syntax on import install_pip.

I really can't figure out why that happened, but it happened twice, and cut off the script at different points each time. It is possible the wifi and the laptop have nothing to do with the problem. Hard drive space was plentiful enough to be an unlikely cause.

Jwely commented 9 years ago

After repeated attempt, we haven't been able to reproduce this result anywhere.