Bug 430151 - Documentation is missing at least on setting up venv
Summary: Documentation is missing at least on setting up venv
Status: REPORTED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Documentation data (show other bugs)
Version: 5.5.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-08 13:30 UTC by Serhiy Zahoriya
Modified: 2020-12-08 19:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serhiy Zahoriya 2020-12-08 13:30:35 UTC
SUMMARY
At least with Kdevelop 5.5.0 it's not clear how to set up a workflow with a virtual environment

STEPS TO REPRODUCE
1. python3 -m venv venvname
2. source venvname/bin/activate
3. pip install matplotlib
4. Create a project in KDevelop with import matplotlib

OBSERVED RESULT
Far from obvious how should venv be set up. Forums didn't really help. https://forum.kde.org/viewtopic.php?f=218&t=123855 And even need to read the forum to set up a basic feature is a problem.

EXPECTED RESULT
Setting up Python venv is documented.

SOFTWARE/OS VERSIONS
KDevelop 5.5.0, irrelevant because it's about documentation

ADDITIONAL INFORMATION
Comment 1 Sven Brauch 2020-12-08 16:31:27 UTC
You should be able to just set the venv's python interpreter as the python interpreter for the project. Does that work?
Comment 2 Serhiy Zahoriya 2020-12-08 18:38:43 UTC
Unfortunately, it does not.

You mean the 

Projects tool view > a python project context menu > Open configuration > Python settings > Python interpreter

, yes? I've just copied it into a terminal and was able to import module that is not recognized by KDevelop. Any other suggestions?

Just noticed that Konsole output is full of "/bin/sh: 1: indent: not found" for some reason.
Comment 3 Serhiy Zahoriya 2020-12-08 19:35:05 UTC
Something in this script helped https://forum.kde.org/viewtopic.php?f=218&t=123855#p366196

But it's really bad UX to have to wrap the whole launch sequence into a long sh script just for a basic feature to work. Feel free to close this.