-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Installed Python Modules Not Accessible #14425
Comments
@TuckAndRoll There is no a general way to fix the issue.
|
@tolusha Do you have any resources that you would recommend for building a che plugin like this? |
By "creating a pluging" a mean just create a new devfile [1] and replace underlying image [2] whith [1] https://github.com/eclipse/che-plugin-registry/blob/master/v3/plugins/ms-python/python/latest/meta.yaml |
@tolusha can we configure the Python extension to pick up the installed python module if it's accessible on the file system? |
@tolusha - Thank you very much for the direction. I have created a custom Python plugin using the microsoft base plugin that is included with Che and successfully deployed it into my environment. @tsmaeder - I don't fully understand how everything works together between the plugin and the development image, but if it were possible to have Python plugin pull the installed modules on the development image (like in the site-packages folder) into the plugin environment that would be ideal. It would also make it easier to support more custom Python environments out of the box. |
On a related note, I have created the image and have also installed COIN-OR's CBC solver to use with the referenced package Pyomo. What's interesting is that I have installed CBC in the image for both the plugin and also the dev image in the exact same way, but running the python script on the dev image via the terminal succeeds, while trying to debug the same file on the plugin fails. I'm currently trying to track down any possible differences between the runtimes, but as of right now I'm a bit stumped. As always, your insight is valuable and appreciated. |
For reference, here are my two docker files for the plugin and the dev file. Pyomo Plugin:
Python Dev Image:
|
Do you have any errors that might be helpful? We faced some issues with debugging python applications recently The idea is that we have to run the application in a dev container and use a remote connection to debug. |
@tolusha
I also have tasks.json that has a run task that will execute the python code in my dev environment, but it's obviously not with a remote debugger attached:
I'm not exactly sure how to set it up for remote debugging. Would I configure that in the launch.json and tasks.json files? Is there an example of how to do that specifically for Python? Do I need to modify the development container image in some way to prepare for this type of debugging? I apologize for my limited knowledge of this so far. Your help is greatly appreciated and I am becoming more and more familiar with the whole system. |
Have a look at my example [1]
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}
]
} [1] https://github.com/che-samples/django-realworld-example-app |
Probably it is possible to debug without modifying sources [1] but I haven't tried yet. |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
/remove-lifecycle stale |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Our sample devfiles come with virtual environment tasks: the Python Django devfile is a good example to use. It will create a virtual environment and install modules from a |
I am very new to Che and I'm trying to get my own python environment set up. I have created my own python docker image that has a 3rd party python module (Pyomo) installed. When I create a workspace and pull this image in via the devfile I can't use the module. I can open a terminal to that image and see that it is installed, but when I run my python script in Theia it doesn't recognize it as being installed. When I try to run
it fails because it can't find it.
My devfile:
My docker file for the custom python image:
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: