Bug 353821 - search paths broken in 1.7.2?
Summary: search paths broken in 1.7.2?
Status: RESOLVED FIXED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Language support (show other bugs)
Version: 1.7.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-12 10:23 UTC by Sven Brauch
Modified: 2015-12-21 12:55 UTC (History)
1 user (show)

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


Attachments
attachment-18884-0.html (2.31 KB, text/html)
2015-10-12 10:30 UTC, Hai Zaar
Details
attachment-19472-0.html (1.40 KB, text/html)
2015-10-12 10:49 UTC, Hai Zaar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Brauch 2015-10-12 10:23:24 UTC
see https://bugs.kde.org/show_bug.cgi?id=349990#c17
Comment 1 Sven Brauch 2015-10-12 10:24:13 UTC
The problem is that your list of search paths is broken; I don't know why, the code which creates that didn't change as far as I can see. What is your sys.path if you print it from python?
Comment 2 Sven Brauch 2015-10-12 10:26:48 UTC
assuming you built this yourself: is the PYTHON_EXECUTABLE define in build/kdevpythonversion.h correct?
Comment 3 Hai Zaar 2015-10-12 10:30:56 UTC
Created attachment 94966 [details]
attachment-18884-0.html

~/dev/kdev-python$ grep PYTHON_EXECUTABLE build/kdevpythonversion.h
#define PYTHON_EXECUTABLE ""

That probably explains it. I've run cmake with :
  cmake -DPYTHON_EXEC=~/.pyenv/versions/3.4.3/bin/python ../

Was anything else required?

P.S. My sys.path looks OK - this is printed from kdevelop shell:

$ python
Python 3.4.3 (default, Aug  9 2015, 12:20:59)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '.../dev/venvs/newp/lib/python3.4/site-packages', '/tmp/newp',
'.../dev/venvs/newp/lib/python34.zip', '.../dev/venvs/newp/lib/python3.4',
'.../dev/venvs/newp/lib/python3.4/plat-linux',
'.../dev/venvs/newp/lib/python3.4/lib-dynload',
'.../.pyenv/versions/3.4.3/lib/python3.4',
'.../.pyenv/versions/3.4.3/lib/python3.4/plat-linux']
>>> import os
>>> os.__file__
'.../dev/venvs/newp/lib/python3.4/os.py'
>>>



On Mon, Oct 12, 2015 at 1:26 PM, Sven Brauch <mail@svenbrauch.de> wrote:

> https://bugs.kde.org/show_bug.cgi?id=353821
>
> --- Comment #2 from Sven Brauch <mail@svenbrauch.de> ---
> assuming you built this yourself: is the PYTHON_EXECUTABLE define in
> build/kdevpythonversion.h correct?
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
Comment 4 Sven Brauch 2015-10-12 10:32:18 UTC
Ah, then that is probably the reason ... I don't know how FindPython.cmake works exactly, but apparently that makes it fail to find the correct path. I suggest you just run ccmake and enter the path there. Let me know if it works after that.
Comment 5 Hai Zaar 2015-10-12 10:49:54 UTC
Created attachment 94967 [details]
attachment-19472-0.html

OK, that fixed it.

As a suggestion - if PYTHON_EXECUTABLE is empty, may be kdev-python should
search for one in the PATH? - this will make it very convenient to use with
python virtualenv.

BTW, Where should I open ticket for FindPython.cmake?



On Mon, Oct 12, 2015 at 1:32 PM, Sven Brauch <mail@svenbrauch.de> wrote:

> https://bugs.kde.org/show_bug.cgi?id=353821
>
> --- Comment #4 from Sven Brauch <mail@svenbrauch.de> ---
> Ah, then that is probably the reason ... I don't know how FindPython.cmake
> works exactly, but apparently that makes it fail to find the correct path.
> I
> suggest you just run ccmake and enter the path there. Let me know if it
> works
> after that.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
Comment 6 Sven Brauch 2015-10-12 11:06:27 UTC
I think I will just add a check so it doesn't even compile. You need python as a dependency anyways, when that is empty then something went wrong.

Not sure about FindPython.cmake, I think we borrowed it a while back and it's now in our repo ... I will investigate if we can maybe use the upstream version now, I don't even recall why we copied it back then.

I'll close this, it was a setup issue it seems.
Comment 7 Sven Brauch 2015-12-21 12:55:57 UTC
Git commit 673a4890fd3becfab22c1e9eda2071dafd08a161 by Sven Brauch.
Committed on 21/12/2015 at 12:55.
Pushed by brauch into branch '1.7-py3'.

fix cmake macro name of python executable
REVIEW:124185

M  +1    -1    kdevpythonversion.h.cmake

http://commits.kde.org/kdev-python/673a4890fd3becfab22c1e9eda2071dafd08a161