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

Converting panel application does not accept anymore requirements.txt file: #7565

Open
etihwo opened this issue Dec 20, 2024 · 1 comment · May be fixed by #7566
Open

Converting panel application does not accept anymore requirements.txt file: #7565

etihwo opened this issue Dec 20, 2024 · 1 comment · May be fixed by #7566

Comments

@etihwo
Copy link

etihwo commented Dec 20, 2024

With panel 1.5.5, the convert option with requirements.txt file as described in the documentation is not working anymore. In panel 1.5.4 it is working as expected.

ALL software version info

Windows 10 22H2
Python 3.10.11

Software Version Info
Package            Version
------------------ -----------
bleach             6.2.0
bokeh              3.6.2
certifi            2024.12.14
charset-normalizer 3.4.0
colorama           0.4.6
contourpy          1.3.1
idna               3.10
Jinja2             3.1.4
joblib             1.4.2
linkify-it-py      2.0.3
Markdown           3.7
markdown-it-py     3.0.0
MarkupSafe         3.0.2
mdit-py-plugins    0.4.2
mdurl              0.1.2
numpy              2.2.0
packaging          24.2
pandas             2.2.3
panel              1.5.5
param              2.2.0
pillow             11.0.0
pip                24.3.1
python-dateutil    2.9.0.post0
pytz               2024.2
pyviz_comms        3.0.3
PyYAML             6.0.2
requests           2.32.3
scikit-learn       1.6.0
scipy              1.14.1
setuptools         65.5.0
six                1.17.0
threadpoolctl      3.5.0
tornado            6.4.2
tqdm               4.67.1
typing_extensions  4.12.2
tzdata             2024.2
uc-micro-py        1.0.3
urllib3            2.2.3
webencodings       0.5.1
xgboost            2.1.3
xyzservices        2024.9.0

Description of expected behavior and the observed behavior

Complete, minimal, self-contained example code that reproduces the issue

Follow the example described in the documentation

Then run in the terminal the command with the requirements.txt file

panel convert script.py --to pyodide-worker --out pyodide --requirements requirements.txt

Console output

Failed to convert script.py to pyodide-worker target: Could not resolve requirements file requirements.txt

Tentative of issue location

The issue seems to come from the following lines io/convert.py#L219

elif isinstance(requirements, str) and pathlib.Path(requirements).is_file():

but according the command/convert.py#L107, the requirements is not a str anymore

if req.endswith('.txt'):
                requirements = pathlib.Path(requirements[0])
@hoxbro
Copy link
Member

hoxbro commented Dec 20, 2024

Can you submit a PR with your fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants