troubleshooting

  |   Source

In this post I am giving some pointers to troubleshoot issues when installing packages via conda or pip, as well as some pointers to solve issues running the ipython (now jupyter) notebook on a machine behind a proxy.


install packages via conda or pip behind a proxy

You might run into some problems installing additional libraries via conda or pip and / or running the IPython notebooks, especially on Windows machines behind a proxy, here are a few solutions that may work:


1. Proxy settings for conda:


create a .condarc file (the '.' is important) in your HOME directory (on windows it should be C:\Users\YOU) and add the following lines:


proxy_servers:
    http: http://url:port
    https: http://url:port



2. specify proxy when using pip


If you are running into issues installing libraries via pip, try specifying the proxy to use at the command line, e.g.


pip install --proxy=http://url:port bearcart


3. Set-up system-wide proxy settings


On Macs: in your ${HOME}/.bash_profile, insert these lines

export http_proxy=http://url:port
export https_proxy=http://url:port


On Linux machines, do the same as above in your ${HOME}/.bashrc


On Windows machines:

As an administrator go to Control Panel | System | Advanced Systems Settings | Advanced Tab | Environment Variables | System Variables | New and set

HTTP_PROXY=http://url:port/
HTTPS_PROXY=https://url:port/

You can also do that in a command window by typing (the $ represents the prompt)


$ SET HTTP_PROXY=http://url:port/
$ SET HTTPS_PROXY=http://url:port/



troubleshooting the ipython notebook


1. use Firefox instead of internet explorer to open the notebooks


The IPython notebook is an interactive web-based 'notebook', where executable python code can be weaved with rich comments, graphic outputs etc, which make it ideal for presenting interactive tutorials. When (in a command prompt) you navigate to the directory where you have downloaded the notebooks and type (the $ sign represent the prompt):


$ ipython notebook



a 'dashboard' with the list of notebooks should come up in your browser ... now if you are on windows, chances are that your default browser is Internet Explorer, which is generally bad news. If you encounter problems (blank page, notebooks not loading, kernel interruptions etc), it's probably because of Internet Explorer. What I suggest is that you download Firefox for windows and make it the default browser to open IPython notebooks. To do that you need (once firefox is installed) to do the following :

in a command prompt type (again $ is the prompt):


$ ipython profile create default



it should create a bunch of configuration files in the following directory:


C:\Users\YOU\.ipython\profile_default



go and edit the ipython_notebook_config.py file


search for the line


#c.NotebookApp.browser =''



and replace it by:


import webbrowser
webbrowser.register('firefox', None, webbrowser.GenericBrowser('C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe'))
c.NotebookApp.browser = 'firefox'



2. Specify localhost when calling the IPython notebook


On some configurations, you might also need to call:


$ ipython notebook --ip=127.0.0.1



To specify that the browser should connect to localhost


3. Clear the cache


If you are still running into issues (notably dashboard or IPython notebook not displaying correctly), try clearing the cache of your browser


4. Use an incognito window and the no-browser argument


If all else fails (!), one thing that has been reported working is:


+ launch the ipython notebook in no-browser mode:


ipython notebook --no-browser



You should see an output in the terminal looking like:


...
The IPython Notebook is running at: http://localhost:8888/
...



Note that the URL and port could be different in your case.


Open an incognito window from your browser and copy the URL (http://localhost:8888/) in the address bar

Comments powered by Disqus
    Share