This forum has been archived. All content is frozen. Please use KDE Discuss instead.

non-standard Python path

Tags: None
(comma "," separated)
andsok75
Registered Member
Posts
3
Karma
0

non-standard Python path

Sun Jun 12, 2016 4:09 am
I've got python modules installed in a non-standard location. How do I tell kdevelop where to look for them?

For c++ headers, there is a feature called 'add custom include paths' that solves the problem for a given source file (incidentally, I wasn't able to find the global setting for this).

Is there anything similar for python?
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: non-standard Python path  Topic is solved

Sun Jun 12, 2016 7:40 am
In more recent versions, you can use the same "custom include paths" feature, accessible under right-click on project -> Open configuration -> Includes and Defines.

If that doesn't work yet in your version (I think it's fixed starting with 4.7.2 or something like that), there are two workarounds:
a) add the extra path to $PYTHONPATH before you start kdevelop, e.g. run PYTHONPATH=/my/directory kdevelop
b) open the extra modules as projects, all the open projects are considered include paths as well.

Greetings,
Sven


I'm working on the KDevelop IDE.
andsok75
Registered Member
Posts
3
Karma
0

Re: non-standard Python path

Tue Jun 14, 2016 3:44 am
What do you mean by "right-click on project"?

scummos wrote:In more recent versions, you can use the same "custom include paths" feature, accessible under right-click on project -> Open configuration -> Includes and Defines.

If that doesn't work yet in your version (I think it's fixed starting with 4.7.2 or something like that), there are two workarounds:
a) add the extra path to $PYTHONPATH before you start kdevelop, e.g. run PYTHONPATH=/my/directory kdevelop
b) open the extra modules as projects, all the open projects are considered include paths as well.

Greetings,
Sven
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: non-standard Python path

Tue Jun 14, 2016 11:29 pm
In the projects panel (left side bar by default), right-click on the project folder.


I'm working on the KDevelop IDE.
andsok75
Registered Member
Posts
3
Karma
0

Re: non-standard Python path

Wed Jun 15, 2016 6:23 am
Actually, just running

PYTHONPATH=<custom path to python libraries> kdevelop

was sufficient without any extra steps. Thanks for the tip.

scummos wrote:In the projects panel (left side bar by default), right-click on the project folder.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: non-standard Python path

Wed Jun 15, 2016 2:20 pm
Well, yes, it doesn't require extra steps, but it's not exactly convenient. The second method is preferred.


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]