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

Problem loading multiple packages in py-env #107

Closed
tirthajyoti opened this issue May 2, 2022 · 3 comments
Closed

Problem loading multiple packages in py-env #107

tirthajyoti opened this issue May 2, 2022 · 3 comments
Labels
tag: environment Related to Python environment configuration type: bug Something isn't working

Comments

@tirthajyoti
Copy link

When I have a single package name inside py-env tags, my script works. But more than one, and it cannot load anything and throws out exceptions.

This works,

...
<py-env>
- matplotlib
</py-env>
  </head>

But,

...
<py-env>
- matplotlib
- pandas
</py-env>
  </head>

gives,

JsException(PythonError: Traceback (most recent call last): File "/lib/python3.10/site-packages/_pyodide/_base.py", line 429, in eval_code .run(globals, locals) File "/lib/python3.10/site-packages/_pyodide/_base.py", line 300, in run coroutine = eval(self.code, globals, locals) File "", line 1, in ModuleNotFoundError: No module named 'matplotlib' )
@tirthajyoti
Copy link
Author

I think I figured it out. It is a bit surprising. It looks like that indentation matters here just like in the py-script tag.
This worked. Note the zero indentation of the list of packages.
However, for a single package, I was using random indentation and it worked!

	<py-env>
- matplotlib
- pandas
	</py-env>

@philippjfr philippjfr added type: bug Something isn't working tag: environment Related to Python environment configuration labels May 2, 2022
@TommyDew42
Copy link

TommyDew42 commented May 7, 2022

Maybe we should add an error message to indicate there's an indentation problem? Happy to work on it if we confirm this is what we want!

@fpliger
Copy link
Contributor

fpliger commented Jun 29, 2022

just checked and this is fixed in current main

@fpliger fpliger closed this as completed Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: environment Related to Python environment configuration type: bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants