Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing Page Unconvertable App #79

Open
firobeid opened this issue Dec 5, 2022 · 3 comments
Open

Sharing Page Unconvertable App #79

firobeid opened this issue Dec 5, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@firobeid
Copy link

firobeid commented Dec 5, 2022

Description

Failed to convert. Make sure you only import packages already installed on the
server.

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/bokeh/application/handlers/code_runner.py", line 231, in run
exec(self._code, module.dict)
File "/tmp/tmpx7l4lfpo/source/app.py", line 7, in
from github import Github
ModuleNotFoundError: No module named 'github'

Reproduction steps

Failed to convert. Make sure you only import packages already installed on the
server.

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/bokeh/application/handlers/code_runner.py", line 231, in run
exec(self._code, module.dict)
File "/tmp/tmpx7l4lfpo/source/app.py", line 7, in
from github import Github
ModuleNotFoundError: No module named 'github'

Requirements

pip install PyGithub

Code

from github import Github
repo_name = 'firobeid/TimeSeriesCompetitionTracker'
# First create a Github instance:

# using an access token
g = Github("xxxx")

# Github Enterprise with custom hostname
# g = Github(base_url="https://api.github.com/firobeid/firobeid.github.io", login_or_token="access_token")
# https://api.github.com/firobeid/firobeid.github.io

# Then play with your Github objects:
for repo in g.get_user().get_repos():
    print(repo.name)

Logs

No response

Additional Context

Package dosent have wasm or none wheel

@firobeid firobeid added the bug Something isn't working label Dec 5, 2022
@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Dec 6, 2022

Hi @firobeid

The issue with PyGithub is that it depends on other python packages that don't work (yet) with pyodide. In the browser console of a panel converted app i see

ValueError: Can't find a pure Python 3 wheel for: 'pynacl>=1.4.0'
ValueError: Can't find a pure Python 3 wheel for 'aiohttp==3.8.1'.
See: https://pyodide.org/en/stable/usage/faq.html#micropip-can-t-find-a-pure-python-wheel
You can use `micropip.install(..., keep_going=True)`to get a list of all packages with missing wheels.

Reproducible Example

from github import Github
import pandas as pd
import panel as pn

pn.extension(sizing_mode="stretch_width")

token = pn.widgets.PasswordInput(name='Github Token', placeholder='Enter your Github Token here...', max_width=500)

@pn.depends(token)
def get_repos(token):
    if not token:
        return "No token provided"
    g = Github(token)
    repositories = g.get_user().get_repos()
    return pd.DataFrame({
        "repository": [repository.name for repository in repositories]
    })

pn.Column(
    token, pn.panel(get_repos, loading_indicator=True)
).servable()

@MarcSkovMadsen
Copy link
Collaborator

I've made a request for supporting pynacl here pyodide/pyodide#3327.

@firobeid
Copy link
Author

firobeid commented Dec 7, 2022

Thank you Marc! I will male sure to request there directly for future packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants