Install package behind proxy

37 views
Skip to first unread message

Vinay Wagh

unread,
Dec 13, 2011, 2:11:17 AM12/13/11
to sage-s...@googlegroups.com
Our institute network uses authenticated proxy. I am having trouble installing a package using
sage -i OR sage -f from command-line. I am using sage-4.7.2 on Ubuntu 12.04 (development branch).

I just tried to install sage-mode. The error is:
----------------------------
Deleting directories from past builds of previous/current versions of sage-mode-0.6
/home/vinay/Sage/sage-4.7.2-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/bin/sage-spkg: file sage-mode-0.6 does not exist
Attempting to download it.
Traceback (most recent call last):
  File "/home/vinay/Sage/sage-4.7.2-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/bin/sage-download_package", line 16, in <module>
    urlprx = UrllibProxy(proxy)
NameError: name 'UrllibProxy' is not defined

----------------------------

Then I tried editing the sage-spkg file and inserted  proxy = "http://username:passwd@server:port" just before the line urlprx = UrllibProxy(proxy).

Still the same error. Could this be some other problem of network settings?

Thanks and Regards

-- VInay

Maarten Derickx

unread,
Dec 16, 2011, 1:40:40 PM12/16/11
to sage-s...@googlegroups.com
Dear Vlnay,

You can at least work around the problem by first downloading the spkg file and then do:

sage -i "<path to file in downloads folder>"

The error you get means that the command UrllibProxy in the file /home/vinay/Sage/sage-4.7.2-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/bin/sage-download_package
does not exist. I find this error very strange since in my version of sage-4.7.2.alpha2 there is no urlprx= UrllibProxy(proxy). Did you add that line there yourself, if so you should add

from "<some python package that provides UrllibProxy>" import UrllibProxy

to the file.

Thanks Maarten

Vinay Wagh

unread,
Dec 18, 2011, 2:32:29 AM12/18/11
to sage-s...@googlegroups.com
Thanks Maarten.

I was able to install sage-mode by downloading it to a temporary directory and then sage -i <PATH_TOSPKG_FILE>.

About the proxy, I managed a workaround in two ways:

1. exporting http_proxy="http://user:passwd@server:port/" from the commandline and then execute sage -i package_name. (Also I suspect that here DNS setting also had some role! Guess there was some problem with my DNS settings.)

2. Insert the following two lines at the start of sage-download_package:
      proxy = "http://user:passwd@server:port/"
      urlprx = UrllibProxy(proxy)
and then replace the line
      urllib.urlretrieve(url, file, reporthook)
with
      urlprx.urlretrieve(url, file, reporthook)

By the way sage package repository has still the sage-mode-0.6.

By the way during this process I was wondering how does one "uninstall" a package? The sage documentation does not say anything about uninstall (at least I couldnt find easily.)

Regards

VInay


--
To post to this group, send email to sage-s...@googlegroups.com
To unsubscribe from this group, send email to sage-support...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Maarten Derickx

unread,
Dec 18, 2011, 9:31:17 AM12/18/11
to sage-s...@googlegroups.com
Good to here your problem got solved. Sadly enough sage does not allow easy uninstallation of spkg's. To do this you would have to manually undo everything performed by the spkg-install script wich is in the spkg file.
Reply all
Reply to author
Forward
0 new messages