anaconda-graveyard / nb_anacondacloud

Interact with Anaconda Cloud
BSD 2-Clause "Simplified" License
5 stars 9 forks source link

Can't get it to work #32

Closed ijstokes closed 7 years ago

ijstokes commented 7 years ago

I can't get nb_anacondacloud to upload a notebook for me. I can't figure out what is going wrong.

I've published the notebook here: https://anaconda.org/ijstokes/qgrid

At the bottom is the environment.yml spec file, and I've also attached the Conda environment (in the notebook meta-data).

Here is a screencast of the problem: http://screencast.com/t/BcVoTl4YZ

Here are the versions of the relevant packages:

$ conda list | grep -i -e jupyter -e notebook -e nb -e cloud
Using Anaconda Cloud api site https://api.anaconda.org
_nb_ext_conf              0.3.0                    py27_0  
jupyter                   1.0.0                    py27_3  
jupyter_client            4.4.0                    py27_0  
jupyter_console           5.0.0                    py27_0  
jupyter_core              4.1.1                    py27_0  
nb_anacondacloud          1.2.0                    py27_0  
nb_conda                  2.0.0                    py27_0  
nb_conda_kernels          2.0.0                    py27_0  
nbconvert                 4.2.0                    py27_0  
nbformat                  4.1.0                    py27_0  
nbpresent                 3.0.2                    py27_0  
notebook                  4.2.2                    py27_0  
widgetsnbextension        1.2.6                    py27_0  
damianavila commented 7 years ago

Yes, I can reproduce it here... and in the console I get m is not defined... and looking into the code, it seems the case: https://github.com/Anaconda-Platform/nb_anacondacloud/blob/master/nb_anacondacloud/static/main.js#L48

@bollwyvl maybe some leftover from the last update?

ijstokes commented 7 years ago

@damianavila and @bollwyvl this is now a priority issue. I'm sorry I didn't spot it sooner. I had very much intended to show off this behavior as part of the Anaconda video course I'm filming this coming week and I've only just realized it hasn't been resolved yet that I can see. My latest error:

[I 01:49:14.995 NotebookApp] Saving file at /training-video-datascience-python-r/notebooks/3 - Data Wrangling with Pandas.ipynb
[I 01:49:47.096 NotebookApp] Saving file at /training-video-datascience-python-r/notebooks/3 - Data Wrangling with Pandas.ipynb
Using Anaconda API: https://api.anaconda.org
[E 01:49:52.777 NotebookApp] Uncaught exception POST /anaconda-cloud/publish (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/anaconda-cloud/publish', version='HTTP/1.1', remote_ip='::1', headers={'Connection': 'keep-alive', 'Host': 'localhost:8888', 'Content-Length': '649948', 'Accept-Language': 'en,en-US;q=0.5', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Content-Type': 'application/json; charset=utf-8', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0', 'Accept-Encoding': 'gzip, deflate', 'X-Requested-With': 'XMLHttpRequest', 'Referer': 'http://localhost:8888/notebooks/training-video-datascience-python-r/notebooks/3%20-%20Data%20Wrangling%20with%20Pandas.ipynb'})
    Traceback (most recent call last):
      File "/Users/ijstokes/anaconda/envs/intro-ods/lib/python3.5/site-packages/tornado/web.py", line 1467, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/Users/ijstokes/anaconda/envs/intro-ods/lib/python3.5/site-packages/tornado/web.py", line 2829, in wrapper
        return method(self, *args, **kwargs)
      File "/Users/ijstokes/anaconda/envs/intro-ods/lib/python3.5/site-packages/nb_anacondacloud/handlers.py", line 56, in post
        self.finish(json.dumps(uploader.upload()))
      File "/Users/ijstokes/anaconda/envs/intro-ods/lib/python3.5/site-packages/nb_anacondacloud/uploader.py", line 53, in upload
        self.content_io(),
      File "/Users/ijstokes/anaconda/envs/intro-ods/lib/python3.5/site-packages/nb_anacondacloud/uploader.py", line 150, in content_io
        self.content = self.attach_env(self.content)
      File "/Users/ijstokes/anaconda/envs/intro-ods/lib/python3.5/site-packages/nb_anacondacloud/uploader.py", line 104, in attach_env
        channels.append(channel)
    AttributeError: 'tuple' object has no attribute 'append'
[E 01:49:52.784 NotebookApp] {
      "Connection": "keep-alive",
      "Host": "localhost:8888",
      "Content-Length": "649948",
      "Accept-Language": "en,en-US;q=0.5",
      "Accept": "application/json, text/javascript, */*; q=0.01",
      "Content-Type": "application/json; charset=utf-8",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0",
      "Accept-Encoding": "gzip, deflate",
      "X-Requested-With": "XMLHttpRequest",
      "Referer": "http://localhost:8888/notebooks/training-video-datascience-python-r/notebooks/3%20-%20Data%20Wrangling%20with%20Pandas.ipynb"
    }
[E 01:49:52.784 NotebookApp] 500 POST /anaconda-cloud/publish (::1) 5449.43ms referer=http://localhost:8888/notebooks/training-video-datascience-python-r/notebooks/3%20-%20Data%20Wrangling%20with%20Pandas.ipynb
ijstokes commented 7 years ago

Seems like it might be tied to what happens if the "attach Conda environments" check box is ticked.

damianavila commented 7 years ago

Just for your info... despite the fact around the missing variable @bollwyvl is fixing in the reference PR, there is some issues installing the extension with anaconda-client 1.5.3 that I did no experience with the anaconda-client 1.5.1 version... just in case you see something weird.

bollwyvl commented 7 years ago

Ok, we merged #33... now looking at the channels issue...

ijstokes commented 7 years ago

@damianavila or @bollwyvl is this resolved now? I have recently done a fresh install of Anaconda3 4.2 and when I start Jupyter and then try to upload a notebook with the extension I get:

[I 12:07:25.478 NotebookApp] Saving file at /FlightDelay/US_FlightDelay_Analysis_2003to2015.ipynb
[W 12:07:25.501 NotebookApp] 403 POST /anaconda-cloud/publish (::1): '_xsrf' argument missing from POST
[W 12:07:25.502 NotebookApp] 403 POST /anaconda-cloud/publish (::1) 1.18ms referer=http://localhost:8888/notebooks/FlightDelay/US_FlightDelay_Analysis_2003to2015.ipynb

Attached is my current environment:

env.txt

And my Conda info is:

Current conda install:

               platform : osx-64
          conda version : 4.3.4
       conda is private : False
      conda-env version : 4.3.4
    conda-build version : 2.0.2
         python version : 3.5.2.final.0
       requests version : 2.12.4
       root environment : /Users/ijstokes/anaconda  (writable)
    default environment : /Users/ijstokes/anaconda
       envs directories : /Users/ijstokes/anaconda/envs
          package cache : /Users/ijstokes/anaconda/pkgs
           channel URLs : https://conda.anaconda.org/anaconda-fusion/osx-64
                          https://conda.anaconda.org/anaconda-fusion/noarch
                          https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/osx-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/osx-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /Users/ijstokes/.condarc
           offline mode : False
             user-agent : conda/4.3.4 requests/2.12.4 CPython/3.5.2 Darwin/16.3.0 OSX/10.12.2
                UID:GID : 502:20

I have confirmed that I am logged in.

$ anaconda whoami
Using Anaconda API: https://api.anaconda.org
Username: ijstokes
Member since: Wed Jul 31 02:19:49 2013
  +url: http://about.me/ijstokes
  +description: None
  +company: Continuum Analytics
  +user_type: user
  +name: Ian Stokes-Rees
  +location: Syracuse, NY

env.txt

Command line upload worked just fine:

https://anaconda.org/ijstokes/us_flightdelay_analysis_2003to2015

$ anaconda upload US_FlightDelay_Analysis_2003to2015.ipynb 
Using Anaconda API: https://api.anaconda.org
detecting package type ...
ipynb
extracting package attributes for upload ...
done

Uploading file ijstokes/us_flightdelay_analysis_2003to2015/2017.01.18.1213/US_FlightDelay_Analysis_2003to2015.ipynb ... 
 uploaded 61 of 61Kb: 100.00% ETA: 0.0 minutes

Upload(s) Complete

Package located at:
https://anaconda.org/ijstokes/us_flightdelay_analysis_2003to2015
damianavila commented 7 years ago

[W 12:07:25.501 NotebookApp] 403 POST /anaconda-cloud/publish (::1): '_xsrf' argument missing from POST

Are you using notebook 4.3.1? I think it could be related with some latest changes shipped in 4.3.1.

noelmas commented 7 years ago

I am getting the issues posted by ijstokes above as well. What information on my setup would it be useful to post?

platform : osx-64 conda version : 4.3.9 conda is private : False conda-env version : 4.3.9 conda-build version : 1.18.2 python version : 3.5.2.final.0 requests version : 2.7.0 root environment : /Users/Sam/anaconda (writable) default environment : /Users/Sam/anaconda envs directories : /Users/Sam/anaconda/envs package cache : /Users/Sam/anaconda/pkgs channel URLs : https://repo.continuum.io/pkgs/free/osx-64 https://repo.continuum.io/pkgs/free/noarch https://repo.continuum.io/pkgs/r/osx-64 https://repo.continuum.io/pkgs/r/noarch https://repo.continuum.io/pkgs/pro/osx-64 https://repo.continuum.io/pkgs/pro/noarch config file : None offline mode : False user-agent : conda/4.3.9 requests/2.7.0 CPython/3.5.2 Darwin/16.3.0 OSX/10.12.2 UID:GID : 501:20

damianavila commented 7 years ago

What information on my setup would it be useful to post?

notebook and nb_anacondacloud versions will help. Thanks!

damianavila commented 7 years ago
[W 12:07:25.501 NotebookApp] 403 POST /anaconda-cloud/publish (::1): '_xsrf' argument missing from POST

Solved in master, closing now.